2024-09-17 14:24:19 +02:00
2024-09-17 14:24:19 +02:00
2024-09-17 14:24:19 +02:00

Freelance Invoice

is a simple command line tool to generate invoices for freelance work. It uses a simple template system based on jinja2 to generate the invoice in HTML and then converts it to a PDF using xhtml2pdf.

Install

Use python venv:

python -m venv .venv
source .venv/bin/activate

Build executable:

pip install --upgrade build
python -m build

Install the executable:

pip install .

See where it is installed:

which invoice

usage

invoice -h



There are two yaml files describing your invoice:

  • RG004211.yaml Contains the invoice data. The filename is takes as the invoice id-number.
  • envelope.yaml contains the address data of the sender and the recipient

The invoice data is read from the invoice.yaml file and the address data is read from the envelope.yaml file. The invoice data is then used to fill in the invoice template and the address data is used to fill in the address fields of the invoice.

Some data are globaly available from the envelope template. Some of them can be overriden by the invoice template.

invoice.yaml - The Name of the invoice file is used as the invoice number but you are free to override it in the invoice.yaml file.



```bash
python src/main.py --help
Simple invoice generator for freelancers and small businesses by Torsten Ueberschar

usage: main.py [-h] -b BASE -i INVOICE [-e ENVELOPE] [-t TEMPLATE]

Read invoice and envelope data from yaml file

options:
  -h, --help            show this help message and exit
  -b BASE, --base BASE  base directory for invoice and envelope files
  -i INVOICE, --invoice INVOICE
                        Invoice file name
  -e ENVELOPE, --envelope ENVELOPE
                        Envelope file name
  -t TEMPLATE, --template TEMPLATE
                        directory for template files

example

invoice -b test_data -i invoice.yaml -e envelope.yaml -t test_data/templates

to do

  • give more structure to code
  • make code testable

see also

Description
No description provided
Readme 1.2 MiB
Languages
Python 55.9%
HTML 44.1%