Skip to main content

Local-first CLI for contractor invoices from YAML files.

Project description

ivce

ivce is a local-first CLI for creating, validating, rendering, and emailing contractor invoices from YAML files.

It is designed for service invoices over explicit date ranges, with optional reimbursable expenses and PDF receipt bundles.

Requirements

  • Python 3.12+
  • Typst CLI for PDF rendering: brew install typst

Install

pip install ivce

The PyPI package is named ivce; it installs the ivce command.

Development Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Usage

ivce init
ivce new standard 2026-06
ivce new standard 2026-08 --contractor acme --client globex --reference-profiles
ivce new standard 2026-05 --period-start 2026-05-01 --period-end 2026-05-31
ivce new standard 2026-05 --period-start 2026-05-01 --period-end 2026-05-07 --invoice-number INV-202605-W1 --output workspace/invoices/2026-05-w1.yml
ivce new reimbursement 2026-07
ivce validate workspace/invoices/2026-07.yml
ivce validate private-client/invoices/2026-07.yml --workspace private-client
ivce render workspace/invoices/2026-06.yml
ivce render private-client/invoices/2026-06.yml --workspace private-client
ivce render workspace/invoices/2026-06.yml --template classic
ivce render workspace/invoices/2026-07.yml --with-receipts
ivce email workspace/invoices/2026-06.yml --dry-run
ivce email private-client/invoices/2026-06.yml --workspace private-client --dry-run

Generated PDFs are written to workspace/dist/ by default. Rendered Typst source is written next to the PDF to make debugging template issues straightforward.

Files

  • workspace/invoice.yml: contractor/client defaults.
  • workspace/contractors/name.yml: reusable contractor profiles.
  • workspace/clients/name.yml: reusable client profiles.
  • workspace/invoices/YYYY-MM.yml: invoice data with explicit service period dates.
  • workspace/receipts/YYYY-MM/: optional receipt attachments.
  • workspace/dist/: generated invoice PDFs and receipt bundles.

Receipt Formats

Receipt bundles support pdf, jpg, jpeg, png, heic, and heif receipt files. PDF receipts can contain multiple pages. Image receipts are rendered into the bundle as one receipt page per image. HEIC/HEIF support uses the macOS sips command to convert images locally before bundling.

expenses:
  - date: "2026-07-03"
    description: Train ticket
    amount: "25.00"
    receipt: receipts/2026-07/train-ticket.jpg

Examples

Public fake examples live in examples/sample-data. They cover all built-in templates, profile references, a weekly billing period, and reimbursement display modes.

ivce validate examples/sample-data/invoices/2026-06-modern.yml --workspace examples/sample-data
ivce render examples/sample-data/invoices/2026-06-modern.yml --workspace examples/sample-data

Quickstart with the included sample workspace:

ivce templates list
ivce validate examples/sample-data/invoices/2026-06-modern.yml --workspace examples/sample-data
ivce render examples/sample-data/invoices/2026-06-classic.yml --workspace examples/sample-data --output-dir /tmp/invoice-example

Templates

The CLI ships with three built-in Typst/Jinja2 templates:

  • modern: polished default with a branded header and summary band.
  • classic: conservative business invoice.
  • minimal: sparse type-driven layout for simple retainers.

List templates and render with a specific one:

ivce templates list
ivce render workspace/invoices/2026-06.yml --template modern
ivce render workspace/invoices/2026-06.yml --template-file ./templates/client.typ.j2

Template choices and branding are copied into each generated invoice so old invoices can be rerendered consistently:

template: modern
brand_color: "#1f4e79"
accent_color: "#d9e8f5"
font: New Computer Modern

Contractor and Client Profiles

Invoices can either snapshot contractor/client data or reference reusable profile files.

Reusable profiles live in:

workspace/contractors/acme.yml
workspace/clients/globex.yml

Snapshot mode is the default. It resolves profiles and copies their current values into the invoice YAML:

ivce new standard 2026-08 --contractor acme --client globex

Reference mode keeps the invoice smaller and resolves profiles when validating, rendering, or emailing:

ivce new standard 2026-08 --contractor acme --client globex --reference-profiles

That creates invoice fields like:

contractor_ref: acme
client_ref: globex

Profile references are profile names, not paths. Receipt paths may be absolute or relative to the selected workspace.

Emailing With Gmail

Client email settings live in each invoice under client:

client:
  name: Globex Corporation
  billing_email: accounts@example.com
  cc:
    - manager@example.com
  email_from: you@example.com

Send through Gmail SMTP with a Gmail app password:

export GMAIL_USER="you@example.com"
export GMAIL_APP_PASSWORD="your-app-password"
ivce email workspace/invoices/2026-06.yml

By default, ivce email attaches workspace/dist/YYYY-MM.pdf. Use --pdf or --receipt-bundle to override or add attachments.

For non-default workspaces, pass --workspace to validate, render, and email so referenced profiles, receipts, and default output paths resolve from that workspace.

Privacy and Safety

Invoice data is stored in local YAML files. Generated PDFs, Typst outputs, receipt bundles, and the default workspace/ directory are intended to stay private and are ignored by this repository.

Email is sent only when ivce email is run without --dry-run. Always validate and render an invoice before sending it.

Data Model

Currency is a string field, so USD is supported without hardcoding the tool to USD only. Monetary amounts are decimal values and are formatted with two fractional digits.

Due dates are optional. Set due_date directly on an invoice, or set defaults.payment_terms_days to generate one automatically. If neither is present, the PDF and default email body omit the due date.

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

ivce-0.1.1.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

ivce-0.1.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ivce-0.1.1.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ivce-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc88934ba4b0d805f7fed5c15de4a2f60a1dae6cf15b9c5bd55976cf4c2a36b4
MD5 a2eb52e189485fd2cd31bd227511f184
BLAKE2b-256 8ca989c7c7d9763825d0681d23639b9431e6104dbf3634026ce1072925dbf251

See more details on using hashes here.

Provenance

The following attestation bundles were made for ivce-0.1.1.tar.gz:

Publisher: publish.yml on dmnelson/ivce

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: ivce-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ivce-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99b824f0b0d11d8ba9bc5cb10d9ca3d58ccc4ec2ecd8c5c6430edf5fb8fed571
MD5 bfc6a37b7738da8a5fc05eff66ca5502
BLAKE2b-256 e13d2260483604908b11b2bbd249c6b640777dd16b44e6b44f2c33164721fcc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ivce-0.1.1-py3-none-any.whl:

Publisher: publish.yml on dmnelson/ivce

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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