Skip to main content

invoicepy

invoice

CLI invoice tool, store and print invoices as pdf. save companies and customers for later use.

installation

pip install invoicepy

see troubleshooting section below for common problems

config

config stores companies and customers by alias and invoices. custom_templates_dir is available for customising templates.

write sample config with:

invoicepy sample-config
# then customize it in $HOME/.invoicepy.conf

examples

  1. print pdf saving it in current directory, result is invoice nr. BAR001
invoicepy pdf --company foo --customer bar --line '{"price":10, "qty": 20, "name":"1h services"}' --series BAR
invoice

when above is repeated twice, the invoices numers will increase, BAR002, BAR003. this is calculated per series. see below for more options.

  1. below example won't save invoice in config, open in it browser and use custom template specified in custom_templates_dir:
invoicepy pdf --company foo --customer bar --line ... -b --no-save --series BAR --number 25 --curency USD --template my_custom_template.html

cli

invoicepy [OPTIONS] COMMAND [ARGS]...

Options:
  -C, --config PATH
  --help             Show this message and exit.

Commands:
sample-config        generate sample config in home dir
pdf                  prints pdf to given path

pdf

Options:
  -l, --line TEXT       json string of invoice line, can pass multiple. ex:
                        --line '{"price":15, "qty": 100, "name":"1h cleaning
                        services", "vat": 21}' --line ...  [required]

			The fields are as follows:
			`price` - price of product
			`qty` - quantity of product
			`name` - name of product
			`vat` - vat rate %


  -c, --company TEXT    company alias as in configuration.  [required]
  -r, --customer TEXT   customer alias as in configuration.  [required]
  -d, --date TEXT       invoice date, `create_date` field.
  -e, --due-date TEXT   If due date is not provided, `payment_term_days` is
                        used to calculate it.

  -s, --series TEXT     invoice series  [required]
  -n, --number INTEGER  invoice number, if not provided, it will calculated
                        from company config for given series.

  -u, --currency TEXT   currency, default=EUR
  -o, --output PATH     output path, can be new filepath, directory. If it's
                        not provided the invoice pdf will be saved in current
                        directory.

  -t, --template TEXT   template name, ex. simple.html. `custom_templates_dir`
                        will be searched first, then package templates.

  --save / --no-save    decides whether to store invoice in config file.
  -b, --browser         open generated invoice in browser.
  --help                show this message and exit.

templates

currently two templates are available:

  • simple.html - simple english template (default).
  • simple_lt.html - simple lithuanian/english template.

you can pass your own template name with -t. see custom_templates_dir (config section). have a look on schema below in case you want to write your own templates. templates are written in html and use jinja2 templating language.

schema

troubleshooting

Problem Solution
invoicepy: command not found Your distro didn't append python bin folder to your PATH. You can check where package lives with pip3 show invoicepy and add appropriate path. Example in your .bashrc: export PATH="$PATH:$HOME/.local/bin"
OSError: encoder jpeg2k not available This is caused by pillow needing some extra libs, on Ubuntu: sudo apt-get install libjpeg8-dev then pip install --no-cache-dir -I pillow. On other distros find libjpeg8-dev equiavilent or google around for solutions regarding pillow.
sample-config says Aborting and exists Fixed in 0.1.1

contributing

if you written cool new template or improved some features, feel free to fork and PR. See contributing guidelines.

to-dos

  • use babel for translations and locale
  • extend tests
  • consider moving config to yaml
  • backup copy config on start
  • invoices should have unique ids (maybe companies and customers too?)
  • view saved invoices
  • reprint saved invoices (?)
  • package for arch (AUR)

Credits

This package was created with Cookiecutter and the johanvergeer/cookiecutter-poetry project template.

Template taken from here and slightly modified: https://github.com/sparksuite/simple-html-invoice-template

Licence

Free software: MIT license

Metadata

Release files for invoicepy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for invoicepy 0.1.2
File Size Uploaded Provenance
invoicepy-0.1.2.tar.gz 40.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for invoicepy 0.1.2
File Interpreter ABI Platform
invoicepy-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 81.0 kB

Release files / invoicepy-0.1.2.tar.gz

Download URL invoicepy-0.1.2.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d139049e9a46d7290dac2595998827377911eb9e02a03f61f75a2170b52a1c2a
BLAKE2b-256 checksum
How to use checksums
7d2f42eac2ab0672a2cc23a77fbaf4e948904c80f797bdcd19f09c3e54ddb2a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.7 Linux/5.10.77-3-lts

Release files / invoicepy-0.1.2-py3-none-any.whl

Download URL invoicepy-0.1.2-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fc285c496e7326bfd3e3171e814a0b4af5363bb43260132254913062f5822a3
BLAKE2b-256 checksum
How to use checksums
d99b31ed9701e6f602e84fe862359d3a3afa4d7bed05355d15791e731ed40c99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.7 Linux/5.10.77-3-lts

Security for invoicepy 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page