Skip to main content

pysnmp-sync-adapter

PyPI PyPI download month

Lightweight Synchronous Adapter for PySNMP AsyncIO HLAPI


This package provides lightweight, blocking wrappers around the pysnmp.hlapi.v1arch.asyncio and pysnmp.hlapi.v3arch.asyncio modules of PySNMP, enabling synchronous use of the SNMP high-level API in PySNMP v7+ without requiring direct asyncio management. It preserves the flexibility of PySNMP’s asyncio-based architecture and includes a compatibility layer for various legacy interfaces. The two additional functions parallel_get_sync and cluster_varbinds enable efficient, high-performance concurrent SNMP queries in a blocking context.

Features

  • Drop-in synchronous alternatives to PySNMP's async-HLAPI: get_cmd_sync, next_cmd_sync, set_cmd_sync, bulk_cmd_sync, walk_cmd_sync, bulk_walk_cmd_sync.
  • Supports both v1arch and v3arch PySNMP v7+ architectures, automatically selected or configurable via the PYSNMP_ARCH environment variable.
  • Supports both IPv4 and IPv6 transport targets via UdpTransportTarget and Udp6TransportTarget.
  • Reuses or creates the default shared event loop (asyncio.get_event_loop()), ensuring integration efficiency.
  • Sync wrappers accept an optional timeout parameter (in seconds) that limits the total execution time using asyncio.wait_for().
  • Minimizes connection overhead by reusing pre-created transport instances when calling create_transport().
  • The add-on parallel_get_sync function executes multiple SNMP GET requests concurrently in a blocking context. It is complemented by cluster_varbinds, an ancillary utility that normalizes and clusters OIDs into ordered chunks for efficient batching. Together, they enable high-throughput querying of large OID sets without requiring asyncio, reducing per-PDU overhead while preserving request order.
  • In addition, through the pysnmp_sync_adapter.legacy_wrappers compatibility layer, it supports:
  • Also, through the pysnmp_sync_adapter.cmdgen_wrappers compatibility layer, it runs code written against the cmdgen SNMP library appearing in pysnmp.entity.rfc3413.oneliner.

These adapters allow to call the familiar HLAPI functions in a purely synchronous style (e.g. in scripts, GUIs like Tkinter, or blocking contexts) without having to manage asyncio directly. This restores the synchronous experience familiar from earlier PySNMP versions. Native sync HLAPI wrappers were deprecated in recent releases in favor of asyncio.

Provided Methods

Synchronous Function AsyncIO Equivalent
get_cmd_sync get_cmd
next_cmd_sync next_cmd
set_cmd_sync set_cmd
bulk_cmd_sync bulk_cmd
walk_cmd_sync walk_cmd (async-gen)
bulk_walk_cmd_sync bulk_walk_cmd (async-gen)
create_transport Synchronously awaits the async create() factory on UdpTransportTarget and Udp6TransportTarget
Add-on Function Description
parallel_get_sync Parallel get_cmd
cluster_varbinds Normalize and cluster OID lists

Full information and usage details at the pysnmp-sync-adapter GitHub repository.

Metadata

Release files for pysnmp-sync-adapter 1.0.9

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

Source distribution (sdist)

Source distribution for pysnmp-sync-adapter 1.0.9
File Size Uploaded
pysnmp_sync_adapter-1.0.9.tar.gz 20.4 kB Details

Release files / pysnmp_sync_adapter-1.0.9.tar.gz

Download URL pysnmp_sync_adapter-1.0.9.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c574f72074f98013478d9d618db2b12e4ecd4fcb05bbbb0f59fe0b1bba8430f4
BLAKE2b-256 checksum
How to use checksums
33bc53eae5a656c4474dc6fcfdb1ed9e20c73b254c76aa9e0a77ba1da59f2f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

1.1.0

1 release file

This release

1.0.9 This release

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

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