Skip to main content

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-satcfdi features 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 capabilities and 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.inspect
  • csf.retrieve
  • csf.download
  • compliance.download
  • portal.rfc_valid
  • portal.legal_name_valid
  • portal.lco_details
  • mass.cfdi.request_emitted
  • mass.cfdi.request_received
  • mass.cfdi.status
  • mass.cfdi.download
  • mass.retention.request_uuid
  • mass.retention.status
  • mass.retention.download
  • cfdi.inspect
  • cfdi.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

metolabs_satcfdi_bridge-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

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

Hashes for metolabs_satcfdi_bridge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d5144d6647d47b571046fe24f75c16c167c6752830b6713e4d266186cca89476
MD5 f1f32257bbf69439265eeed1ac196eee
BLAKE2b-256 1b8b377766939c8d72dacbe6aaa51c8f5635f8f7ff321cbb2733bf7cc7a56848

See more details on using hashes here.

Provenance

The following attestation bundles were made for metolabs_satcfdi_bridge-0.1.1.tar.gz:

Publisher: release.yml on MetoLabs/satcfdi-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for metolabs_satcfdi_bridge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaacd88a351732fefea30491e30d589d392fe46fb6fb12b1e328d66b819c13b3
MD5 6f909c57ac258110349a8caff892744f
BLAKE2b-256 646a4e99fcd549fbc9bf200b08c2a4271323c10892f4fd96e09c47db72438db3

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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