snappi
The Snappi Open Traffic Generator Python Package
What it is and what it does
Snappi is a Python SDK auto-generated from the Open Traffic Generator API specification, designed to let you programmatically control any traffic generator that implements that standard. You use it to create traffic configurations (defining ports, flows, packet headers, and transmission parameters), push those configurations to a running OTG server, start and stop traffic, and retrieve flow metrics. The package wraps gRPC and HTTP communication with the OTG API, handling protocol buffers and YAML serialization internally.
The typical workflow is to instantiate an API client pointing to your traffic generator, build a configuration object by adding ports and flows with protocol headers and transmission rules, serialize and push that config to the server, control transmission state, and poll metrics until your test completes. It's designed for network testing automation—validating traffic behavior, measuring throughput and packet loss, or simulating complex traffic patterns in a reproducible, scriptable way.
Use it for:
- Automate network traffic testing by scripting traffic generation, transmission, and metric collection against Ixia-c or other OTG-compliant generators.
- Build CI/CD pipelines that validate network device behavior under controlled, repeatable traffic patterns.
- Configure multi-flow traffic scenarios with varying packet sizes, protocols, and port patterns for network simulation testing.
- Poll and assert on flow metrics (transmit/receive counts, stopped state) to validate traffic generator behavior in test frameworks like pytest.
- Generate custom packet payloads and protocol header combinations to test edge cases in network processing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Snappi is an auto-generated Python SDK for controlling traffic generators that conform to the Open Traffic Generator API, allowing you to write test scripts that configure, transmit, and measure network traffic.
Yes. Snappi is actively maintained, has no known vulnerabilities, supports current Python versions (3.9–3.13), and carries a permissive MIT license. Install friction is low. If you need to automate traffic generation against an OTG-compliant server (especially Ixia-c), this is the standard SDK for that task. The only prerequisite is having a running OTG API server to connect to.
Install
snappi on PyPI
pip
pip install snappiuv
uv add snappipoetry
poetry add snappiInstalling snappi
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release (2 days old) and has been in active development since 2020. Seven runtime dependencies are all standard, widely-used libraries (grpcio, protobuf, PyYAML, requests, urllib3, semantic_version).
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute snappi freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install snappi
import snappi
api = snappi.api(location="https://localhost:8443")
config = api.config()
ptx = config.ports.add(name="ptx", location="veth-a")
flow = config.flows.add(name="flow")
flow.tx_rx.port.tx_name = ptx.name
api.set_config(config)
Requires a running Open Traffic Generator (OTG) API server at the specified location (e.g., Ixia-c instance) to connect to and control.
Verify before relying
- Whether the package works with traffic generators other than Ixia-c that claim OTG API conformance.
- Performance characteristics when handling large-scale traffic configurations or high-frequency metric polling.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — grpcio, grpcio-tools, protobuf, PyYAML, requests, urllib3, semantic_version |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 154,957/month — #10,836 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: snappi-1.61.0-py3-none-any.whl
Keywords: snappi, testing, open traffic generator, automation
Tags
More Traffic Generation packages
Locust is a Python-based load testing framework…
permissive · top 5,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
seleniumbaseSeleniumBase is a browser automation framework…
permissive · top 5,000 on PyPI
locust-pluginsExtends Locust with plugins for load testing…
permissive · top 5,000 on PyPI
bztTaurus is a command-line wrapper that…
permissive · top 5,000 on PyPI
sbvirtualdisplayProvides a virtual display wrapper for running…
permissive · top 15,000 on PyPI
snappi-ixnetworkExecutes traffic generation test scripts…
permissive · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
ixnetwork-restpyA Python client library for automating…
permissive · top 15,000 on PyPI
scapyScapy is a Python library for forging,…
copyleft · top 5,000 on PyPI
genie.trafficgenProvides connection implementations to traffic…
permissive · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI
datadogProvides a Python client library to send…
permissive · top 1,000 on PyPI
pypcapPython wrapper around libpcap that lets you…
unclear · top 15,000 on PyPI
Pinterest-Generated-ClientProvides auto-generated Python bindings for…
permissive · top 15,000 on PyPI
PySocksPySocks provides a SOCKS and HTTP proxy client…
permissive · top 1,000 on PyPI