Skip to main content

Generate beautiful invoices using Python.

Project description

Invogen

PyPI PyPI - Python Version GitHub Travis (.org) branch Coverage Status Build The Docs Code style: black

InvoGen is a package to generate beautiful invoices using Python.

Getting Started

To install InvoGen, simply run

pip install invogen

Using InvoGen

InvoGen is easy to use! In the command prompt or in a file type:

from invogen import *

foobar_inc = Customer("test", name="Foobar Inc.")
invoice = Invoice(foobar_inc)
invoice.add_entry(InvoiceEntry(
    id_code="Test01",
    description="Some entry item",
    rate=5,
    quantity=1,
))
invoice.shipping = 3

You can get a printout of your invoice like this:

>>> print(invoice)

Invoice for Foobar Inc. (test)
|   ID   |     Description      |   Rate   | Quantity |  Amount  |
+--------+----------------------+----------+----------+----------+
| Test01 | Some entry item      |     5.00 |        1 |     5.00 |
+--------+----------------------+----------+----------+----------+
                                             Sub-total:     5.00
                                              Shipping:     3.00
                                              Discount:    -0.00
                                           +---------------------+
                                                 Total:     8.00

To generate a PDF invoice using the default LaTeX template, use

template = LatexTemplate("default.tex")
template.to_pdf(invoice)

N.B. To use LaTeX templates, you will have to have LaTeX installed. You can find out how to install LaTeX for your system here.

Documentation

Documentation can be found on Read the Docs

The docs are built with Sphinx and autodoc. To build the docs as html yourself, use

cd docs
make html

Testing

The tests are in /test. To run the tests with coverage, use

pytest

Contributing

Please feel free to fork and open a pull request if you would like to change something.

The dependencies can be installed using pip and requirements.txt or Pipenv and the Pipfile.

More templates would be especially welcome!

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for invogen, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size invogen-0.3.0-py3-none-any.whl (12.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size invogen-0.3.0.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page