Skip to main content

Facturapi API Client

Project description

Facturapi Logo

FacturAPI – Python Client Library

test codecov PyPI version Code style: black

Español

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:

  1. Environment variable: Just set an environment variable and the library will automatically use it:

    export FACTURAPI_KEY=YOUR_API_KEY
    
  2. Using the configure method: If you want to set it in the code, you can import and use the configure 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:


Developed and maintained with 💙 by Cuenca

Cuenca Logo

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

facturapi-1.0.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

facturapi-1.0.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file facturapi-1.0.0.tar.gz.

File metadata

  • Download URL: facturapi-1.0.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for facturapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9a9dbfa40522ac5433be6374f7b36483fb8b21dc2dfafe389223b18230405b99
MD5 4bc7d3e69fc9977a85fca456ac7ecaf3
BLAKE2b-256 97fdd7328f0ccb63c52dcd81bfae8a0e51cdfd60b08367a91bf5a1a6ac2fc9db

See more details on using hashes here.

File details

Details for the file facturapi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: facturapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for facturapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 070014743ba8b95d3b01c25dcb20f6242505bddba7a6ee03d7c748ff3f523cba
MD5 231c19f9211a020f6b005eba6472fb82
BLAKE2b-256 df0f588357a4870375790aec0b788d473220767cb7fde184e88dcb942886c212

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page