MetoLabs SATCFDI Bridge
A stable, machine-friendly CLI façade over python-satcfdi.
The project is designed to be called from PHP, Node.js, Go, Ruby, Java, shell scripts, job workers, or any runtime that can spawn a process and communicate over stdin/stdout.
Goals
- expose selected
python-satcfdifeatures through a versioned contract; - keep secrets out of command-line arguments;
- make stdout deterministic and safe to parse;
- provide stable error codes independent of Python exception names;
- keep binary payloads out of stdout by default;
- avoid reflection or arbitrary Python method execution;
- make upstream compatibility visible through
capabilitiesand version metadata.
Requirements
- Python 3.10+
satcfdi >= 26.7.4, < 27
The upstream package currently supports Python 3.10 through 3.14.
Installation
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
For development:
python -m pip install -e '.[dev]'
pytest
ruff check .
Recommended integration: JSON over stdin
Never put an e.firma password on the process command line. Spawn only:
satcfdi-bridge exec
Then write a JSON request directly to stdin:
{
"schema_version": "1.0",
"operation": "csf.download",
"params": {
"credentials": {
"certificate": {"path": "/secure/fiel.cer"},
"key": {"path": "/secure/fiel.key"},
"password": "secret-supplied-through-stdin"
},
"output": {
"mode": "file",
"path": "/tmp/constancia.pdf"
}
}
}
stdout contains one JSON response and nothing else.
See docs/PROTOCOL.md and docs/SECURITY.md.
Human CLI
Human-oriented commands are also provided. They prompt for the private-key password without echo:
satcfdi-bridge csf-download \
--certificate /secure/fiel.cer \
--key /secure/fiel.key \
--output ./constancia.pdf
For automation, use exec instead of these convenience commands.
Operations in v0.1
Run:
satcfdi-bridge capabilities --pretty
The initial stable operation registry includes:
credentials.inspectcsf.retrievecsf.downloadcompliance.downloadportal.rfc_validportal.legal_name_validportal.lco_detailsmass.cfdi.request_emittedmass.cfdi.request_receivedmass.cfdi.statusmass.cfdi.downloadmass.retention.request_uuidmass.retention.statusmass.retention.downloadcfdi.inspectcfdi.render
This intentionally does not expose arbitrary satcfdi methods. New upstream features are added as explicit bridge operations so consumers get a stable contract.
Artifact response
File outputs include integrity metadata:
{
"mode": "file",
"path": "/tmp/constancia.pdf",
"filename": "constancia.pdf",
"mime_type": "application/pdf",
"size": 123456,
"sha256": "..."
}
Use Base64 only when the caller cannot share a filesystem with the subprocess:
"output": { "mode": "base64" }
Versioning
There are two independent versions:
- package version (
bridge_version), following SemVer; - JSON protocol version (
schema_version/protocol_version).
A breaking JSON contract change requires a new protocol major version. Adding a new optional field or operation does not.
Upstream
This project wraps SAT-CFDI/python-satcfdi and does not copy its implementation. python-satcfdi is an MIT-licensed independent project.
Metadata
Release files for metolabs-satcfdi-bridge 0.1.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 | |
|---|---|---|---|
| metolabs_satcfdi_bridge-0.1.1.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.7 kB
Release files / metolabs_satcfdi_bridge-0.1.1.tar.gz
| Download URL | metolabs_satcfdi_bridge-0.1.1.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5144d6647d47b571046fe24f75c16c167c6752830b6713e4d266186cca89476
|
|
BLAKE2b-256 checksum How to use checksums |
1b8b377766939c8d72dacbe6aaa51c8f5635f8f7ff321cbb2733bf7cc7a56848
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency logRelease files / metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl
| Download URL | metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eaacd88a351732fefea30491e30d589d392fe46fb6fb12b1e328d66b819c13b3
|
|
BLAKE2b-256 checksum How to use checksums |
646a4e99fcd549fbc9bf200b08c2a4271323c10892f4fd96e09c47db72438db3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency log