CLI tool to generate pdf invoices written in python

Overview

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

You might also like...
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

A python library for extracting text from PDFs without losing the formatting of the PDF content.

Multilingual PDF to Text Install Package from Pypi Install it using pip. pip install multilingual-pdf2text The library uses Tesseract which can be ins

Performing the following operations using python on PDF.
Performing the following operations using python on PDF.

Python PDF Handling Tutorial Python is a highly versatile language with a huge set of libraries. It is a high level language with simple syntax. Pytho

Python script that split PDF files.

Automatic PDF Splitter This script can create new single-page PDFs files from multipaged PDFs. Requirements Python 3.0+ # Debian distros sudo apt-get

borb is a library for reading, creating and manipulating PDF files in python.
borb is a library for reading, creating and manipulating PDF files in python.

borb is a library for reading, creating and manipulating PDF files in python.

Python lib for Simple PDF text extraction

Python lib for Simple PDF text extraction

x-ray is a Python library for finding bad redactions in PDF documents.
x-ray is a Python library for finding bad redactions in PDF documents.

A tool to detect whether a PDF has a bad redaction

This book will take you on an exploratory journey through the PDF format, and the borb Python library.
This book will take you on an exploratory journey through the PDF format, and the borb Python library.

This book will take you on an exploratory journey through the PDF format, and the borb Python library.

Releases(0.1.2)
  • 0.1.2(Nov 29, 2021)

  • 0.1.1(Nov 26, 2021)

  • 0.1.0(Nov 25, 2021)

    First release.

    Features:

    • init config with sample-config command.
    • provide custom config flag with invoicepy -C, default ~/.pyconfig.json
    • print invoice pdf with pdf command.
    • invoices are saved to user config file (this can be disabled with --no-save option).
    • increment invoice number based on series field for given company based on saved invoices.
    • companies and customers can be saved configured with alias for quick access when creating new invoices.
    • simple template is provided, user can add their own templates with custom_templates_dir option. (-t flag)
    • open generated invoice in browser with -b flag.
    • support for vat lines, simple calculations are done to calculate tax amounts.
    Source code(tar.gz)
    Source code(zip)
    invoicepy-0.1.0.tar.gz(38.44 KB)
Owner
Adam Wojtczak
:snake:
Adam Wojtczak
Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python.

About Zen-Knit: Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. Inspired fro

Zen Reportz 27 Jul 13, 2022
Camelot is a Python library that makes it easy for anyone to extract tables from PDF files

Camelot: PDF Table Extraction for Humans Camelot is a Python library that makes it easy for anyone to extract tables from PDF files! Note: You can als

Atlan Technologies Pvt Ltd 3.3k Jan 06, 2023
A Python tool to generate a static HTML file that represents the internal structure of a PDF file

PDFSyntax A Python tool to generate a static HTML file that represents the internal structure of a PDF file At some point the low-level functions deve

Martin D. 394 Dec 30, 2022
DietPDF aims at reducing PDF file size while not degrading quality nor losing metadata

DietPDF aims at reducing PDF file size while not degrading quality nor losing metadata

Frédéric BISSON 6 Jul 27, 2022
Table automatically extraction from PDF Document

PDF Table Extractor Table automatically extraction from PDF Document Our Icon 📌 Name : PDF Table Extractor 📌 Authors : Minku Koo Jiyong Park 📌 Deve

1 Jan 10, 2022
Simple python tool created for downloading PDF.

PDFdownloader Usage Open PDF in full-screen mode Run scan.exe Enter how many pages you want to scan Focus PDF After scanning is done, run merge.exe En

5 Oct 27, 2021
A simple Python script to convert multiple images (well technically also a single image) into a pdf.

PythonImage2PDF A simple Python script to convert multiple images into a single PDF-document. Created basically for only my own needs for converting m

Joona Gynther 1 Jun 28, 2022
A python library for extracting text from PDFs without losing the formatting of the PDF content.

Multilingual PDF to Text Install Package from Pypi Install it using pip. pip install multilingual-pdf2text The library uses Tesseract which can be ins

Shahrukh Khan 49 Nov 07, 2022
Python lib for Simple PDF text extraction

Python lib for Simple PDF text extraction

Jason Alan Palmer 651 Jan 01, 2023
Merge multiple PDF files into one.

PDF Merger Merge multiple PDF files into one. Usage % python pdf_merger.py -h usage: pdf_merger.py [-h] [-o OUTPUT] [-f [FILES ...]] optional argumen

Duo Apps 6 Oct 03, 2022
Auto Convert PDFs to png files in python

This python tool, which is an application of PyMuPDF module, could auto convert PDFs to png files

Bo-Yu 4 Dec 05, 2021
pdf_sprinkles: sprinkles text in your PDFs

pdf_sprinkles: sprinkles text in your PDFs pdf_sprinkles remotely OCRs a PDF with Google Cloud Document AI, and returns the result as a PDF with searc

Will Angley 2 Dec 17, 2021
A backend for mdbook in Python for generating PDF based on Chrome DevTools Protocol.

mdbook-pdf A backend for mdbook written in Python for generating PDF based on Chrome DevTools Protocol. Python library dependency Usage Put mdbook-pdf

Hollow Man 49 Dec 27, 2022
Python bindings for MuPDF's rendering library.

PyMuPDF 1.19.3 Release date: December 15, 2021 On PyPI since August 2016: Author Jorj X. McKie, based on original code by Ruikai Liu. Introduction PyM

Jorj X. McKie 0 Nov 03, 2022
Program that locks/unlocks pdf files🐍

🐍 📄 PDFtools 📄 🐍 Programa que bloqueia/desbloqueia arquivos pdf Requisitos • Como usar • Capturas de Tela 🚨 Aviso 🚨 Altere os caminhos referente

João Victor Vilela dos Santos 1 Nov 04, 2021
A simple pdf size compressing telegram robot witten in python.

Pdf Compressor Telegram Bot ##About : A simple pdf size compressing telegram robot witten in python. Mostly useful for digital documentation. Deploy t

Renjith Mangal 22 Oct 28, 2022
Python script that split PDF files.

Automatic PDF Splitter This script can create new single-page PDFs files from multipaged PDFs. Requirements Python 3.0+ # Debian distros sudo apt-get

Leandro Padula 5 Apr 02, 2022
Split given PDF document into 4 page groups and convert them to booklet format

PUTO: PDF to Booklet converter Split given PDF document into 4 page groups and convert them to booklet format. It creates a PDF like shown below: Fir

3 Mar 12, 2022
Simple HTML and PDF document generator for Python - with built-in support for popular data analysis and plotting libraries.

Esparto is a simple HTML and PDF document generator for Python. Its primary use is for generating shareable single page reports with content from popular analytics and data science libraries.

Dom 76 Dec 12, 2022
A tool for certificate PDF generation.

certificate-pdf-generator 获奖证书PDF批量生成工具 | a Tool for certificate PDF generation. ⚠️ 下载前请注意 本项目使用了LFS来存储PDF等大文件。在克隆或下载本仓库前,请先使用apt等包管理器安装git-lfs包。如果已经克

Wanghao Xu 4 Nov 28, 2022