Skip to main content

CFFI interface to Net-SNMP

Project description

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).

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netsnmp_cffi-0.1.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

netsnmp_cffi-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

netsnmp_cffi-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

netsnmp_cffi-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

netsnmp_cffi-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

Details for the file netsnmp_cffi-0.1.0.tar.gz.

File metadata

  • Download URL: netsnmp_cffi-0.1.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for netsnmp_cffi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f2e04eb69c255902dcf2aed7cd2821d8465d6f815fb65bed63babf5a29b0df3a
MD5 d782122ec09c776fc3d962ae1ebb6541
BLAKE2b-256 b5c05f895a2a7acbc9522e2e77f250847508f4e2f82af5653bec65745a0052bb

See more details on using hashes here.

File details

Details for the file netsnmp_cffi-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for netsnmp_cffi-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0f294a788de87ae6e0b2996a7b1f378a276584c7a4a0bf50d7721ebd3f0d260
MD5 12e1440d82cd65fc947cb841189c1dd4
BLAKE2b-256 ac3dbd05e091b18597f1975714026f5f7d6e9c4300bccf119103cc4be597f80d

See more details on using hashes here.

File details

Details for the file netsnmp_cffi-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for netsnmp_cffi-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c1f1daeb42b66aeebf9ed07e7d2f0fa4fca8f2f2ba2e5b7a38eda9251804df5
MD5 f3bd13a3ad749eb3bc24bd9704ba28cb
BLAKE2b-256 7e4d8a2b77e8b6deb34cfca3af64776e4361716443dadbab67aee6744e85e834

See more details on using hashes here.

File details

Details for the file netsnmp_cffi-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for netsnmp_cffi-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 40473d04ac02f7dc96d0260edfe08c182890cdf23b857519aedff40b44405482
MD5 8d5aae751c40bfc2e8af6f2866fb09e9
BLAKE2b-256 a203731e0e5d010ce1232b2a25cb1473b0b1790fe29465d5fbcec9b28914a11f

See more details on using hashes here.

File details

Details for the file netsnmp_cffi-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for netsnmp_cffi-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d44416338014ccbc4729b570693a173aaafcb81dbcc48c6a0e6154770fa55c68
MD5 11673f3ccd336fec16c4aadb9b940fba
BLAKE2b-256 4e47609cc8c930deb5a8d164e31624841d875ac12d9466144d51282eb94264c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page