Facturapi API Client
Project description
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
configure
method: If you want to set it in the code, you can import and use theconfigure
method: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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file facturapi-0.1.1.tar.gz
.
File metadata
- Download URL: facturapi-0.1.1.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a5dc5cba990cbba5a52b977a6644703ec2bbf9fd4888b78627e6ee1055f2bd |
|
MD5 | 8f31ab7eabd482d63bae23d57e84a00d |
|
BLAKE2b-256 | 1f89e9a5ed845c0beb0de39619e75ede96c2ccef3b93ba9efe2b6d79a2d4dffe |
File details
Details for the file facturapi-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: facturapi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c738ba53869181a912947da2b2d40a1d9176bc03ce2ece033ecdccbfc363aa6d |
|
MD5 | 6dcfda5a410458cbd9d423caf2d3b0db |
|
BLAKE2b-256 | a3cbc96570a65b2b647bd408456ae0593f710e0ae59acaef1ecc04000464835f |