Skip to main content

mxm-config

Version License Python Checked with pyright

Purpose

mxm-config provides deterministic configuration resolution for Money Ex Machina (MXM) applications.

It resolves configuration from an external configuration store using a RuntimeIdentity, applies a fixed layering model, and returns a transparent and reproducible configuration view for the running application.

mxm-config is responsible for configuration resolution only.

It does not manage secrets, discover runtime identity, or own configuration storage.

Installation

pip install mxm-config

Usage

Loading configuration

from pathlib import Path

from mxm.config import load_config
from mxm.types import RuntimeIdentity

identity = RuntimeIdentity(
    app="mxm-moneymachine",
    environment="dev",
    machine="bridge",
    substrate="local-process",
    role="marketdata",
)

cfg = load_config(
    identity=identity,
    store_root=Path("~/mxm-config-store").expanduser(),
)

print(cfg.parameters.refresh_interval)
print(cfg.paths.output)

Using the default config store

from mxm.config import load_config

cfg = load_config(identity=identity)

By default, mxm-config resolves configuration from:

~/mxm-config-store

Design Principles

Separation of Concerns

Configuration, secrets, and runtime identity are separate concerns.

mxm-runtime
    discovers RuntimeIdentity

mxm-config
    resolves configuration

mxm-secrets
    resolves secrets

Determinism

Configuration resolution follows a fixed precedence order.

The same RuntimeIdentity and configuration store will always produce the same resolved configuration.

Transparency

Configuration is stored as plain YAML files.

Layer selection and merge order are explicit and inspectable.

Composability

Each configuration layer expresses a single concern.

Applications compose behavior through layering rather than duplication.

Configuration Store

mxm-config resolves configuration from an external configuration store.

The configuration store is the authoritative source of configuration data.

A typical store layout is:

mxm-config-store/
└── apps/
    └── <app_id>/
        ├── default.yaml
        ├── environment.yaml
        ├── machine.yaml
        ├── substrate.yaml
        └── role.yaml

The configuration store contains configuration data only.

Configuration resolution semantics belong to mxm-config.

Runtime Identity

Configuration selection is driven by a RuntimeIdentity.

RuntimeIdentity
├── app
├── environment
├── machine
├── substrate
└── role

Each identity dimension selects a configuration layer from the store.

Configuration Layers

Configuration is resolved by merging the following layers (lowest → highest precedence):

  1. default.yaml
  2. environment.yaml
  3. machine.yaml
  4. substrate.yaml
  5. role.yaml
  6. explicit overrides

For a runtime identity:

app         = mxm-moneymachine
environment = dev
machine     = bridge
substrate   = local-process
role        = marketdata

the resolver selects:

default.yaml
environment.yaml["dev"]
machine.yaml["bridge"]
substrate.yaml["local-process"]
role.yaml["marketdata"]

and merges them in order.

Python API

Loading configuration

cfg = load_config(
    identity=identity,
    store_root=Path("~/mxm-config-store"),
)

Explicit overrides

cfg = load_config(
    identity=identity,
    overrides={
        "parameters.refresh_interval": 60,
    },
)

Command-Line Interface

mxm-config --help

Example:

mxm-config show-config \
  --app mxm-moneymachine \
  --environment dev \
  --machine bridge \
  --substrate local-process \
  --role marketdata

Development

make check

This runs:

  • Ruff (lint + import sorting)
  • Black (format check)
  • Isort (consistency check)
  • Pyright (type checking)
  • Pytest (tests)

Testing

make test

Tests run in isolated temporary directories and use temporary configuration stores.

Roadmap

  • Schema validation
  • Configuration provenance reporting
  • Configuration hashing
  • Layer introspection and diagnostics
  • RuntimeContext integration

License

MIT License. See LICENSE.

Metadata

Release files for mxm-config 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mxm-config 0.6.2
File Size Uploaded
mxm_config-0.6.2.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mxm-config 0.6.2
File Interpreter ABI Platform
mxm_config-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / mxm_config-0.6.2.tar.gz

Download URL mxm_config-0.6.2.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8d87119208d3c3b0e334a562b24a746e1be57f26362cd15d76ec36b9e1cd6e0a
BLAKE2b-256 checksum
How to use checksums
26c8568a94104dce381904f5209d7c3067852c809e8bbeb84439d614d6b7037b
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 Jun 12, 2026.

Transparency log

Release files / mxm_config-0.6.2-py3-none-any.whl

Download URL mxm_config-0.6.2-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a307eb1f0534c2c2a5343441015258b4601c57ecb0de76385e5a285ac4a1cf6
BLAKE2b-256 checksum
How to use checksums
e8c1bfc167ecf4676322ce6a2bae91d0c767a0b9bd9506b0ddeda551de710658
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 Jun 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.3.0

2 release files

0.2.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page