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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metolabs_satcfdi_bridge-0.1.1.tar.gz.
File metadata
- Download URL: metolabs_satcfdi_bridge-0.1.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5144d6647d47b571046fe24f75c16c167c6752830b6713e4d266186cca89476
|
|
| MD5 |
f1f32257bbf69439265eeed1ac196eee
|
|
| BLAKE2b-256 |
1b8b377766939c8d72dacbe6aaa51c8f5635f8f7ff321cbb2733bf7cc7a56848
|
Provenance
The following attestation bundles were made for metolabs_satcfdi_bridge-0.1.1.tar.gz:
Publisher:
release.yml on MetoLabs/satcfdi-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metolabs_satcfdi_bridge-0.1.1.tar.gz -
Subject digest:
d5144d6647d47b571046fe24f75c16c167c6752830b6713e4d266186cca89476 - Sigstore transparency entry: 2417653873
- Sigstore integration time:
-
Permalink:
MetoLabs/satcfdi-bridge@78d694ea07c46291c47d6bc8df93495a5ef5bae5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MetoLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78d694ea07c46291c47d6bc8df93495a5ef5bae5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl.
File metadata
- Download URL: metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaacd88a351732fefea30491e30d589d392fe46fb6fb12b1e328d66b819c13b3
|
|
| MD5 |
6f909c57ac258110349a8caff892744f
|
|
| BLAKE2b-256 |
646a4e99fcd549fbc9bf200b08c2a4271323c10892f4fd96e09c47db72438db3
|
Provenance
The following attestation bundles were made for metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl:
Publisher:
release.yml on MetoLabs/satcfdi-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl -
Subject digest:
eaacd88a351732fefea30491e30d589d392fe46fb6fb12b1e328d66b819c13b3 - Sigstore transparency entry: 2417654046
- Sigstore integration time:
-
Permalink:
MetoLabs/satcfdi-bridge@78d694ea07c46291c47d6bc8df93495a5ef5bae5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MetoLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78d694ea07c46291c47d6bc8df93495a5ef5bae5 -
Trigger Event:
release
-
Statement type: