Skip to main content

MCMS Data

mcms_data provides declarative data binding and runtime data resolution for MCMS. It resolves data contexts and expressions before component rendering, keeping components independent of data sources and persistence mechanisms.

Responsibilities

  • Define the DataContext abstraction.
  • Resolve named data sources through DataRegistry.
  • Resolve internal data sources through registered Django models.
  • Parse and resolve data expressions using the --expression-- syntax.
  • Build runtime data contexts and support nested context scopes.
  • Resolve both single objects and collections through the same context mechanism.
  • Apply query definitions when retrieving data, according to the implemented query schema.
  • Keep data retrieval and binding resolution outside component definitions and the renderer.

Data context

A data context identifies the source type, registered source name, runtime context name, and query.

{
  "type": "Internal",
  "source": "posts",
  "context": "post",
  "query": {}
}

The initial source type is Internal. The architecture leaves room for additional source types, but external source types such as REST are not part of the initial implementation scope.

Data registry

DataRegistry maps stable source names to registered objects, typically Django models:

data_registry.register("posts", Post)

The registry does not own Django model registration, migrations, persistence, or model construction.

Expressions and nested contexts

Expressions use the form:

--post.title--

A nested context extends the runtime scope established by its parent. Descendants can resolve values from the current context and, where supported by the runtime scope rules, ancestor contexts.

Single objects and collections share the same data-context abstraction. When a source resolves to a collection, the children of the data context act as the item template and are rendered for each item.

Resolution flow

DataContext
    |
    v
DataRegistry
    |
    v
Internal source resolver
    |
    v
Runtime data context
    |
    v
Expression resolver
    |
    v
Resolved component values
    |
    v
mcms_render

Components do not perform ORM queries or retrieve data directly. The persisted render structure remains declarative; resolved values are runtime concerns.

Architectural integrations

Package / system Relationship
mcms_core Shared registry and exception infrastructure
Django models Initial internal data source objects

Scope and limitations

The ADRs establish the context and expression model but leave the complete query schema open. The initial source type is Internal; REST and other external providers are future possibilities. Authentication/authorization, caching, transformations, mutation, and mixed-string interpolation are not defined by the initial decision.

Application configuration

No specific global apps variable or data-root setting is named in the data ADRs. Document actual host-application registration and settings after verifying the implementation.

Dependencies

Architectural integrations

See the integration table. In particular, mcms_data depends conceptually on the common registry contract and Django model metadata for the initial Internal source implementation.

Python distribution dependencies

All MCMS Packages rely on django

Development

uv run pytest packages/mcms-data/tests

Run Ruff and mypy using the repository's configured commands.

Metadata

Release files for mcms-data 0.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for mcms-data 0.1.0
File Interpreter ABI Platform Actions
mcms_data-0.1.0-py3-none-any.whl Python 3 none any Details for mcms_data-0.1.0-py3-none-any.whl

Release files / mcms_data-0.1.0-py3-none-any.whl

Download URL mcms_data-0.1.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2db90a7a1e10b2e21380fbee9f4a990eff0e61d3e08d101d5799fefe659d708f
BLAKE2b-256 checksum
How to use checksums
16dbc93d3bb614668888ac69d365bea9bd080587465ddaaedd405c8b1736a602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"21.3","id":"virginia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mcms-data 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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