Talk Quote Work Get-Paid (aka TQWGP) proposal and invoice parser
Your text base sales and accounting toolkit, especially designed for freelancers, by freelancers
Installing
pip install tqwgp-parser
Usage
Parsing proposals
First, declare your quote data:
my_proposal = {
"title": "Tesla Model 3 Configurator",
"date": "29 novembre 2016",
"place": "Philadelphie",
"version": "v1",
"sect": {
"email": "bf@bf-printer.com",
"logo": "tests/samples/tesla_logo.png",
"name": "BF Printer \\& Co",
},
"legal": {
"address": {
"city": "Philadelphie",
"line1": "E Thompson Saint",
"zip": "19125",
},
"siret": "999999999 00099",
},
"author": {
"civility": "M.",
"mobile": "07.73.35.51.00",
"name": "Benjamin Franklin",
"role": "membre",
},
"client": {
"contact": {
"civility": "M.",
"name": "Elon Musk",
"role": "CEO",
"sason": "son",
},
"legal": {
"address": {
"city": "Chambourcy",
"line1": "103 Route de Mantes",
"zip": "78240",
},
"siret": "524335262 00084",
},
"name": "Tesla",
},
"object": "The current proposal includes ...\n",
"prestations": [
{
"description": "Files for describing the steps of product configuration, their prices, etc.",
"price": 5000,
"title": "Definition of configurations",
}
],
}
Note: your can look at more complete and various samples in
tests/samples.
You can then process this proposal data using tqwgp_parser.parse_quote:
import pprint
from tqwgp_parser import parse_quote
my_parsed_proposal = parse_quote(my_proposal)
pprint.pprint(my_parsed_proposal)
Pro-tip: the data can be declared in flat files, for eg. using Yaml or Json formats. It could also be loaded from a database: this is your choice!
Parsing invoices
Declare your invoices data:
my_invoices = {
"sect": {"email": "bf@bf-printer.com", "name": "BF Printer \\& Co"},
"legal": {
"address": {
"city": "Philadelphie",
"line1": "E Thompson Saint",
"zip": "19125",
},
"siret": "999999999 00099",
},
"author": {
"civility": "M.",
"mobile": "07.73.35.51.00",
"name": "Benjamin Franklin",
"role": "membre",
},
"client": {
"contact": {
"civility": "M.",
"name": "Elon Musk",
"role": "CEO",
"sason": "son",
},
"legal": {
"address": {
"city": "Chambourcy",
"line1": "103 Route de Mantes",
"zip": "78240",
},
"siret": "524335262 00084",
},
"name": "Tesla",
},
"invoices": [
{
"date": "5 janvier 2017",
"lines": [{"price": 12000, "title": "Acompte devis 16-TESLA-01"}],
"number": "17001",
"vat_rate": 20,
}
],
}
And process it with the help of tqwgp_parser.parse_invoices:
import pprint
from tqwgp_parser import parse_invoices
my_parsed_invoices = parse_invoices(my_invoices)
pprint.pprint(my_parsed_invoices)
Going further
You could then feed the processed data to your own document edition toolchain to create PDFs from it. This could include using Pandoc and LaTeX to edit the PDF (see for eg. mrzool's invoice-boilerplate setup) ; or sending it to an online PDF compiler with your own template (for eg. with a LaTeX template and LaTeX-on-HTTP), or using HTML/CSS based template (with tooks like WeasyPrint or ReLaXed).
You may also use the parsed data in a web application.
TQWGP text-base documents specification
The format of the TQWGP text-base documents is not finalized.
We'll use this repository as a working specification, through the samples and tests.
Contributing
Tests
To contribute to the parser and specification, please wrote test samples for your modifications.
The tests are written for being runned with pytest:
pipenv run pytest -vv
Metadata
Release files for tqwgp-parser 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tqwgp_parser-1.0.0.tar.gz | 30.6 kB | Without provenance | Details for tqwgp_parser-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tqwgp_parser-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for tqwgp_parser-1.0.0-py3-none-any.whl |
Total release size: 56.8 kB
Release files / tqwgp_parser-1.0.0.tar.gz
| Download URL | tqwgp_parser-1.0.0.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dd732839ae834d640f0b7636d78729c56a97273fbb1e72b3edaf376e96ae813
|
|
BLAKE2b-256 checksum How to use checksums |
86fbb22354d1eb88110d843d9bdd69b45fc390623c79f0770504dd4bbe7e7aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / tqwgp_parser-1.0.0-py3-none-any.whl
| Download URL | tqwgp_parser-1.0.0-py3-none-any.whl |
|---|---|
| Size | 26.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3190cd942e3046edbcb057fdaa48ef3ee7deb57692bbd29cf8c3f2d62e9811e7
|
|
BLAKE2b-256 checksum How to use checksums |
3630da930d1dc777ac43021d500242d3df6b509f2720d3c2ff77e7d7cc93ae60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for tqwgp-parser 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.