Controlling Speedify with Python scripts
This article explains how to use the Speedify Python library (speedify-py) to control Speedify programmatically from your own Python scripts. If you want to automate Speedify settings, run tests, or build custom tools on top of Speedify, this library is the place to start.
What You'll Need
- Speedify installed and running on your device (Linux, Windows, or macOS)
- Python installed on your system
- Access to the speedify-py GitHub repository
Let's Get Started
Step 1
Get the speedify-py library from GitHub. The speedify-py library is open source and available at:
https://github.com/speedify/speedify-py
The library acts as a wrapper around the Speedify command-line interface (CLI). It parses the CLI's JSON output into Python dictionaries and raises errors as Python exceptions, so you can work with Speedify data naturally inside your Python code.
It has been tested and confirmed to work on Linux, Windows, and macOS.
Step 2
Once you have the library, explore the sample programs included in the repository. These are located in the /sample folder and are a practical way to understand what speedify-py can do:
https://github.com/speedify/speedify-py/tree/master/sample
Here's what each sample does:
- measure_speeds.py - Iterates through many combinations of Speedify settings, runs a speed test for each one, logs the results, and outputs which set of settings produced the best performance.
- speedify_import.py - Takes a JSON file of settings and applies them to Speedify.
- speedify_export.py - Reads all of your current Speedify settings and outputs them to a JSON file. The output is compatible with
speedify_import.py, so you can save and restore configurations easily. - speedify_default.py - Resets all of your Speedify settings back to the defaults that Speedify installs with.
- speedify_login.py - Demonstrates common usage of the library's API (application programming interface). It logs in a user, applies some settings, connects, and then lists the network adapters on the system.
- stat_callbacks_sample.py Demonstrates a long-running program that watches for changes in state (connect, disconnect, and so on) and changes in Wi-Fi networks. This can serve as the foundation for programs that log statistics, send notifications about events, or adjust settings automatically on certain networks.
These samples are meant to give you a starting point and spark ideas for what you can build with Speedify and your own Python programs.
Did you know - the Speedify CLI supports a full set of commands for managing your connections, adjusting settings, and more? See the Speedify CLI Command Reference for a complete list of available commands.