Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python wrapper around iperf3

Project Description

Detailed documentation at

iperf3 for python provides a wrapper around the excellent iperf3 utility. iperf3 is a complete rewrite of the original iperf implementation. more information on the official iperf3 site

iperf3 introduced an API called libiperf that allows you to easily interact with iperf3 from other languages. This library provides a python wrapper around libiperf for easy integration into your own python scripts in a pythonic way


First you have to make sure the iperf3 utility is present on your system as the python module wraps around the libiperf API provided by it.

The common linux distributions offer installations from their own repositories. These might be out of date so installation from the official iperf3 website is preferred.

note The libiperf API was only introduced in 3.0.6 so make sure you have an updated version of iperf3 installation.

note The libiperf API added a feature to programmatically retrieve the json output from the library. This enables us to retrieve the results without having to scrape the output from stdout. Effectively this means that if you want to redirect your script’s stdout/stderr to something else you need at least iperf3 version 3.1

  • Install from source (preferred)
tar xvf iperf-3-current.tar.gz
cd iperf-3.3/                # Or whatever the latest version is
./configure && make && sudo make install
  • Ubuntu:
sudo apt-get install iperf3
  • CenOS/RedHat
sudo yum install iperf3

Once the iperf3 utility is installed the simplest way to install the python wrapper is through PyPi

pip install iperf3

You can also install directly from the github repository:

git clone
cd iperf3-python
python3 install


For detailed examples check out the examples page or the detailed documentation at


>>> import iperf3

>>> server = iperf3.Server()
>>> result =
>>> result.remote_host


>>> import iperf3

>>> client = iperf3.Client()
>>> client.duration = 1
>>> client.server_hostname = ''
>>> client.port = 5201
>>> result =
>>> result.sent_Mbps

External Dependencies

  • iperf3
  • (Comes with iperf3 >= 3.0.6)


  • Tested against the following iperf3 versions on Unix (ubuntu Trusty):
    • 3.0.6
    • 3.0.7
    • 3.0.8
    • 3.0.9
    • 3.0.10
    • 3.0.11
    • 3.0.12
    • 3.1
    • 3.1.1
    • 3.1.2
    • 3.1.3
    • 3.1.4
    • 3.1.5
    • 3.1.6
    • 3.1.7
    • 3.2
    • 3.3
  • Test coverage reporting through
  • Tested against the following Python versions:
    • 2.7
    • 3.6

Release History

0.1.9 (2018-02-22)

  • Use find_library to load libiperf (Thanks to @Austinpayne). This should allow iperf3 lib to run on Mac OS X.

0.1.8 (2018-01-24)

  • Fixed segmentation fault on several Linux distro’s (Thanks to @illu89)
  • Added Travis testing against latest iperf3 releases (3.3)
  • Renamed bulksize argument to blksize to keep naming in line with iperf3 C library. bulksize argument still available for backwards compatibility

0.1.7 (2017-08-02)

  • Fixed Mbps vs MB_s calculations (Thanks to @rustyhowell)

0.1.6 (2017-06-11)

  • iperf3.__del__ now properly closing FD and pipes (Thanks to @p0intR)

0.1.5 (2017-05-22)

  • iperf3.Client() now allows redirection of stdout (iperf3 version => 3.1 required)

0.1.4 (2017-05-15)

  • Fixed server json_output=False feature

0.1.3 (2017-05-15)

  • Added UDP support (thanks to @fciaccia)
  • Added bandwidth parameter
  • json_output = False will now print testresults to screen

0.1.2 (2016-09-22)

  • Improved zerocopy setter validation
  • Fix for incorrect return of reverse flag (thanks to @fciaccia)

0.1.1 (2016-09-12)

  • Added reverse test parameter (thanks to @cvicente)
  • Updated travis build to test against iperf3 versions 3.0.6 through 3.1.3

0.1.0 (2016-08-18)

main functionality available

  • introduced TestResult class providing easy access into test results
  • updated client and server examples
  • minor documentation tweaks

0.0.1 (2016-08-18)

Initial Release

  • Client and Server classes around iperf3’s API
  • Documentation on readthedocs
  • py.tests
  • blood
  • sweat
  • a lot of tears

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(13.9 kB) Copy SHA256 Hash SHA256
Source None Feb 22, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers