Skip to main content

netsnmp-cffi

This is a CFFI-based Python interface for the Net-SNMP C library, enabling efficient parallel SNMP communication with large amounts of devices from Python. It provides both asynchronous (asyncio) and synchronous interfaces.

This module is still a work in progress, and has been mainly developed to replace PySNMP as the default SNMP library in Zino 2 - the first releases of this library will focus mainly on functionality used by Zino (which for the most part means that SNMPv3 is not implemented yet).

Compatibility

The library is intended to be compatible with Net-SNMP versions from 5.9 and newer, and with Python 3.9 and newer.

Usage examples

For a simple (asyncio) usage example, see asnmpget.py.

Developing netsnmp-cffi

Running tests

tox and pytest are used to run the test suite. To run the test suite on all supported versions of Python, run:

tox

Code style

netsnmp-cffi code should follow the PEP-8 and PEP-257 guidelines. Ruff is used for automatic code formatting. The pre-commit tool is used to enforce code styles at commit-time.

Before you start hacking, enable pre-commit hooks in your cloned repository, like so:

pre-commit install

Using towncrier to automatically produce the changelog

Before merging a pull request

To be able to automatically produce the changelog for a release one file for each pull request (also called news fragment) needs to be added to the folder changelog.d/.

The name of the file consists of three parts separated by a period:

  1. The identifier: the issue number or the pull request number. If we don't want to add a link to the resulting changelog entry then a + followed by a unique short description.
  2. The type of the change: we use security, removed, deprecated, added, changed and fixed.
  3. The file suffix, e.g. .md, towncrier does not care which suffix a fragment has.

So an example for a file name related to an issue/pull request would be 214.added.md or for a file without corresponding issue +fixed-pagination-bug.fixed.md.

This file can either be created manually with a file name as specified above and the changelog text as content or one can use towncrier to create such a file as following:

$ towncrier create -c "Changelog content" 214.added.md

When opening a pull request there will be a check to make sure that a news fragment is added and it will fail if it is missing.

Before a release

To add all content from the changelog.d/ folder to the changelog file simply run

$ towncrier build --version {version}

This will also delete all files in changelog.d/.

To preview what the addition to the changelog file would look like add the flag --draft. This will not delete any files or change CHANGELOG.md. It will only output the preview in the terminal.

A few other helpful flags:

  • date DATE - set the date of the release, default is today
  • keep - do not delete the files in changelog.d/

More information about towncrier.

Building binary wheels

This package utilizes the API mode of CFFI, which means that it builds a small C shim to interface between the Net-SNMP library and Python. This means that a small platform-dependent binary will be part of the wheels built from this package.

In order to build wheels that should be compatible with at least several Linux distros and Python version combinations, and that are also uploadable to PyPI when making release, we utilize the manylinux tool suite.

Building the binary wheels should more or less be automated by a make command (see the Makefile itself for details):

make

Metadata

Release files for netsnmp-cffi 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for netsnmp-cffi 0.2.1
File
netsnmp_cffi-0.2.1-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
netsnmp_cffi-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
netsnmp_cffi-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
netsnmp_cffi-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
netsnmp_cffi-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
netsnmp_cffi-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details

Total release size: 13.0 MB

Release files / netsnmp_cffi-0.2.1-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp314-cp314-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f461d12a52e7432892db8058f3c7e75f89040a78e5d0ce14beab250060a195ae
BLAKE2b-256 checksum
How to use checksums
c7cd3d8411a184ddd7452dc6bd0ae57d414083d62e3719d314f7fb7f4a077237
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netsnmp_cffi-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ef91c20b1cb98b9cb1bc94ce3fc97e54d2e30273618411e30c4b17b98fec07fe
BLAKE2b-256 checksum
How to use checksums
92a4a4cd6665fdd2725c163de6f75784a256812e24596818dce1403f8c223e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netsnmp_cffi-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ca19984b79963999f7a9353e3baf47a68afc80e535b48e7ffa32a397f316ea2c
BLAKE2b-256 checksum
How to use checksums
a4af3cfe3c754effc3442a41e7df6b99a66dab353ba0d45ae03cc65e6ea6ebec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netsnmp_cffi-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2094cf645979fa5004248ca1288dab00a9f57f405ee290a307c2f2a1d306a230
BLAKE2b-256 checksum
How to use checksums
284983316d7e8fdbc39c42ecbe52f55a0e2f2d8e47462430f99b56696046df22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netsnmp_cffi-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ee9a1102c66934e88348758ecde6a884f1ce0b1a58ff2fa152a818ac80d7b307
BLAKE2b-256 checksum
How to use checksums
c75c7b3d3c4a8c5f25c3de29cf24280fd7aa56282ebdb081e9640b1dd2fa296c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / netsnmp_cffi-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL netsnmp_cffi-0.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
48a3875a3de1b62717e8c5bce9fa679d810f1e157a536b24cd850f4024823bdc
BLAKE2b-256 checksum
How to use checksums
42f565eaacb4069f70878a9c127e75fb221777bd4568411e96d96a7d045caa90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.1 This release

6 release files

0.2.0

4 release files

0.1.5

4 release files

0.1.4

4 release files

0.1.3

4 release files

0.1.2

4 release files

0.1.1

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page