skillfed

pysmi

A pure-Python implementation of SNMP/SMI MIB parsing and conversion library.

pysmi v2.0.0 2.0M downloads/30d#3,394 on PyPI10
Permissive license BSD-2-Clause Active released

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 pysmi

uv

uv add pysmi

poetry

poetry add pysmi

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsIntended Audience :: Telecommunications IndustryNatural Language :: EnglishOperating System :: OS IndependentTopic :: CommunicationsTopic :: Software Development :: Libraries :: Python Modules

Tags

SNMP MIB parserASN.1 MIB compilerMIB to JSON conversionSNMP management information baseMIB to PySNMP classesnetwork management MIB parsingSNMP SMI compiler
snmpnetwork-managementasn1-parsing

More Python Modules packages