# alanube-python
Python library to establish connections with the Alanube API.
## Alanube Docs
[https://developer.alanube.co/docs](https://developer.alanube.co/docs)
## Instalation
```bash
pip install alanube
```
## Use
```py
from alanube import AlanubeDGII
from alanube.dgii.forms import InvoiceForm
alanube = AlanubeDGII(token='YOUR_API_TOKEN')
id_doc = IdDocForm(
encf='E310000000005',
sequence_due_date: '2023-01-01',
tax_amount_indicator: 1,
income_type: 1,
payment_type: 1,
payment_deadline: '2023-01-30',
)
sender = SenderForm(
rnc=101123456,
company_name='My Company SRL',
tradename='My Company',
branch_office='Principal',
address='Calle A, No. 1245, Santo Domingo',
phone_number='8091234567',
mail='mycompany@example.com',
web_site='https://mycompany.example.com',
seller_code='01',
internal_invoice_number='FC0123456789',
stamp_date='2023-01-01',
)
buyer = BuyerForm(
rnc=101123457,
company_name='His Company SRL',
contact='José, Tel: 8091234567',
mail='jose@example.com',
address='Calle B, 1236, San Cristobal',
)
totals = TotalsForm(
total_amount=100.00,
total_taxed_amount=18.00,
amount_period=118.00,
non_billable_amount=0,
i1_amount_taxed=0, # No Facturable
i2_amount_taxed=100.00, # Monto gravado a ITBIS tasa1 (18%).
i3_amount_taxed=0, # Monto gravado a ITBIS tasa1 (16%).
exempt_amount=0, # Monto exento.
itbis_total=18.00, # Total ITBIS
itbis1_total=18.00, # ITBIS (18%)
itbis2_total=0, # ITBIS (16%)
itbis3_total=0, # ITBIS (0%)
additional_tax_amount=None,
additional_taxes=None,
itbis_total_retained=None,
itbis_total_perception=None,
isr_total_retention=None,
isr_total_perception=None,
)
items = [
ItemDetailForm(
line_number=1,
item_code_table=None,
billing_indicator=1,
retention=None,
item_name='Café Entero Paquete',
item_description=None,
good_service_indicator=1,
quantity_item=10,
unit_measure=None,
subquantity_table=None,
unit_price_item=100.00,
discount_amount=0,
sub_discounts=0,
item_amount=1000.00,
),
...
]
config = ConfigForm()
invoice_form = invoice_form_class(
company_id='MY_ALANUBE_COMPANY_ID',
id_doc=id_doc,
sender=sender,
buyer=buyer,
totals=totals,
item_details=items,
subtotals=None,
discounts_or_surcharges=None,
pagination=None,
config=config,
)
response = alanube.create_invoice(invoice_form)
if response.ok:
data = response.json()
else:
print(response.errors)
```
## Licence
This project is licensed under the MIT License.
## Proyect Status
This project is under development
## Contribution 💗
If you find value in this project and would like to show your support, please consider making a donation via PayPal:
[Donate on PayPal](https://paypal.me/martinezwilmer?country.x=DO&locale.x=es_XC)
Your generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!
Raw data
{
"_id": null,
"home_page": "https://github.com/wilmerm/alanube-python",
"name": "alanube",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "alanube,api,dgii,ncf,electronic billing,electronic bill,billing,bill,invoice,erp",
"author": "Wilmer Martinez",
"author_email": "info@wilmermartinez.dev",
"download_url": "https://files.pythonhosted.org/packages/d9/54/b6a999ab3b064ae103701f78649f360fb8f94dbd11228073373061acd909/alanube-0.0.2.tar.gz",
"platform": null,
"description": "# alanube-python\n\nPython library to establish connections with the Alanube API.\n\n## Alanube Docs\n\n[https://developer.alanube.co/docs](https://developer.alanube.co/docs)\n\n## Instalation\n\n```bash\npip install alanube\n```\n\n## Use\n\n```py\nfrom alanube import AlanubeDGII\nfrom alanube.dgii.forms import InvoiceForm\n\nalanube = AlanubeDGII(token='YOUR_API_TOKEN')\n\nid_doc = IdDocForm(\n encf='E310000000005',\n sequence_due_date: '2023-01-01',\n tax_amount_indicator: 1,\n income_type: 1,\n payment_type: 1,\n payment_deadline: '2023-01-30',\n)\n\nsender = SenderForm(\n rnc=101123456,\n company_name='My Company SRL',\n tradename='My Company',\n branch_office='Principal',\n address='Calle A, No. 1245, Santo Domingo',\n phone_number='8091234567',\n mail='mycompany@example.com',\n web_site='https://mycompany.example.com',\n seller_code='01',\n internal_invoice_number='FC0123456789',\n stamp_date='2023-01-01',\n)\n\nbuyer = BuyerForm(\n rnc=101123457,\n company_name='His Company SRL',\n contact='Jos\u00e9, Tel: 8091234567',\n mail='jose@example.com',\n address='Calle B, 1236, San Cristobal',\n)\n\ntotals = TotalsForm(\n total_amount=100.00,\n total_taxed_amount=18.00,\n amount_period=118.00,\n non_billable_amount=0,\n i1_amount_taxed=0, # No Facturable\n i2_amount_taxed=100.00, # Monto gravado a ITBIS tasa1 (18%).\n i3_amount_taxed=0, # Monto gravado a ITBIS tasa1 (16%).\n exempt_amount=0, # Monto exento.\n itbis_total=18.00, # Total ITBIS\n itbis1_total=18.00, # ITBIS (18%)\n itbis2_total=0, # ITBIS (16%)\n itbis3_total=0, # ITBIS (0%)\n additional_tax_amount=None,\n additional_taxes=None,\n itbis_total_retained=None,\n itbis_total_perception=None,\n isr_total_retention=None,\n isr_total_perception=None,\n)\n\nitems = [\n ItemDetailForm(\n line_number=1,\n item_code_table=None,\n billing_indicator=1,\n retention=None,\n item_name='Caf\u00e9 Entero Paquete',\n item_description=None,\n good_service_indicator=1,\n quantity_item=10,\n unit_measure=None,\n subquantity_table=None,\n unit_price_item=100.00,\n discount_amount=0,\n sub_discounts=0,\n item_amount=1000.00,\n ),\n ...\n]\n\nconfig = ConfigForm()\n\ninvoice_form = invoice_form_class(\n company_id='MY_ALANUBE_COMPANY_ID',\n id_doc=id_doc,\n sender=sender,\n buyer=buyer,\n totals=totals,\n item_details=items,\n subtotals=None,\n discounts_or_surcharges=None,\n pagination=None,\n config=config,\n)\n\nresponse = alanube.create_invoice(invoice_form)\n\nif response.ok:\n data = response.json()\nelse:\n print(response.errors)\n\n```\n\n## Licence\n\nThis project is licensed under the MIT License.\n\n## Proyect Status\n\nThis project is under development\n\n## Contribution \ud83d\udc97\n\nIf you find value in this project and would like to show your support, please consider making a donation via PayPal:\n\n[Donate on PayPal](https://paypal.me/martinezwilmer?country.x=DO&locale.x=es_XC)\n\nYour generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Library to establish connections with the Alanube API.",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/wilmerm/alanube-python"
},
"split_keywords": [
"alanube",
"api",
"dgii",
"ncf",
"electronic billing",
"electronic bill",
"billing",
"bill",
"invoice",
"erp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "49abca2d4448b88fcdb3ece8465a9dfa24dcb13c569d6df8ec0ab6aba5b14e93",
"md5": "2aa9e310666be5e8ccb58b3e72341b0b",
"sha256": "73087290f9177b520205924c880369a62e007fea35591b55bfea027ce2472afc"
},
"downloads": -1,
"filename": "alanube-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2aa9e310666be5e8ccb58b3e72341b0b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 33617,
"upload_time": "2023-08-20T09:22:51",
"upload_time_iso_8601": "2023-08-20T09:22:51.281166Z",
"url": "https://files.pythonhosted.org/packages/49/ab/ca2d4448b88fcdb3ece8465a9dfa24dcb13c569d6df8ec0ab6aba5b14e93/alanube-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d954b6a999ab3b064ae103701f78649f360fb8f94dbd11228073373061acd909",
"md5": "37c2a6850a99ad9a8e00d0c2e7bf99e0",
"sha256": "18378a95f46115595832a2f5569c636e03f64b59bbbc6d2cca2167d16f9c5b49"
},
"downloads": -1,
"filename": "alanube-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "37c2a6850a99ad9a8e00d0c2e7bf99e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33321,
"upload_time": "2023-08-20T09:22:52",
"upload_time_iso_8601": "2023-08-20T09:22:52.797673Z",
"url": "https://files.pythonhosted.org/packages/d9/54/b6a999ab3b064ae103701f78649f360fb8f94dbd11228073373061acd909/alanube-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-20 09:22:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wilmerm",
"github_project": "alanube-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "alanube"
}