Skip to main content

PyPI - Python Version GitHub Actions Workflow Status PyPI - Version

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytbai 1.7.0
File Size Uploaded
pytbai-1.7.0.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytbai 1.7.0
File Interpreter ABI Platform
pytbai-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.3 kB

Release files / pytbai-1.7.0.tar.gz

Download URL pytbai-1.7.0.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b3a567e76347063780d4945ad08b339f18c6984f57b92a098f2c9c977ded5bf6
BLAKE2b-256 checksum
How to use checksums
f20553138981a1e474acd8c2a28b969e7493c8aab0d26746d090de1d3c676fd7
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.0-py3-none-any.whl

Download URL pytbai-1.7.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea0d0359d7d06a6766fedc1fa9421d3b60bf8243a5ebd34decc5c464d2812336
BLAKE2b-256 checksum
How to use checksums
8059d05f2cd5c4d9079b91547066743536aed9a01330403b7424ca00bf11539a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

1.7.1

2 release files

This release

1.7.0 This release

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.9

1 release file

1.4.8

1 release file

1.4.7

1 release file

1.4.6

1 release file

1.4.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2

1 release file

1.1.1

1 release file

1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page