Automate creation of Obsidian markdown files for art collection
Project description
gesso
Generate Obsidian-ready painting notes from a simple input list. The CLI reads
PERPLEXITY_API_KEY from your environment (or .env), enriches each row via
Perplexity, and writes markdown files from the bundled template.
Pre-requisites
uvfor dependency management
Quickstart
- Install deps:
uv sync - Export
PERPLEXITY_API_KEY(or add to.env) - Run:
uv run imbue --input data/input.txt --output outputs/- Defaults:
--input data/input.txt --output outputs/ --cache .cache
- Defaults:
Input & Template
- Input lines:
number: Title, Artist - Default template:
data/painting-template.md; output files land inoutputs/{title}.md. - Cache:
.cache/{title_artist}.jsonto avoid duplicate API calls. - Open TODO: make template path configurable (flag or env) so non-default templates work.
Flow (per painting)
- Parse input line into
{number, title, artist}. - Check cache; otherwise query Perplexity for metadata.
- Post-process strings into Obsidian-friendly lists/links.
- Render template placeholders and frontmatter.
- Write markdown to the output directory.
Module reference
parse_input(filepath): read lines into structured dicts; warns on invalid rows.get_cache_key(title, artist): normalize to cache filename.load_from_cache / save_to_cache: JSON cache helpers under.cache/.query_painting_metadata(title, artist): Perplexity SDK wrapper usingPERPLEXITY_API_KEY.post_process_fields(data): convert comma-separated strings to lists and wrap wikilinks; drop"Unknown"values.render_markdown(template_path, painting_data, today): fill template placeholders and YAML lists.write_output(output_dir, filename, content): ensure dirs exist and persist markdown.main(...): CLI orchestrator; invoked viauv run imbue.
Error handling
- Missing env key: fails fast with a clear message.
- Input parse errors: warn and skip lines.
- Perplexity failures: log error and skip that painting.
- Cache/IO issues: log warnings and continue to the next item.
Development
- Python 3.13+, managed with
uv. - Style:
uv run ruff format --check .anduv run ruff check . - Tests:
uv run pytest -v --cov --cov-report=xml - CI mirrors these steps (
.github/workflows/ci.yml).
Contributing
- Keep README aligned with behavior; update TODOs when adding features.
- Add tests for new parsing, templating, or API edge cases.
- Run lint/format/tests before sending changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gesso-0.1.0.tar.gz
(9.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gesso-0.1.0-py3-none-any.whl
(7.4 kB
view details)
File details
Details for the file gesso-0.1.0.tar.gz.
File metadata
- Download URL: gesso-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a403183e2bdbd83014b0353e54b60d46e236cb9b54f78f8be691af8a723d8f41
|
|
| MD5 |
669167d7f38c29f09a510ad09d3465c7
|
|
| BLAKE2b-256 |
c603c739523b465908b00c8106e4127c47852793c610b7be69f753289d663c21
|
File details
Details for the file gesso-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gesso-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
205d1be85b6bcbc94199f5b08d1c26daa3a65188b9893ce74dc66b575d58b389
|
|
| MD5 |
6a99e10716897c78b918cea9c18026b2
|
|
| BLAKE2b-256 |
f406b70cd42cbde4a0776eb9de184fd38819f92bfb2987d4b0c23c6f37953e6e
|