Grammar-driven ASN.1 (X.680/X.690 DER subset) parser plugin for swarmauri-sdk using Lark Earley.
Project description
swarmauri-asn1
Grammar-driven ASN.1 schema parsing (X.680) + minimal DER decoding (X.690) for swarmauri-sdk.
- Parser uses Lark Earley (MIT-only path; no standalone LALR).
- Includes a minimal DER TLV decoder covering common UNIVERSAL types, SEQUENCE/SET[/OF], CHOICE, OPTIONAL/DEFAULT, and basic tagging.
Layout
swarmauri_asn1/
├─ swarmauri_asn1/
│ ├─ grammar/asn1.lark
│ ├─ parser.py
│ ├─ tool.py
│ ├─ der_codec.py
│ ├─ transformer.py
│ ├─ ir.py
│ └─ __init__.py
├─ specs/Example.asn
├─ examples/standalone_decode.py
└─ examples/data/question.der
Quick demo (standalone)
python examples/standalone_decode.py
Expected output:
{"id": 42, "question": "Hello"}
swarmauri integration
Install into the same environment as swarmauri-sdk, then instantiate the parser:
from swarmauri.parsers import ASN1Parser
parser = ASN1Parser(asn1_files=["./specs/Example.asn"])
docs = parser.parse("examples/data/question.der", type_name="Question")
print(docs[0].content)
Ensure you have
swarmauri-sdkinstalled; this package registers via entry points.
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 swarmauri_parser_asn1-0.1.1.tar.gz.
File metadata
- Download URL: swarmauri_parser_asn1-0.1.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc230a08d15933bb7987e98dccc9be65aeb2be4d4033236578fa267264377272
|
|
| MD5 |
96358ec42ceeaf5ca7b8fbb60dee4fbc
|
|
| BLAKE2b-256 |
bc7dad4144ad738204c8e9ef7f1d2073aae4ac982b9c2657036b58e4a7155e81
|
File details
Details for the file swarmauri_parser_asn1-0.1.1-py3-none-any.whl.
File metadata
- Download URL: swarmauri_parser_asn1-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b50c6b268fc5b3ad3b0d017cf6b46fdfa9c270e9284ed20aa466fd34b9ed6cc
|
|
| MD5 |
153356ec8b9656ec1dccc3e4fad4cff7
|
|
| BLAKE2b-256 |
b7f31003282ac68efcda00c5c5bcfa6687052d6bcec90a4d0689a02a7ff5ccf2
|