pytbai
pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.
Usage
You need to configure your bussiness and software info in a JSON file:
{
"subject": {
"entity_id": "99999974E",
"name": "BUSSINESS NAME"
},
"software": {
"license": "TBAIGIPRE00000000501",
"dev_entity": "P2000000F",
"soft_name": "TBAI",
"soft_version": "1.0"
}
}
Then create a invoice:
from pytbai import TBai
from decimal import Decimal
tbai = TBai(json)
invoice = tbai.create_invoice("TB-2021-S", 1, "First invoice", "S")
invoice.create_line("First product", Decimal("1"), Decimal("200"), Decimal("20"))
invoice.create_line("Second product", Decimal("2"), Decimal("350"))
The json parameter is a previous JSON file you've created.
Finally sign and send the invoice:
result = tbai.sign_and_send("/path_to_p12_certificate", "password")
You can also get the full structure of TBai invoice:
json_structure = tbai.get_json(invoice)
TODO
- Recipient data
- Multiple recipient data
- Third party / Recipient's invoices
- Corrective invoices
- Corrected or replaced invoices
- Tax free invoices
- Invoices without national counterparty
- Chaining of previous invoice
How to contribute
Please read the Code of Conduct documentation first, then all contributions are done via Pull Requests on GitHub but don´t hesitate to open a new issue.
Credits
This project is made by CodeSyntax.
Metadata
Release files for pytbai 1.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytbai-1.7.1.tar.gz | 31.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytbai-1.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.5 kB
Release files / pytbai-1.7.1.tar.gz
| Download URL | pytbai-1.7.1.tar.gz |
|---|---|
| Size | 31.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d343fdb0e1cc4baab93600bf420a79bbb9d10a9e45323516ea422b27a9244b9
|
|
BLAKE2b-256 checksum How to use checksums |
4f23670dc637151e57982d76dc33035351a01f10036511b94009337962449341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / pytbai-1.7.1-py3-none-any.whl
| Download URL | pytbai-1.7.1-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d2de05106462f82a9009e3deac2b3d7f0a3f85b454bbf5d101ed0160ec0f5e9
|
|
BLAKE2b-256 checksum How to use checksums |
470e8dc3d40f6642078524d20f88ee2c4187ba8c87beeef749db104676f283a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|