Building from Source¶
Prerequisites¶
- Zig 0.16+ — download
- Python 3.11+
- uv (recommended) or pip
Setup¶
This compiles the Zig shared library and bundles the data files into the Python package.
Run tests¶
Build wheels¶
# All platforms
python scripts/build_wheels.py
# Specific target
python scripts/build_wheels.py x86_64-linux
See Cross-Compilation for the full list of supported targets.
Project structure¶
mz-drg/
├── msdrg/ # Python package
│ ├── __init__.py # Public API exports
│ ├── grouper.py # MsdrgGrouper class
│ └── mce.py # MceEditor class
├── zig_src/ # Zig source
│ ├── build.zig
│ └── src/
│ ├── c_api.zig # MS-DRG C ABI exports
│ ├── json_api.zig # MS-DRG JSON serialization
│ ├── msdrg.zig # GrouperChain + version routing
│ ├── chain.zig # Composable processor chain
│ ├── mce.zig # MCE main editor
│ ├── mce_c_api.zig # MCE C ABI exports
│ └── ... # Additional modules
├── data/bin/ # Prebuilt binary data (22 files)
├── scripts/ # Data extraction & compilation
├── tests/ # Comparison & benchmark tools
├── docs/ # Documentation (MkDocs)
├── pyproject.toml
└── setup.py