FacturAPI – Python Client Library
This is a Python library for FacturAPI
⚠️Warning: This is still an unofficial library and it is still under development. This is not a final product.⚠️
FacturAPI makes it easy for developers to generate valid Invoices in Mexico (known as Factura Electrónica or CFDI).
This library is based on cuenca-python 💙.
💻 Installation
Just use pip to install de library:
pip install facturapi
🚀 Getting started
Authenticate with your API Key
Be sure to create a free account on FacturAPI and have access to your test or live API keys.
There are two ways to configure your API Key to use the library:
-
Environment variable: Just set an environment variable and the library will automatically use it:
export FACTURAPI_KEY=YOUR_API_KEY
-
Using the
configuremethod: If you want to set it in the code, you can import and use theconfiguremethod:from facturapi import configure configure(api_key='YOUR_API_KEY')
Create a customer
After configuring the API Key, you can use the client to perform many actions on the resources, for example to create a Customer:
import facturapi
from facturapi.resources.customers import CustomerRequest, CustomerUpdateRequest
customer = facturapi.Customer.create(data=CustomerRequest(
legal_name='Frida Kahlo',
tax_id='ABCD111111CBA',
email='frida_kahlo@test.com',
))
For more details on the data used to create a Customer and other resources, be sure to check out the docs.
More examples can be found on the examples directory.
📚 Documentation
You can checkout Facturapi's docs for more info on the API and its resources.
Or checkout the library's docs for usage and more technical details.
💡 Contribute
Found a bug?
Please create an issue addressing the bug and how to replicate it.
Want to contribute?
Be sure to fork the repo and send your PR! Any and all help is appreciated. Also don't forget to keep the coverage above 98%, we love tested code!
Contacts:
-
Facturapi: contacto@facturapi.io
-
Cuenca: dev@cuenca.com
Developed and maintained with 💙 by Cuenca
Metadata
Release files for facturapi 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| facturapi-1.0.1.tar.gz | 19.0 kB | Without provenance | Details for facturapi-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| facturapi-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for facturapi-1.0.1-py3-none-any.whl |
Total release size: 42.4 kB
Release files / facturapi-1.0.1.tar.gz
| Download URL | facturapi-1.0.1.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e19f572b505b49a9cc9a85fb701da93f58ff59b06f525bdfd6c91bf57b2fff6
|
|
BLAKE2b-256 checksum How to use checksums |
81c510a7e2dcbc5797f749102e8b9eeb7be2cd7f313a524b13ee9659b211715f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / facturapi-1.0.1-py3-none-any.whl
| Download URL | facturapi-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7032fcd6f8512bb4ef6cbd139e18ba26ddc945a98b76769a992a933aaaa04d3
|
|
BLAKE2b-256 checksum How to use checksums |
b78934cff0f90e43ddbd002c82ac949d71f24743c0293841be67d9318e8da5b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for facturapi 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.