types-pyasn1
Typing stubs for pyasn1
What it is and what it does
types-pyasn1 is a type stub package that provides type annotations for the pyasn1 library, which handles ASN.1 (Abstract Syntax Notation One) encoding and decoding. It is part of the typeshed project and enables static type checkers like mypy and pyright to understand and validate code that uses pyasn1, catching type errors at development time rather than runtime.
The package contains no runtime code—it is purely metadata for type checkers. It targets pyasn1 version 0.6.* and has been tested with mypy 2.3.0 and pyright 1.1.411. Installation is lightweight with no dependencies, and it requires Python 3.10 or later. Updates and fixes are contributed upstream to typeshed, so this package tracks the main typeshed repository.
Use it for:
- Enable mypy or pyright to type-check code that imports and uses pyasn1 for ASN.1 serialization tasks.
- Catch type errors in cryptographic or network protocol code that relies on pyasn1 before runtime.
- Provide IDE autocomplete and type hints for pyasn1 APIs in editors that support type stubs.
- Validate data structure definitions and encoding/decoding calls against pyasn1's type contracts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type stubs for the pyasn1 package, enabling static type checkers like mypy and pyright to validate code that uses pyasn1 for ASN.1 encoding and decoding.
Yes, if you use pyasn1 and want static type checking. Install it alongside pyasn1 to enable mypy or pyright to validate your code. It has no runtime cost, is actively maintained, and carries a permissive license. If you do not use a type checker or do not use pyasn1, there is no reason to install it.
Install
types-pyasn1 on PyPI
pip
pip install types-pyasn1uv
uv add types-pyasn1poetry
poetry add types-pyasn1Installing types-pyasn1
Before you install
Low install friction with no runtime dependencies. Actively maintained as part of typeshed, with a recent release (21 days old) and tested against mypy 2.3.0 and pyright 1.1.411.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install types-pyasn1
# In your code, type checkers will now understand pyasn1 types:
import pyasn1
# mypy or pyright will validate pyasn1 usage without errors
Requires Python 3.10 or later; only provides type information, does not provide runtime functionality for pyasn1 itself.
Verify before relying
- Whether coverage of pyasn1 0.6.* API is complete or if some modules lack type annotations.
- Compatibility with pyasn1 versions outside the 0.6.* series.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,513,751/month — #3,031 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_pyasn1-0.6.0.20260724-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
types-netaddrProvides type stubs for the netaddr package,…
permissive · top 15,000 on PyPI
types-pyflakesProvides type stubs for the pyflakes static…
permissive · top 15,000 on PyPI
pyasn1-modulesProvides a collection of ASN.1 data structures…
permissive · top 100 on PyPI
pyasn1Pyasn1 encodes and decodes ASN.1 data…
permissive · top 100 on PyPI
asn1Encodes and decodes ASN.1 data structures using…
permissive · top 5,000 on PyPI
types-boltonsProvides type stubs for the boltons library,…
permissive · top 15,000 on PyPI
types-mypy-extensionsProvides type stubs for mypy-extensions,…
permissive · top 15,000 on PyPI
types-oauthlibProvides type stubs for the oauthlib package,…
permissive · top 5,000 on PyPI
types-networkxProvides type stubs for networkx to enable…
permissive · top 5,000 on PyPI
types-httplib2Provides type stubs for the httplib2 HTTP…
permissive · top 5,000 on PyPI