--- id: snappi version: "1.61.0" license: MIT license_treatment: permissive maintenance: active --- # snappi — The Snappi Open Traffic Generator Python Package License: permissive · Maintenance: active · Downloads: 155.0K/mo ## 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 above — 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 pip install snappi uv add snappi poetry add snappi ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 155.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags traffic generator python sdk, open traffic generator api client, network traffic testing automation, otg api python, packet generation testing, flow configuration and metrics, network simulation testing, traffic-generation, network-testing, otg-api [View on SkillFed](https://skillfed.io/packages/snappi) · [View on PyPI](https://pypi.org/project/snappi/)