Skip to main content

pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities

Project description

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.

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

pytbai-1.5.6.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

pytbai-1.5.6-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file pytbai-1.5.6.tar.gz.

File metadata

  • Download URL: pytbai-1.5.6.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for pytbai-1.5.6.tar.gz
Algorithm Hash digest
SHA256 cc2b0f8f408efb3497beea5c46c298950e22c4bc69dc24b3a79118468091ad1f
MD5 16d70e4a52334a5ae2b4faff82d4500d
BLAKE2b-256 58964c892754dcea35859f1f0e06a7b7dfab009a918822d5d1149c5ed8de05a3

See more details on using hashes here.

Provenance

File details

Details for the file pytbai-1.5.6-py3-none-any.whl.

File metadata

  • Download URL: pytbai-1.5.6-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for pytbai-1.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1b76053c9f54e4dcc4cbcf2148662f8399d7dcd21f2a1900bac088d910d58ad8
MD5 50cd54bdeb88f15fb585c2890c4f1390
BLAKE2b-256 190d499c0dfe22e0cd517539bbf744b9f21f71c04b8f256efbdd9a1a0a2c83b0

See more details on using hashes here.

Provenance

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