PyMAD-NG
Python interface to MAD-NG running as a subprocess
🚀 Installation
Install via pip from PyPI:
pip install pymadng
🧠 Getting Started
Before diving into PyMAD-NG, we recommend you:
- Familiarise yourself with MAD-NG — understanding MAD-NG is essential.
- Read the Quick Start Guide to see how to control MAD-NG from Python.
Explore Key Examples
- LHC Matching Example – Real-world optics matching with intermediate feedback.
- Examples Page - List of examples in an easy to read format.
- GitHub Examples Directory – List of available examples on the repository
If anything seems unclear:
- Refer to the API Reference
- Check the MAD-NG Docs
- Or open an issue
📚 Documentation
Full documentation and example breakdowns are hosted at: https://pymadng.readthedocs.io/en/latest/
To build locally:
git clone https://github.com/MethodicalAcceleratorDesign/MAD-NG.py.git
cd MAD-NG.py/docs
make html
🧪 Running Examples
Examples are stored in the examples/ folder.
Run any script with:
python3 examples/ex-fodos.py
You can also batch-run everything using:
python3 runall.py
💡 Features
- High-level Python interface to MAD-NG
- Access to MAD-NG functions, sequences, optics, and tracking
- Dynamic
send()andrecv()communication - Python-native handling of MAD tables and expressions
- Optional integration with
pandasandtfs-pandas
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md or the Contributing Guide in the docs.
Bug reports, feature requests, and pull requests are encouraged.
📜 License
PyMAD-NG is licensed under the GNU General Public License v3.0.
🙌 Acknowledgements
Built on top of MAD-NG, developed at CERN. This interface aims to bring MAD's power to the Python ecosystem with minimal friction.
Metadata
Release files for pymadng 0.9.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymadng-0.9.6.tar.gz | 10.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymadng-0.9.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 MB
Release files / pymadng-0.9.6.tar.gz
| Download URL | pymadng-0.9.6.tar.gz |
|---|---|
| Size | 10.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f581cd57f18cd33ad546e626ce2e0119446e62fd283d422da39dfbd9df96c989
|
|
BLAKE2b-256 checksum How to use checksums |
df265abbf180a7b7a380f40f1c6ce2b5a745e42e4639f0aec77299266b37a3e6
|
| 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 Jul 11, 2026.
Transparency logRelease files / pymadng-0.9.6-py3-none-any.whl
| Download URL | pymadng-0.9.6-py3-none-any.whl |
|---|---|
| Size | 9.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a14819968fbbd8075439f9362478e6366ed275ff0b6a683fbf29f0c965eb3d7
|
|
BLAKE2b-256 checksum How to use checksums |
a5922059842b894dfa8086b12573feca4cbc5aca2832ce67a5b0f505f90254b4
|
| 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 Jul 11, 2026.
Transparency log