pyasn1
Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)
Install
pyasn1 on PyPI
pip
pip install pyasn1uv
uv add pyasn1poetry
poetry add pyasn1Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 35 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pyasn1-0.6.4-py3-none-any.whl
About pyasn1
from the package's own PyPI description — quoted content, verbatim
ASN.1 library for Python
PyPI (image) Python Versions (image) Build status (image) Coverage Status (image) GitHub license (image)
This is a free and open source implementation of ASN.1 types and codecs as a Python package. It has been first written to support particular protocol (SNMP) but then generalized to be suitable for a wide range of protocols based on ASN.1 specification.
NOTE: The package is now maintained by Christian Heimes and Simon Pichugin in project https://github.com/pyasn1/pyasn1.
Features
- Generic implementation of ASN.1...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
pyasn1 is a pure-Python implementation of ASN.1 types and codecs (BER, DER, CER) for encoding and decoding structured data used in network protocols and file formats.
Installation is straightforward with no runtime dependencies and a pure-Python wheel distribution. The package is actively maintained with a recent release 35 days ago and an active GitHub repository.
BSD-2-Clause is a permissive license allowing commercial and private use with minimal restrictions; you must retain copyright and license notices in distributed copies.
Usage
pip install pyasn1
from pyasn1.type import univ, namedtype
from pyasn1.codec.der import encoder, decoder
class Record(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('id', univ.Integer())
)
record = Record()
record['id'] = 123
encoded = encoder.encode(record)
decoded, _ = decoder.decode(encoded, asn1Spec=Record())
Requires Python 3.8 or later; pure-Python implementation has no compiled dependencies.
Verdict: pyasn1 is a stable, actively maintained library with zero known vulnerabilities and low install friction. It is well-suited for applications requiring ASN.1 serialization across network protocols and file formats, with broad Python version support (3.8–3.14) and permissive licensing.
Needs verification
- Performance characteristics and memory footprint for large or deeply nested ASN.1 structures compared to alternatives
- Completeness of ASN.1 specification coverage beyond BER/DER/CER (e.g., PER support status mentioned as 'expected' in description)
Similar packages
permissive · top 100 on PyPI
asn1cryptopermissive · top 1,000 on PyPI
croniterpermissive · top 1,000 on PyPI
cbor2permissive · top 1,000 on PyPI
dataclasses-jsonpermissive · top 1,000 on PyPI
fastavropermissive · top 1,000 on PyPI
pytzpermissive · top 100 on PyPI
ruamel.yaml.clibpermissive · top 1,000 on PyPI
python-josepermissive · top 1,000 on PyPI
ujsonpermissive · top 1,000 on PyPI