{"id":21662693,"url":"https://github.com/codesyntax/pytbai","last_synced_at":"2025-04-11T23:42:22.612Z","repository":{"id":175607762,"uuid":"654081140","full_name":"codesyntax/pytbai","owner":"codesyntax","description":"pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.","archived":false,"fork":false,"pushed_at":"2024-05-28T16:40:08.000Z","size":200,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-29T04:09:44.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codesyntax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T10:51:02.000Z","updated_at":"2024-06-06T11:20:24.135Z","dependencies_parsed_at":"2024-06-03T13:34:36.186Z","dependency_job_id":null,"html_url":"https://github.com/codesyntax/pytbai","commit_stats":null,"previous_names":["codesyntax/ticketbai","codesyntax/pytbai"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fpytbai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fpytbai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fpytbai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fpytbai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesyntax","download_url":"https://codeload.github.com/codesyntax/pytbai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497902,"owners_count":21113982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T10:17:43.534Z","updated_at":"2025-04-11T23:42:22.585Z","avatar_url":"https://github.com/codesyntax.png","language":"Python","funding_links":[],"categories":["Facturación Electrónica"],"sub_categories":["TicketBAI"],"readme":"![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytbai)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codesyntax/pytbai/python-package.yml)\n![PyPI - Version](https://img.shields.io/pypi/v/pytbai)\n\n# pytbai\n\npytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.\n\n## Usage\n\nYou need to configure your bussiness and software info in a JSON file:\n\n```json\n{\n  \"subject\": {\n    \"entity_id\": \"99999974E\",\n    \"name\": \"BUSSINESS NAME\"\n  },\n  \"software\": {\n    \"license\": \"TBAIGIPRE00000000501\",\n    \"dev_entity\": \"P2000000F\",\n    \"soft_name\": \"TBAI\",\n    \"soft_version\": \"1.0\"\n  }\n}\n```\n\nThen create a invoice:\n\n```python\nfrom pytbai import TBai\nfrom decimal import Decimal\n\ntbai = TBai(json)\ninvoice = tbai.create_invoice(\"TB-2021-S\", 1, \"First invoice\", \"S\")\n\ninvoice.create_line(\"First product\", Decimal(\"1\"), Decimal(\"200\"), Decimal(\"20\"))\ninvoice.create_line(\"Second product\", Decimal(\"2\"), Decimal(\"350\"))\n```\n\nThe `json` parameter is a previous JSON file you've created.\n\nFinally sign and send the invoice:\n\n```python\nresult = tbai.sign_and_send(\"/path_to_p12_certificate\", \"password\")\n```\n\nYou can also get the full structure of TBai invoice:\n\n```python\njson_structure = tbai.get_json(invoice)\n```\n\n## TODO\n\n- [ ] Recipient data\n- [ ] Multiple recipient data\n- [ ] Third party / Recipient's invoices\n- [ ] Corrective invoices\n- [ ] Corrected or replaced invoices\n- [ ] Tax free invoices\n- [ ] Invoices without national counterparty\n- [x] Chaining of previous invoice\n\n## How to contribute\n\nPlease read the [Code of Conduct documentation](CODE_OF_CONDUCT.md) first, then all contributions are done via Pull Requests on GitHub but don´t hesitate to open a new issue.\n\n## Credits\n\nThis project is made by [CodeSyntax](https://codesyntax.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyntax%2Fpytbai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesyntax%2Fpytbai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyntax%2Fpytbai/lists"}