Giter VIP home page Giter VIP logo

iperf3-python's Introduction

iperf3-python: Python wrapper around iperf3

PyPi Status Build Status Coverage Status Documentation Status

Detailed documentation at iperf3-python.readthedocs.org

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

Installation

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)
wget http://downloads.es.net/pub/iperf/iperf-3-current.tar.gz
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 https://github.com/thiezn/iperf3-python.git
cd iperf3-python
python3 setup.py install

Quickstart

For detailed examples check out the examples page or the detailed documentation at iperf3-python.readthedocs.org

Server

>>> import iperf3

>>> server = iperf3.Server()
>>> result = server.run()
>>> result.remote_host
"10.10.10.10"

Client

>>> import iperf3

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

External Dependencies

  • iperf3
  • libiperf.so.0 (Comes with iperf3 >= 3.0.6)

Testing

  • Tested against the following iperf3 versions on Linux:
    • 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
    • 3.4
    • 3.5
    • 3.6
  • Test coverage reporting through coveralls.io
  • Tested against the following Python versions:
    • 2.7
    • 3.6

iperf3-python's People

Contributors

thiezn avatar m-mortimer avatar austinpayne avatar bpilosov avatar christofkaufmann avatar gleichda avatar rustyhowell avatar p0intr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.