https://github.com/py-paulo/aiotestspeed
Asynchronous python library to test connection speed, based on the speedtest project.
https://github.com/py-paulo/aiotestspeed
asynchronously python speedtest
Last synced: 5 months ago
JSON representation
Asynchronous python library to test connection speed, based on the speedtest project.
- Host: GitHub
- URL: https://github.com/py-paulo/aiotestspeed
- Owner: py-paulo
- License: apache-2.0
- Created: 2020-11-06T21:19:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T18:08:33.000Z (over 5 years ago)
- Last Synced: 2025-12-22T01:44:10.501Z (6 months ago)
- Topics: asynchronously, python, speedtest
- Language: Python
- Homepage: https://pypi.org/project/aiotestspeed/
- Size: 47.9 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
AIO Speedtest is a library written in Python to perform speed tests asynchronously and programmatically.
---
This project was made based on the existing [Speedtest](https://github.com/sivel/speedtest-cli) from which we shared several code snippets, what I did were few modifications to work asynchronously.
#### Basic Usage
```
import asyncio
from aiotestspeed.aio import Speedtest
units = ('bit', 1)
async def main():
s: Speedtest = await Speedtest()
await s.get_best_server()
await s.download()
await s.upload()
print('Ping: %s ms\nDownload: %0.2f M%s/s\nUpload: %0.2f M%s/s' %
(s.results.ping,
(s.results.download / 1000.0 / 1000.0) / units[1],
units[0],
(s.results.upload / 1000.0 / 1000.0) / units[1],
units[0]))
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
```
