Registry / http-networking / snappi

snappi

JSON →
library1.57.0pypypi✓ verified 85d ago

Snappi is an open-source Python library for generating and testing network traffic. The current version is 1.53.0, with regular releases approximately every 2-3 weeks. It supports Python >=3.8,<4 and integrates with various traffic generator backends (e.g., IxNetwork, Traffic Server). Snappi provides a unified API to configure traffic flows, endpoints, and capture settings.

pip install snappi
INSTALL
IMPORT
SIG · SNAPPI
S
snappi
http-networkingpythonv1.57.0
Install
6.1s avg
Import
4945ms
Disk
69MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.57.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 7.340s · 67.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.1s · import 2.550s · 63MB
69MB installed
● package 69MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Api
import snappi
from snappi import snappi
The library is a package; the main API class is accessed via snappi.Api(), not a submodule.

Instantiate the API, create a config, and add a simple IPv4 flow.

import snappi api = snappi.Api(address='https://localhost:11009') config = api.config() config.flows.flow(name='test_flow').packet().ethernet().eth_ipv4().v4().src.value = '10.0.0.1' # No auth needed for local; for remote, set via os.environ.get('SNAPPI_AUTH_TOKEN', '')
snappi --version
Debug
Known issues
gotchaThe API address must include the protocol (http/https) and port. Local default is https://localhost:11009.
fix
Always specify full URL: api = snappi.Api(address='https://10.10.10.10:8443')
affects: all
deprecatedMethod set_config() and resulting 'elapsed_time' attribute are deprecated in v1.50+. Use set_config() -> config object directly.
fix
Use config = api.config() then api.set_config(config)
affects: >=1.50.0
breakingIn v1.40.0, the default protocol changed from HTTP to HTTPS. Older code using http:// may fail.
fix
Update API address to https:// or set ssl=False explicitly.
affects: >=1.40.0
gotchaFlow packet layers are built using chained methods (e.g., .packet().ethernet().eth_ipv4()). Order matters; .eth_ipv4() is a shorthand for stacking ethernet and IPv4.
fix
Use .packet().ethernet().ipv4() for separate layers or .eth_ipv4() for convenience.
affects: all
breakingThe 'config.ports' property was renamed to 'config.port' in v1.20.0.
fix
Use config.port instead of config.ports.
affects: >=1.20.0
gotchaWhen setting packet headers, some fields require .value assignment, others use .increment or .decrement. Not all fields support all modes.
fix
Check docstring: e.g., ipv4.src.increment.start = '10.0.0.1'; ipv4.src.value = '10.0.0.1'
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'snappi'
snappi not installed or running in a different Python environment.
fix
Run 'pip install snappi' in the correct environment.
AttributeError: module 'snappi' has no attribute 'Api'
Import was not done correctly (e.g., from snappi import snappi).
fix
Use 'import snappi' then 'snappi.Api(...)'.
ConnectionError: HTTPConnectionPool ... Max retries exceeded
The controller address is incorrect or the server is not running.
fix
Verify the API address (e.g., 'https://localhost:11009') and ensure the snappi server is running.
ValueError: Unsupported protocol version
Client version incompatible with server version (server may be older).
fix
Upgrade both client and server to the latest version, or pin to compatible versions.
TypeError: 'NoneType' object is not iterable
Attempting to iterate over a flow before it is properly configured or added.
fix
Ensure you have added flows to config, e.g., config.flows.flow(name='test')...
Upgrade
Version history
1.57.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources