Skip to main content

Simple invoice generation.

Project description

Brena

Nerdy CLI invoice generator. Brena generates invoices based on a .toml file you define. You can do everything in the terminal. No need to open your browser and trouble yourself. Add a few lines and be done!

Why you might ask? Because I hate to leave the terminal - that's it!

Installation

To install it type:

pip install brena

and you are done. Brena depends on weasyprint, so you might be required to install additional requirements. Look at weasyprint docs. If you don't want to do that - check out the docker option.

Usage

If you have defined your brena.toml file (how to do it is shown below), then you can just:

brena

To generate all the invoices or

brena invoicecode1 invoicecode2

To generate only invoices with specific codes.

You can read a bit more about available commands after typing

brena --help

Config: brena.toml

Below you can see an example of the required brena.toml file. Brena expects this file to be found in current working directory.

[companies.default]  # important to keep it as default 
  name = "Name Of Your Company"
  address_line_1 = "Some streeet 8/10"
  address_line_2 = "11-111 Some City"
  nip = "Your tax id number here if any"
  language = "pl"
  bank_accounts = { PLN = "PL11 1111 1111 1111 1111", EUR = "PL11 1111 1111 1111 1111" }

[companies.someclient]
  name = "Some Client Sp. z o. o."
  address_line_1 = "Another street"
  address_line_2 = "01-111 Warsaw"
  nip = "Your clients tax id if any"


[[invoices]]
  code = "01/12/2020"
  company = "someclient"
  currency = "PLN" # this value needs to be found in bank_accounts keys
  language = "pl"  # for now we only support pl and en
  dates = { issued = "2020-12-25", sold = "2020-12-31", due_to = "2021-01-15"}

  [[invoices.positions]]
    name = "IT service"
    quantity = 1
    amount = 15000
    vat_stake = 23


[[invoices]]
  code = "02/12/2020"
  company = "someclient"
  currency = "EUR"
  language = "en"
  dates = { issued = "2020-12-25", sold = "2020-12-31", due_to = "2021-01-10"}

  [[invoices.positions]] 
    name = "IT services"
    quantity = 172.5
    amount = 85.2
    vat_stake = 23
  
  [[invoices.positions]] 
    name = "Additional invoice position"
    quantity = 1
    amount = 82
    vat_stake = 23

For now I only support toml, maybe yaml in the future. Why toml over yaml? No reason, just my preference in this case.

Dependencies

jinja2 toml WeasyPrint typer

Technology

This bases on toml, weasyprint and jinja2.

Toml is used for configuration. weasyprint gets the html template rendered to pdf. Lastly jinja2 to add some contexts here and there.

Formatting of the code is done using black, isort. flake8, autoflake and bandit to check for potential vulns.

Versioning is done with bumpversion. Patch for merges to develop, minor for merged to master. Merge to master means release to pypi.

And wonderful poetry as dependency manager.

CLI is done with typer <- wonderful CLI library.

I use type hinting where it's possible.

To start developing you need to install poetry pip install poetry and then just poetry install.

Docker

TODO

Known make commands

flake
isort
isort-inplace
bandit
black
linters
bumpversion
black-inplace
autoflake-inplace
format-inplace

Most important ones are make linters and make format-inplace. Before each commit it's required to run these checks.

License

MIT

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

brena-0.0.2.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

brena-0.0.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file brena-0.0.2.tar.gz.

File metadata

  • Download URL: brena-0.0.2.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.9.11-3-MANJARO

File hashes

Hashes for brena-0.0.2.tar.gz
Algorithm Hash digest
SHA256 104a97ae4cf1f778857efff1235a183258d6a2216b8facd5af75bc5a217b3e80
MD5 15211ffea8b833a1657133889b6b2c19
BLAKE2b-256 42657ac466593716db6ab14108693e5dffc30b3da5612a0591d05e5d7218f470

See more details on using hashes here.

File details

Details for the file brena-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: brena-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.9.11-3-MANJARO

File hashes

Hashes for brena-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd6a24e090c0412132de802d373aba5cef231a6ebae8e7df472a4e88de8b250c
MD5 aeab09eca034e7049a75a5d506dcbcff
BLAKE2b-256 3068fe976a8fc3da1f414da1ebb258d2f11233109eda3784940e98c0b082f542

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