Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

asnkit-gen-python

A plugin for asnkitcc that generates Python code from ASN.1. The generated module imports asnkitrt and, by default, embeds the compiled specification as bytes. It has a data class for each SEQUENCE and SET, an enumeration for each ENUMERATED and a class for each alternative of a CHOICE, all with methods to encode and decode.

$ pip install asnkit-gen-python
$ asnkitcc generate --plugin python -o out foo.asn    # Writes out/foo.py.
>>> from foo import Question
>>> encoded = Question(id=1, question='Is 1+1=3?').encode('uper')
>>> Question.decode(encoded, 'uper')
Question(id=1, question='Is 1+1=3?')

Options, given with --plugin-opt KEY=VALUE:

name

The name of the module, without .py. Default: the name of the first ASN.1 file.

codec

The codec used when none is given. Default: ber.

embed

false to leave the compiled specification out of the module, as for one sent signed or encrypted. The module then has use_asni(data, ...), which takes the contents of the .asni file with the options of asnkitrt.load_asni() (nonce, bound_to, verification_keys, decryption_keys and those to accept any), checks it once and uses it for every codec. Until it is called, encoding and decoding raise RuntimeError. The file has to be compiled from the same specification. Default: true.

Names are converted to Python style: fooBar becomes foo_bar and a type Foo-Bar becomes FooBar. If two names end up the same in Python, generation fails with an error.

License

Apache License 2.0 (LICENSE-COMPILER). The generated code, with the helper code copied into it, is yours to use under terms of your choice, as the header of each file it writes says. The generated code depends on asnkitrt, which is MIT licensed.

Metadata

Release files for asnkit-gen-python 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asnkit-gen-python 2.0.0rc1
File Size Uploaded Provenance
asnkit_gen_python-2.0.0rc1.tar.gz 14.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asnkit-gen-python 2.0.0rc1
File Interpreter ABI Platform
asnkit_gen_python-2.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / asnkit_gen_python-2.0.0rc1.tar.gz

Download URL asnkit_gen_python-2.0.0rc1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c6f1b1f1f56654a73f4f70dcc257ce94472e839f45a9dfd4d03bb03bdb94abd
BLAKE2b-256 checksum
How to use checksums
6a36f36818792e2895a8b6306022258b103747592a5557f506d2bd4dc50727a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 24, 2026.

Transparency log

Release files / asnkit_gen_python-2.0.0rc1-py3-none-any.whl

Download URL asnkit_gen_python-2.0.0rc1-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6dadc6e29ca06f6ac628f78be829476c5fa0e9278e4e19950652017c19276d2
BLAKE2b-256 checksum
How to use checksums
797c78a554f9679a6372c7aeb194528c0e260dbdf9394ff225853534f5517831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 24, 2026.

Transparency log

Security for asnkit-gen-python 2.0.0rc1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asnkit_gen_python-2.0.0rc1.tar.gz

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 Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page