mxm-dataio
Purpose
mxm-dataio provides a unified ingestion, caching, and audit layer for the Money Ex Machina ecosystem.
It records every external interaction (Session → Request → Response), persists exact payload bytes, and stores structured metadata in SQLite.
The system is designed for deterministic reproducibility, offline caching, and transparent data provenance.
Installation
pip install mxm-dataio
Usage
Basic session usage
from mxm.dataio.api import DataIoSession
from mxm.dataio.adapters import HttpFetcher
from mxm.config import load_config
from mxm.dataio.config.config import dataio_view
cfg = load_config(package="mxm-dataio", env="dev", profile="default")
dio_cfg = dataio_view(cfg)
with DataIoSession(source="http", cfg=dio_cfg) as io:
req = io.request(kind="demo", params={"q": "mxm"})
resp = io.fetch(req)
print(resp.status, resp.checksum, resp.path)
Fetch and cache a resource
session = DataIoSession(cfg=dio_cfg)
result = session.fetch("https://example.com/data.json", fetcher="http")
print(result.status_code)
Send data to an API
result = session.send("https://api.example.com/upload", data=b"...", sender="http")
print(result.status_code)
Overview
mxm-dataio is a lightweight ingestion and audit backbone.
It provides:
- deterministic request identity
- persistent raw payload storage
- structured metadata in SQLite
- adapter-based I/O abstraction
Architecture
mxm-dataio/
├── DataIoSession
├── Request / Response
├── adapters/
└── store/
Each interaction:
Session ─┬─> Request ──> Response
└─> Request ──> Response
Storage layout:
<root>/responses/<session>/<hash>.json
<root>/blobs/<session>/<hash>.bin
Core model
| Concept | Role |
|---|---|
| Session | Groups related requests |
| Request | Deterministic operation identity |
| Response | Archived payload + metadata |
| Adapter | I/O implementation |
| Registry | Adapter mapping |
Configuration
Configuration is loaded via mxm-config and read from the dataio subtree.
Default seed location:
src/mxm/dataio/_data/seed/dataio/
Adapters
Adapters implement fetch/send logic while mxm-dataio handles persistence.
from mxm.dataio.adapters import BaseFetcher
from mxm.dataio.types import AdapterResult
import requests
class HttpFetcher(BaseFetcher):
def fetch(self, url: str, **params) -> AdapterResult:
r = requests.get(url, params=params)
return AdapterResult(
payload=r.content,
meta={"url": r.url, "headers": dict(r.headers)},
content_type=r.headers.get("content-type"),
status_code=r.status_code,
)
Caching and Provenance
Supports policy-driven caching:
- volatile vs eternal data
- TTL-based expiry
- reproducible snapshots
Example provenance:
{
"_provenance": {
"checksum": "sha256:…",
"fetched_at": "2025-10-27T10:45:12Z",
"cache_mode": "default"
}
}
Design principles
- Deterministic
- Auditable
- Minimal dependencies
- Composable
- Human-readable storage
Development
make check
This runs:
- Ruff (lint + imports)
- Black (format)
- Isort (consistency)
- Pyright (typing)
- Pytest (tests)
Roadmap
- Async adapters
- Multi-backend storage
- Delta auditing improvements
- CLI for inspection
License
MIT License. See LICENSE.
Metadata
Release files for mxm-dataio 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mxm_dataio-0.4.3.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mxm_dataio-0.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.0 kB
Release files / mxm_dataio-0.4.3.tar.gz
| Download URL | mxm_dataio-0.4.3.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61846b9ba3d73191ad5cfb5ef6313d877102b85e54fe3b1ca3dba91b31552e44
|
|
BLAKE2b-256 checksum How to use checksums |
83ea33fe296091614c8a38ed762e4dc55b4dc9cb420daa29a6db307d7ed6052a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 12, 2026.
Transparency logRelease files / mxm_dataio-0.4.3-py3-none-any.whl
| Download URL | mxm_dataio-0.4.3-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ab8f01433baa813e53cbb2caa570ca4a86ec99c3ba5ce0456eb517f18d021d6
|
|
BLAKE2b-256 checksum How to use checksums |
7b09e3a0407e2bde51abc6ca9ef61c14eda23cb967736e9fba3c793605acd679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 12, 2026.
Transparency log