Skip to main content

CLI to generate monthly consulting invoices as PDFs from YAML

Project description

yinv

CLI to generate monthly consulting invoices as PDFs. You edit a YAML draft in your $EDITOR, save, and get a PDF that matches a consistent template.

Install (dev)

brew install pango gdk-pixbuf libffi
uv tool install .   # or: pipx install .

Configure

yinv config set invoices.dir ~/Documents/Invoices
yinv config set client.default <your-client-subdir-name>

invoices.dir is the parent dir containing one subdir per client. Each client's invoices live under {invoices.dir}/{client}/{year}/.

Use

First run

yinv new

If no prior invoice exists for client.default, yinv new writes a placeholder YAML into the correct path and opens it in $EDITOR.

Fill in the placeholders (name, address, bank details, line items), then save and exit your editor. yinv new will validate the YAML and generate the PDF automatically after the editor exits successfully.

The seed file still contains placeholder contact, bank, and pricing values, but the default Consulting fees for <Month YYYY> description is adjusted to the target service month automatically.

Monthly

yinv new

Forks the latest invoice, increments the number, rolls the month forward (updating dates and exact Month YYYY tokens in line-item descriptions), opens in $EDITOR for review, and renders the PDF after the editor exits successfully.

Example: if the previous invoice contains Consulting fees for April 2026, the next one will become Consulting fees for May 2026.

The month rewrite is intentionally narrow: it only replaces the exact previous invoice service-month token. If the prior invoice still says January 2026 or uses a different format such as Jan 2026, that text will be carried forward unchanged.

yinv new --month 2026-07 targets a specific month (skip ahead / regenerate). yinv new --force overwrites an existing target.

Re-render

yinv render <file.yaml>

Writes a fresh PDF next to the YAML. Useful after manually editing a YAML. This is mainly for re-rendering an existing invoice; yinv new already renders the new month's PDF automatically after a successful editor exit.

Commands (v0.1)

Command Purpose
yinv new [--month YYYY-MM] [--force] First-run bootstrap or monthly fork.
yinv render <file.yaml> Render one YAML to PDF.
yinv config set <key> <value> Write a config key.
yinv config get <key> Read a config key.

Data layout

~/Documents/Invoices/            ← invoices.dir
└── <client>/                    ← one subdir per client
    └── 2026/
        ├── March2026.yaml       ← source of truth
        └── March2026.pdf        ← generated from the YAML

Nothing else. No database, no index file. Add another client tomorrow by creating another subdir.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yinv-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yinv-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file yinv-0.1.0.tar.gz.

File metadata

  • Download URL: yinv-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yinv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a15dfa5ecce631c332e54a2fcc433d569ddb22b758f05fd79a734c5dbae79a62
MD5 89cd0e713111423a0a192c2d96170e3d
BLAKE2b-256 864b1c6520ef48ca8f79916b42891293b1ec9cfdaa7246f06ab53f8f455f28ab

See more details on using hashes here.

File details

Details for the file yinv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yinv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yinv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a139e332b516c2b16ee1fd03f2980a7ae6329ffb1abe5ae000315cca3c391e6e
MD5 edac6653eb5335a678ea8dba761077fe
BLAKE2b-256 193d8adab4ed7ff948bd6e927309ac1f8bbd55b7f804253f079b3cbc92cbe2fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page