Skip to main content

invoicepy is a simple cli tool for generating and storing invoices.

Project description

invoicepy

invoice

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

installation

pip install invoicepy

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 in 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

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

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

invoicepy-0.1.1.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

invoicepy-0.1.1-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: invoicepy-0.1.1.tar.gz
  • Upload date:
  • Size: 39.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.10.77-3-lts

File hashes

Hashes for invoicepy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 23a7d7b96b37d3b52e4c82149dd9625c6f4a438925ed8c54b65765adac8dc886
MD5 f89f7c333e0efd63461a2bf3125e4e1a
BLAKE2b-256 1f91805a8254ac4ee044fb030aed2f4608b4e1fa579f58d46e4dc866e22409be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: invoicepy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.10.77-3-lts

File hashes

Hashes for invoicepy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dbff4bc824281c54d22a3a02e65454d4dfd4ce3bd61f73f5d4c7b07e0a8328a
MD5 f034b1901d7c9bf68b4430813bb9fa16
BLAKE2b-256 cbf282f2f141013750125b94606ebc998f3a60bc7d08ca5fa41fec669a60e141

See more details on using hashes here.

Supported by

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