cfdibills
Utility to parse CFDI (Mexican invoice) versions 3.3 and 4.0 and validate their status against the SAT.
Features
- Load a CFDI in XML format into a pydantic object
- CFDIs are validated against the XSD schema, but a thorough check (i.e. conditional values) is not performed.
- Query the status of a CFDI via SAT's web service
- DOESN'T REQUIRE additional dependencies to read the XML like libxml2-dev, libxslt-dev
Installation
Run:
pip install cfdibills
Examples
You can load and verify a bill directly from its XML:
import cfdibills
cfdi = cfdibills.read_xml("path/to/bill.xml")
status = cfdibills.verify(cfdi)
Or you can verify it manually:
import cfdibills
status = cfdibills.verify(uuid="folio fiscal", rfc_emisor="re", rfc_receptor="rr", total_facturado=150.00)
In both cases, status would look something like this:
SATConsultaResponse(
codigo_estatus='S - Comprobante obtenido satisfactoriamente.',
es_cancelable='Cancelable con aceptación',
estado='Vigente',
estatus_cancelacion=None,
validacion_efos='200',
)
Contributing
This repository uses pre-commit to help developers perform almost the same validations as in the CI pipeline but before having to wait for a Pull-Request. You can set it up using:
pip install -r requirements_dev.txt
pre-commit install
License
Licensed under the GNU LGPLv3 License.
Metadata
Release files for cfdibills 0.3.0
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 |
|---|---|---|---|---|
| cfdibills-0.3.0.tar.gz | 25.4 kB | Without provenance | Details for cfdibills-0.3.0.tar.gz |
Release files / cfdibills-0.3.0.tar.gz
| Download URL | cfdibills-0.3.0.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e94a0f95e09e5ed7fe8ef5bb9173fa748436531c2b3cd4a3f7002914b3baeceb
|
|
BLAKE2b-256 checksum How to use checksums |
81e8f77cc8cb8807f5f0bb76544d9a4a06a28a6c2c471faa17632649eb7a4d48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for cfdibills 0.3.0
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.