diff --git a/note.py b/note.py new file mode 100644 index 0000000..8bd9e94 --- /dev/null +++ b/note.py @@ -0,0 +1,22 @@ +from argparse import ArgumentParser +from pathlib import Path +from datetime import datetime + +ZETTELDIR = Path.home() / "Zettelkasten" +TIMESTAMP = "%Y%m%d%H%M" +TEMPLATE = """# {title} +tags = # +""" + +ap = ArgumentParser() +ap.add_argument('title') +args = ap.parse_args() + +ts = datetime.now().strftime(TIMESTAMP) + +filename = ZETTELDIR / f"{ts} {args.title}.md" + +with open(filename, "w") as fh: + fh.write(TEMPLATE.format(title=args.title)) + +print(filename) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a7622bd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "zettelkak" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.9" +dependencies = [] diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..fb4e3f7 --- /dev/null +++ b/uv.lock @@ -0,0 +1,7 @@ +version = 1 +requires-python = ">=3.9" + +[[package]] +name = "zettelkak" +version = "0.1.0" +source = { virtual = "." }