pysmi
A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.
What it is and what it does
PySMI is a pure-Python tool that reads SNMP MIB files written in ASN.1 and translates them into usable Python code or structured data. It understands multiple SNMP MIB dialects (SMIv1, SMIv2, and non-standard variants) and can generate either PySNMP-compatible Python modules or JSON representations. The tool handles MIB dependencies automatically, pulling source files from local directories, ZIP archives, or HTTP servers as needed.
You would use PySMI when you need to work with SNMP network management data in Python—typically to generate Python classes from vendor or standard MIBs so you can query network devices, or to convert MIB definitions into JSON for documentation or downstream processing. It depends on Jinja2 for templating, lark for parsing, and requests for fetching remote MIB files.
Use it for:
- Generate PySNMP classes from vendor MIBs to query network devices programmatically
- Convert SNMP MIB definitions to JSON for API documentation or configuration management
- Build a searchable index of MIB objects across multiple MIB modules for network inventory tools
- Automate MIB compilation in CI/CD pipelines when deploying network monitoring solutions
- Parse custom or proprietary SNMP MIBs to integrate legacy network equipment into modern Python applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PySMI parses SNMP MIB files in ASN.1 format and converts them to PySNMP classes or JSON documents, supporting SMIv1, SMIv2, and dialect variants.
Yes. PySMI is actively maintained, has no known vulnerabilities, installs with low friction, and carries a permissive license. It fills a specific and necessary role in SNMP tooling—there is no standard library alternative for MIB parsing. Install it if you need to work with SNMP MIBs in Python.
Install
pysmi on PyPI
pip
pip install pysmiuv
uv add pysmipoetry
poetry add pysmiInstalling pysmi
Before you install
Low friction installation with three lightweight runtime dependencies (Jinja2, lark, requests). Actively maintained with a recent release 110 days ago and ongoing repository activity.
License in practice
BSD-2-Clause permissive license allows commercial and private use with minimal restrictions; you must retain copyright notices and license text.
Quickstart
pip install pysmi
from pysmi.parser import Parser
from pysmi.codegen import PySnmpWriter
parser = Parser()
writer = PySnmpWriter()
# Parse a MIB file and generate PySNMP module
Requires Python 3.10 or later; MIB source files must be accessible locally, in ZIP archives, or via HTTP.
Verify before relying
- Whether the package handles all real-world MIB dialects beyond the documented SMIv1, SMIv2, and de-facto variants
- Performance characteristics when processing large MIB hierarchies or many interdependent modules
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Jinja2, lark, requests |
| Maintenance | actively maintained — 110 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,972,727/month — #3,394 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pysmi-2.0.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pysmi-lextudioParses ASN.1 SNMP MIB files and converts them…
permissive · top 15,000 on PyPI
pysnmp-mibsProvides pre-compiled IETF and IANA MIBs as…
permissive · top 15,000 on PyPI
pysnmp-lextudioProvides SNMP protocol implementation for…
permissive · top 15,000 on PyPI
snmpsimSNMP Simulator creates a pure-Python SNMP agent…
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
pysnmpcryptoProvides stronger cryptographic algorithms for…
permissive · top 15,000 on PyPI
asn1Encodes and decodes ASN.1 data structures using…
permissive · top 5,000 on PyPI
asn1toolsParses, encodes, and decodes ASN.1 messages…
permissive · top 15,000 on PyPI