Shared typing primitives for Money Ex Machina.
Project description
mxm-types
Shared typing primitives for the Money Ex Machina ecosystem.
mxm-types provides a canonical, dependency-free set of JSON/path aliases and micro-protocols used across MXM packages.
It is intentionally small, stable, and domain-agnostic. All domain models live in their respective packages.
Install
pip install mxm-types
Overview
mxm-types defines:
- Strict JSON tree types for use across configuration, metadata, requests, and portable data structures.
- Lightweight aliases for common patterns (e.g., path-like values).
- Micro-protocols for cross-cutting interfaces (e.g., objects with a
getmethod). - PEP 561 typing support (
py.typedincluded in the wheel).
The package has no runtime dependencies.
Public API
The following names form the stable public API of mxm-types.
All other names are private and may change across releases.
JSON Types
| Name | Description |
|---|---|
JSONScalar |
str | int | float | bool | None |
JSONValue |
Strict recursive JSON tree: scalars, list[JSONValue], dict[str, JSONValue] |
JSONLike |
Permissive tree for accepting general Sequence/Mapping inputs |
JSONObj |
Mapping[str, JSONValue] — preferred for function parameters |
JSONMap |
dict[str, JSONValue] — preferred for concrete, mutable results |
Paths
| Name | Description |
|---|---|
StrPath |
str | PathLike[str] |
Protocols and TypedDicts
| Name | Description |
|---|---|
KVReadable |
Minimal protocol: objects exposing a get(key, default) method |
CLIFormatOptions |
Optional formatting hints for CLI output ("plain" | "rich" | "json") |
Usage
from mxm.types import (
JSONValue,
JSONObj,
JSONMap,
StrPath,
KVReadable,
CLIFormatOptions,
)
def load_metadata(path: StrPath) -> JSONObj:
...
For permissive JSON acceptance (e.g., reading config from arbitrary Python structures):
from mxm.types import JSONLike
def normalise(data: JSONLike) -> JSONValue:
...
Design Principles
- Minimal surface: only house-style primitives, no domain models.
- Dependency-free: safe to import everywhere, including low-level layers.
- PEP 695
typealiases: modern, expressive, static-typing-friendly. - Strict JSON encouraged: permissive types optional and explicit.
Development
poetry install
poetry run ruff check .
poetry run pyright
poetry run pytest -q
poetry build
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
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 mxm_types-0.1.0.tar.gz.
File metadata
- Download URL: mxm_types-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63fb6bae5cf43b6b298a6546deee7dfa0cba697dce00c5bb500154b51273350c
|
|
| MD5 |
71c93a6d4c8b70964defa833d82bd269
|
|
| BLAKE2b-256 |
167a8c6bd222492c06ce965cc6d9179a1a879718b8c06c1855d6d9994a764f89
|
Provenance
The following attestation bundles were made for mxm_types-0.1.0.tar.gz:
Publisher:
release.yml on moneyexmachina/mxm-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_types-0.1.0.tar.gz -
Subject digest:
63fb6bae5cf43b6b298a6546deee7dfa0cba697dce00c5bb500154b51273350c - Sigstore transparency entry: 724914647
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-types@b3a0fc294d4422c5b31a6187270ea2e977ce27aa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b3a0fc294d4422c5b31a6187270ea2e977ce27aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file mxm_types-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mxm_types-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d8120c9545d76efbbed508c244d9955b37ac14a58cedb26322e0b205132f0b
|
|
| MD5 |
959a8f660673b112df13cddbc3a689d1
|
|
| BLAKE2b-256 |
0fdee842f0d7574b9b4b8eeb81d137bbfc8538f74b8b3d03c35f7df5cf32772f
|
Provenance
The following attestation bundles were made for mxm_types-0.1.0-py3-none-any.whl:
Publisher:
release.yml on moneyexmachina/mxm-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_types-0.1.0-py3-none-any.whl -
Subject digest:
44d8120c9545d76efbbed508c244d9955b37ac14a58cedb26322e0b205132f0b - Sigstore transparency entry: 724914657
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-types@b3a0fc294d4422c5b31a6187270ea2e977ce27aa -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b3a0fc294d4422c5b31a6187270ea2e977ce27aa -
Trigger Event:
push
-
Statement type: