skillfed

types-pyasn1

Typing stubs for pyasn1

types-pyasn1 v0.6.0.20260724 2.5M downloads/30d#3,031 on PyPI37
Permissive license Apache-2.0 Active released

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-pyasn1

uv

uv add types-pyasn1

poetry

poetry add types-pyasn1

Installing 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

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs pyasn1pyasn1 type hintsstatic type checking asn1mypy pyasn1 annotationspyright type stubspython type checking cryptographyasn.1 type annotations
type-stubsstatic-analysis

More Quality Assurance packages