First version of note.py

This commit is contained in:
Mike Lynch 2025-08-30 14:58:58 +10:00
parent 15349ee9c4
commit 829320940d
3 changed files with 36 additions and 0 deletions

22
note.py Normal file
View File

@ -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)

7
pyproject.toml Normal file
View File

@ -0,0 +1,7 @@
[project]
name = "zettelkak"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9"
dependencies = []

7
uv.lock generated Normal file
View File

@ -0,0 +1,7 @@
version = 1
requires-python = ">=3.9"
[[package]]
name = "zettelkak"
version = "0.1.0"
source = { virtual = "." }