https://github.com/opencyphal/pydsdl
Cyphal DSDL processing front end implemented in Python
https://github.com/opencyphal/pydsdl
compiler-frontend cyphal dsdl opencyphal parser uavcan vehicular-networks
Last synced: 8 months ago
JSON representation
Cyphal DSDL processing front end implemented in Python
- Host: GitHub
- URL: https://github.com/opencyphal/pydsdl
- Owner: OpenCyphal
- License: mit
- Created: 2018-10-19T12:17:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-20T05:56:21.000Z (11 months ago)
- Last Synced: 2025-06-11T12:23:54.376Z (10 months ago)
- Topics: compiler-frontend, cyphal, dsdl, opencyphal, parser, uavcan, vehicular-networks
- Language: Python
- Homepage: https://opencyphal.org
- Size: 761 KB
- Stars: 13
- Watchers: 6
- Forks: 11
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
# PyDSDL
[](https://ci.appveyor.com/project/Zubax/pydsdl/branch/master)
[](https://pydsdl.readthedocs.io/en/latest/?badge=latest)
[](https://pypi.org/project/pydsdl/)
[](https://forum.opencyphal.org)
PyDSDL is a [Cyphal](https://opencyphal.org) DSDL compiler front-end implemented in Python.
It accepts a DSDL namespace at the input and produces a well-annotated abstract syntax tree (AST) at the output,
evaluating all constant expressions in the process.
All DSDL features defined in the Cyphal Specification are supported.
The library should, in theory, work on any platform and with any Python implementation.
**Read the docs at [pydsdl.readthedocs.io](https://pydsdl.readthedocs.io/).**
```python
import pydsdl
try:
types = pydsdl.read_namespace(target_directory, lookup_directories)
except pydsdl.InvalidDefinitionError as ex:
print(f'{ex.path}:{ex.line}: Invalid DSDL: {ex.text}', file=sys.stderr)
exit(1)
else:
for t in types:
print(t) # Process the type -- generate code, analyze, etc.
```