A Python parser for Context Mapper DSL (CML)
Project description
CML Parser
CML Parser
A Python library to parse the Context Mapper Language (CML) using textX. It aims to cover the language defined by the Context Mapper project and is validated against the official sample models.
Context
CML is the DSL for Context Mapper, a toolkit for strategic/tactical Domain-Driven Design modeling. Reference material and canonical examples are maintained by the Context Mapper team:
- Language docs: https://contextmapper.org/
- Official examples repository: https://github.com/ContextMapper/context-mapper-examples
Installation
pip install cml-parser
Usage
from cml_parser import parse_file
model = parse_file("path/to/model.cml")
# On success, model is a textX object graph you can traverse.
print(model)
# If you prefer a non-raising flow:
# from cml_parser import parse_file_safe
# result = parse_file_safe("path/to/model.cml")
# if result.error:
# print("Parsing failed:", result.error)
Development
git clone https://github.com/martin882003/cml_parser.git
cd cml_parser
python -m venv venv
source venv/bin/activate
pip install -e .
pytest
License
MIT License — see LICENSE.
Contact
- Maintainer: Martin Herran — martin882003@gmail.com
Contributing
Contributions are welcome! Please:
- Open an issue describing the change (grammar gaps, bugs, docs).
- Keep coverage: ensure
pytestpasses and new constructs are represented inexamples/or new fixtures. - Submit a PR with a concise summary of the change.
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 cml_parser-0.1.7.tar.gz.
File metadata
- Download URL: cml_parser-0.1.7.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
884263500db4d8e771080e5d093ac163ccbb5d1b220aef668eccc03e02d52214
|
|
| MD5 |
1cb4cb5dfe07014581368556e12c4924
|
|
| BLAKE2b-256 |
594ff358a977de7cfe504a612091e4641daf40e3bbcfb1cb6bb8af02c3e8d4ff
|
File details
Details for the file cml_parser-0.1.7-py3-none-any.whl.
File metadata
- Download URL: cml_parser-0.1.7-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1359ab364eeb2250367d002d50ab4ef3b722669c8515ab5a0775dba3b66dd5b2
|
|
| MD5 |
9ec3a83bfc89ccc02fd91193af1ef42c
|
|
| BLAKE2b-256 |
126faa3edb13f914d2024770e45d11a1b89dc5b1ad8fd30f9c63d74a3df2539f
|