speedtest_reader
Library to read, buffer and time-slice output generated by speedtest-cli
Versions
speedtest_reader works with Python 3
Recent changes
Complete API redesign (see Python API below)
Installation
pip / easy_install
pip install speedtest_reader
or
easy_install speedtest_reader
Github
pip install git+https://github.com/shuntingyard/speedtest_reader.git
or
git clone https://github.com/shuntingyard/speedtest_reader.git cd speedtest_reader python setup.py install
Python API
from speedtest_reader import format_timestamps, Reader, util
sensor1 = Reader("~/speedtest.csv")
@util.to_Mbit
def slice_s1(**kwargs):
start, end = format_timestamps(**kwargs)
return sensor1.copy_df(start, end)
# Test API setup
print(slice_s1(start="2019-06-01"))
print(slice_s1(start="July 1", end="July 3"))
print(slice_s1(start="yesterday"))
Example section
plotly
import plotly
import plotly.graph_objs as go
from speedtest_reader import format_timestamps, Reader, util
sensor1 = Reader("~/speedtest.csv")
@util.append_tslocal()
def slice_s1(**kwargs):
start, end = format_timestamps(**kwargs)
return sensor1.copy_df(start, end)
# minimal line- and scatterplot example
df = slice_s1()
graph = dict(
data=[
go.Scatter(
x=df["tslocal"], y=df["Download"], mode="lines", connectgaps=False
),
go.Scatter(x=df["tslocal"], y=df["Upload"], mode="markers"),
]
)
plotly.offline.plot(graph)
seaborn
import matplotlib.pyplot as plt
import seaborn as sns
from speedtest_reader import format_timestamps, Reader, util
sensor1 = Reader("~/speedtest.csv")
@util.to_Mbit
@util.append_mpldate(colname="date2num")
def slice_s1(**kwargs):
start, end = format_timestamps(**kwargs)
return sensor1.copy_df(start, end)
# minimal scatterplot example
ts = slice_s1()["date2num"]
dl = slice_s1()["Download"]
_, ax = plt.subplots()
sns.scatterplot(ts, dl)
ax.xaxis_date()
plt.show()
timezone config
from speedtest_reader import format_timestamps, Reader, util
sensor1 = Reader("~/speedtest.csv")
@util.append_tslocal(tz="EST") # zone for local timestamp to append
def slice_EST(**kwargs):
kwargs["tz"] = "EST" # zone to use for slicing
start, end = format_timestamps(**kwargs)
return sensor1.copy_df(start, end)
# use local timezone (selected by module 'tzlocal')
@util.append_tslocal()
def slice_local(**kwargs):
start, end = format_timestamps(**kwargs)
return sensor1.copy_df(start, end)
# test configured- and local timezone setup
print(slice_EST(start="yesterday"))
print(slice_local(start="yesterday"))
Changelog
Version 0.0.4
Complete API redesign
Metadata
Release files for speedtest-reader 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| speedtest_reader-0.0.4.tar.gz | 37.6 kB | Without provenance | Details for speedtest_reader-0.0.4.tar.gz |
Release files / speedtest_reader-0.0.4.tar.gz
| Download URL | speedtest_reader-0.0.4.tar.gz |
|---|---|
| Size | 37.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7aa7da742d24ef5daa400f5ce68addcdd148b6fdf40127aac5002ee12fd226c5
|
|
BLAKE2b-256 checksum How to use checksums |
7f788b8f1928c92f8f00c1649b4427eb9b2f4f3a858049943eaa797503eaec28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for speedtest-reader 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.