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

brew tap nixmaldonado/yinv
brew install -v yinv

First install can take a couple of minutes so use -v to see it's actually progressing.

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.

Configuration keys

Key Default Description
invoices.dir Parent directory containing one subdir per client.
client.default Client subdirectory to use when running yinv new.
editor $VISUAL / $EDITOR / vi Command used to open YAML drafts for editing.
currency USD Currency code used in invoices.
invoice_number.width 6 Minimum zero-padded width for invoice numbers.

Config is stored in ~/.config/yinv/config.toml.

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.1.tar.gz (21.5 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.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yinv-0.1.1.tar.gz
  • Upload date:
  • Size: 21.5 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.1.tar.gz
Algorithm Hash digest
SHA256 858a8b26f545117648ae5184c9dbf0f34a78a616fa10d4553612ecdc2c407a61
MD5 87054f29c1f044d99fd50bc6243104a2
BLAKE2b-256 9cc12ef39a455243fd950cf0ee0c833bba5ee9d88a90b4878f54ce5926b081eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yinv-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43900648b3d129f427f933d59e5a55ade526d4b1eeb79fb33f0b8f92764e5b2e
MD5 b3dfeb24b627a7ed34b8888a025e8637
BLAKE2b-256 ce03b3c8be0df16f09a0df0454fc9b27b0d4f0a46fdb7180f79c60b4c187258e

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