Compare commits
186 Commits
modularize
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e715ef3008 | ||
|
|
9384255634 | ||
|
|
72ed585c6f | ||
|
|
41e599f9c3 | ||
|
|
c7530bb143 | ||
|
|
4ceae77401 | ||
|
|
9e185e8f88 | ||
|
|
9c2977acfc | ||
|
|
f8aa20ecdf | ||
|
|
8ff923b0fb | ||
|
|
35c3ee20ed | ||
|
|
0a7823db7a | ||
|
|
27a8301192 | ||
|
|
ee2e647b9b | ||
|
|
831c079113 | ||
|
|
4f4c1dd8d1 | ||
|
|
2c847a1849 | ||
|
|
e1bab1ab55 | ||
|
|
48a3d33ae4 | ||
|
|
c16ffd4ae7 | ||
|
|
9848481d06 | ||
|
|
4737a69f10 | ||
|
|
6381ba3742 | ||
|
|
fa2e15ee08 | ||
|
|
eab354603f | ||
|
|
e80ccc4647 | ||
|
|
5fbe593fc8 | ||
|
|
f70cc86222 | ||
|
|
5c061da8e0 | ||
|
|
4457fe9fb8 | ||
|
|
b27f69d1ad | ||
|
|
5a9f82a20a | ||
|
|
3cb44f5630 | ||
|
|
16054cc3bc | ||
|
|
d9642b2047 | ||
|
|
f3a607feb2 | ||
|
|
6bfa5922c3 | ||
|
|
ca72d40033 | ||
|
|
3ebb9734a2 | ||
|
|
8854d82049 | ||
|
|
f2a97baf1e | ||
|
|
6531677346 | ||
|
|
6556be190a | ||
|
|
2fe34ecf4e | ||
|
|
0e585cbf64 | ||
|
|
2fe369fdf8 | ||
|
|
b33c7533df | ||
|
|
fe864f6dce | ||
|
|
10b3b09f02 | ||
|
|
20e5d12a5c | ||
|
|
6603954e45 | ||
|
|
e982830350 | ||
|
|
2c89c53a79 | ||
|
|
401c469991 | ||
|
|
3c1c9d3179 | ||
|
|
e2f815618b | ||
|
|
955a756c96 | ||
|
|
ceef55488c | ||
|
|
20eeadcb0c | ||
|
|
4aebe01c3e | ||
|
|
1871b26b9a | ||
|
|
824c584658 | ||
|
|
9806e401e0 | ||
|
|
1642d0669f | ||
|
|
2e79fbf1dc | ||
|
|
f20e8808a8 | ||
|
|
3feb38d9d4 | ||
|
|
d712f947d9 | ||
|
|
55b3cf14a3 | ||
|
|
33e498beb3 | ||
|
|
068d71597b | ||
|
|
1863c35f6b | ||
|
|
823d7dc2b7 | ||
|
|
411f1609e8 | ||
|
|
7b38e264bc | ||
|
|
2acba6ecd7 | ||
|
|
53ef57bd5e | ||
|
|
c512684ffa | ||
|
|
6685d91729 | ||
|
|
91270dbc67 | ||
|
|
b75ecc291c | ||
|
|
1d6717e714 | ||
|
|
d41cfc0cb1 | ||
|
|
59880107a7 | ||
|
|
4280c448cf | ||
|
|
9f44a72fdb | ||
|
|
b075152e3e | ||
|
|
2be4d0a5e7 | ||
|
|
9299e0860c | ||
|
|
292e250990 | ||
|
|
fd8b8cfa92 | ||
|
|
9e3a5b3a59 | ||
|
|
53b760dfba | ||
|
|
d0c927e8ae | ||
|
|
6fffcd5b63 | ||
|
|
f88c41f97f | ||
|
|
64b03777da | ||
|
|
01abb3ae71 | ||
|
|
884c7fed87 | ||
|
|
38870b69ea | ||
|
|
4bd4b7dfec | ||
|
|
5e0bd05c81 | ||
|
|
b3f9a48cbb | ||
|
|
478f9affdd | ||
|
|
9ccce5d861 | ||
|
|
2a4990c96c | ||
|
|
07c38d7194 | ||
|
|
c5f75f783e | ||
|
|
050da542b3 | ||
|
|
e14f7ed108 | ||
|
|
a7e9bc695e | ||
|
|
77db2ea8f4 | ||
|
|
e4218c7612 | ||
|
|
69bae532c5 | ||
|
|
4f7f367391 | ||
|
|
08e87f4c54 | ||
|
|
aa52e550bf | ||
|
|
537c5aeda0 | ||
|
|
95fe038752 | ||
|
|
1c0a029ca6 | ||
|
|
9913b9915f | ||
|
|
a4cb217522 | ||
|
|
d09ec27cb2 | ||
|
|
446e6eb27e | ||
|
|
81182c1c94 | ||
|
|
51014d5a70 | ||
|
|
65145d9aae | ||
|
|
308c530f07 | ||
|
|
abe85d85ff | ||
|
|
d1b1185bfc | ||
|
|
713860a4b4 | ||
|
|
ff606d0ec1 | ||
|
|
3f22a9d815 | ||
|
|
cb6dee8a77 | ||
|
|
7b09d8759f | ||
|
|
25d845362c | ||
|
|
4b9662e0b3 | ||
|
|
93951f1154 | ||
|
|
0e6b85d4d5 | ||
|
|
6ab5f27300 | ||
|
|
2ee26bbf54 | ||
|
|
514b310484 | ||
|
|
918e70e66d | ||
|
|
bae642ccde | ||
|
|
1df3e76b19 | ||
|
|
1e44e9e2f1 | ||
|
|
51d0d88b96 | ||
|
|
47c17d4a49 | ||
|
|
d1be67be48 | ||
|
|
075cfda9cf | ||
|
|
3c04dfefd3 | ||
|
|
ffd2c7f963 | ||
|
|
aef4a78831 | ||
|
|
72da41e4fc | ||
|
|
cb77da3d37 | ||
|
|
790720b33a | ||
|
|
3a31df31c1 | ||
|
|
7383ad97af | ||
|
|
3cc06168f5 | ||
|
|
3ee45cace8 | ||
|
|
b0e1e58a0b | ||
|
|
60c3ec2a5e | ||
|
|
65c85a9b15 | ||
|
|
795bc51da4 | ||
|
|
6c8dd05872 | ||
|
|
759ef15636 | ||
|
|
f907418e6e | ||
|
|
fe93e9ed75 | ||
|
|
cea45762ca | ||
|
|
328b851a07 | ||
|
|
ec21971a10 | ||
|
|
3558b22de1 | ||
|
|
c0cd0d1666 | ||
|
|
3655a31ac1 | ||
|
|
c1b9a0db0a | ||
|
|
b14e104ad1 | ||
|
|
f1647f2c9e | ||
|
|
5bbc3e8bb0 | ||
|
|
807df51c83 | ||
|
|
8e0d5eaec8 | ||
|
|
966fd2c86d | ||
|
|
8d1cf7ac1e | ||
|
|
20c9882b09 | ||
|
|
23fba2520a | ||
|
|
3e9c6e3532 | ||
|
|
8a308040a9 |
63
.travis.yml
63
.travis.yml
@ -1,32 +1,51 @@
|
|||||||
language: python
|
language: python
|
||||||
|
|
||||||
python:
|
addons:
|
||||||
- 2.7
|
apt:
|
||||||
|
sources:
|
||||||
|
- deadsnakes
|
||||||
|
packages:
|
||||||
|
- python2.4
|
||||||
|
- python2.5
|
||||||
|
- python2.6
|
||||||
|
- python3.2
|
||||||
|
- python3.3
|
||||||
|
|
||||||
env:
|
matrix:
|
||||||
- TOXENV=py24
|
include:
|
||||||
- TOXENV=py25
|
- python: 2.7
|
||||||
- TOXENV=py26
|
env: TOXENV=flake8
|
||||||
- TOXENV=py27
|
- python: 2.7
|
||||||
- TOXENV=py31
|
env: TOXENV=py24
|
||||||
- TOXENV=py32
|
- python: 2.7
|
||||||
- TOXENV=py33
|
env: TOXENV=py25
|
||||||
- TOXENV=py34
|
- python: 2.7
|
||||||
- TOXENV=pypy
|
env: TOXENV=py26
|
||||||
- TOXENV=flake8
|
- python: 2.7
|
||||||
|
env: TOXENV=py27
|
||||||
|
- python: 2.7
|
||||||
|
env: TOXENV=py32
|
||||||
|
- python: 2.7
|
||||||
|
env: TOXENV=py33
|
||||||
|
- python: 3.4
|
||||||
|
env: TOXENV=py34
|
||||||
|
- python: 3.5
|
||||||
|
env: TOXENV=py35
|
||||||
|
- python: 3.6
|
||||||
|
env: TOXENV=py36
|
||||||
|
- python: pypy
|
||||||
|
env: TOXENV=pypy
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[14])") != 0 ]]; then sudo add-apt-repository -y ppa:fkrull/deadsnakes; fi;
|
- if [[ $(echo "$TOXENV" | egrep -c "py35") != 0 ]]; then pyenv global system 3.5; fi;
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[14])") != 0 ]]; then sudo apt-get update -qq; fi;
|
|
||||||
- if [[ "$TOXENV" == "py24" ]]; then sudo apt-get install -y python2.4; fi;
|
|
||||||
- if [[ "$TOXENV" == "py25" ]]; then sudo apt-get install -y python2.5; fi;
|
|
||||||
- if [[ "$TOXENV" == "py31" ]]; then sudo apt-get install -y python3.1; fi;
|
|
||||||
- if [[ "$TOXENV" == "py34" ]]; then sudo apt-get install -y python3.4; fi;
|
|
||||||
- if [[ "$TOXENV" == "pypy" ]]; then sudo apt-get install -y pypy; fi;
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py31)") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
|
- if [[ $(echo "$TOXENV" | egrep -c "py32") != 0 ]]; then pip install setuptools==17.1.1; fi;
|
||||||
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py31)") == 0 ]]; then pip install tox; fi;
|
- if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
|
||||||
|
- if [[ $(echo "$TOXENV" | egrep -c "(py26|py33)") != 0 ]]; then pip install virtualenv==15.2.0 tox==2.9.1; fi;
|
||||||
|
- if [[ $(echo "$TOXENV" | egrep -c "(py2[456]|py3[123])") == 0 ]]; then pip install tox; fi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox
|
||||||
|
|||||||
@ -1,14 +1,34 @@
|
|||||||
# Pull Requests
|
# Pull Requests
|
||||||
|
|
||||||
Pull requests should be made against the `working` branch.
|
## Pull requests should be
|
||||||
|
|
||||||
|
1. Made against the `devel` branch.
|
||||||
|
1. Made from a git feature branch.
|
||||||
|
|
||||||
|
## Pull requests will not be accepted that
|
||||||
|
|
||||||
|
1. Are not made against the `devel` branch
|
||||||
|
1. Are submitted from a branch named `devel`
|
||||||
|
1. Do not pass pep8/pyflakes/flake8
|
||||||
|
1. Do not work with Python 2.4-3.4 or pypy
|
||||||
|
1. Add python modules not included with the Python standard library
|
||||||
|
1. Are made by editing files via the GitHub website
|
||||||
|
|
||||||
# Coding Guidelines
|
# Coding Guidelines
|
||||||
|
|
||||||
In general, I follow strict pep8 and pyflakes. All code must pass these tests. Since we support python 2.4-3.4, pyflakes reports unknown names in python 3. pyflakes is run in python 2.7 only in my tests.
|
In general, I follow strict pep8 and pyflakes. All code must pass these tests. Since we support python 2.4-3.4 and pypy, pyflakes reports unknown names in python 3. pyflakes is run in python 2.7 only in my tests.
|
||||||
|
|
||||||
|
## Some other points
|
||||||
|
|
||||||
|
1. Do not use `\` for line continuations, long strings should be wrapped in `()`. Imports should start a brand new line in the form of `from foo import...`
|
||||||
|
1. String quoting should be done with single quotes `'`, except for situations where you would otherwise have to escape an internal single quote
|
||||||
|
1. Docstrings should use three double quotes `"""`
|
||||||
|
1. All functions, classes and modules should have docstrings following both the PEP257 and PEP8 standards
|
||||||
|
1. Inline comments should only be used on code where it is not immediately obvious what the code achieves
|
||||||
|
|
||||||
# Supported Python Versions
|
# Supported Python Versions
|
||||||
|
|
||||||
All code needs to support Python 2.4-3.4.
|
All code needs to support Python 2.4-3.4 and pypy.
|
||||||
|
|
||||||
# Permitted Python Modules
|
# Permitted Python Modules
|
||||||
|
|
||||||
|
|||||||
89
README.rst
89
README.rst
@ -1,23 +1,31 @@
|
|||||||
|
#Usage
|
||||||
|
|
||||||
|
$ curl -s https://git.spectre5.com/adamcruz/speedtest-cli-pub/raw/branch/master/speedtest.py | python -
|
||||||
|
|
||||||
speedtest-cli
|
speedtest-cli
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Command line interface for testing internet bandwidth using
|
Command line interface for testing internet bandwidth using
|
||||||
speedtest.net
|
speedtest.net
|
||||||
|
|
||||||
.. image:: https://pypip.in/v/speedtest-cli/badge.png
|
.. image:: https://img.shields.io/pypi/v/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: Latest Version
|
:alt: Latest Version
|
||||||
.. image:: https://pypip.in/d/speedtest-cli/badge.png
|
.. image:: https://img.shields.io/travis/sivel/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: Downloads
|
:alt: Travis
|
||||||
.. image:: https://pypip.in/license/speedtest-cli/badge.png
|
.. image:: https://img.shields.io/pypi/l/speedtest-cli.svg
|
||||||
:target: https://pypi.python.org/pypi/speedtest-cli/
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
:alt: License
|
:alt: License
|
||||||
|
|
||||||
Versions
|
Versions
|
||||||
--------
|
--------
|
||||||
|
|
||||||
speedtest-cli works with Python 2.4-3.4
|
speedtest-cli works with Python 2.4-3.7
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/pypi/pyversions/speedtest-cli.svg
|
||||||
|
:target: https://pypi.python.org/pypi/speedtest-cli/
|
||||||
|
:alt: Versions
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@ -54,14 +62,14 @@ Just download (Like the way it used to be)
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
|
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
|
||||||
chmod +x speedtest-cli
|
chmod +x speedtest-cli
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
curl -o speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
|
curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
|
||||||
chmod +x speedtest-cli
|
chmod +x speedtest-cli
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
@ -70,8 +78,12 @@ Usage
|
|||||||
::
|
::
|
||||||
|
|
||||||
$ speedtest-cli -h
|
$ speedtest-cli -h
|
||||||
usage: speedtest-cli [-h] [--share] [--simple] [--list] [--server SERVER]
|
usage: speedtest-cli [-h] [--no-download] [--no-upload] [--bytes] [--share]
|
||||||
[--mini MINI] [--source SOURCE] [--version]
|
[--simple] [--csv] [--csv-delimiter CSV_DELIMITER]
|
||||||
|
[--csv-header] [--json] [--list] [--server SERVER]
|
||||||
|
[--exclude EXCLUDE] [--mini MINI] [--source SOURCE]
|
||||||
|
[--timeout TIMEOUT] [--secure] [--no-pre-allocate]
|
||||||
|
[--version]
|
||||||
|
|
||||||
Command line interface for testing internet bandwidth using speedtest.net.
|
Command line interface for testing internet bandwidth using speedtest.net.
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
@ -79,12 +91,65 @@ Usage
|
|||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
|
--no-download Do not perform download test
|
||||||
|
--no-upload Do not perform upload test
|
||||||
|
--bytes Display values in bytes instead of bits. Does not
|
||||||
|
affect the image generated by --share, nor output from
|
||||||
|
--json or --csv
|
||||||
--share Generate and provide a URL to the speedtest.net share
|
--share Generate and provide a URL to the speedtest.net share
|
||||||
results image
|
results image, not displayed with --csv
|
||||||
--simple Suppress verbose output, only show basic information
|
--simple Suppress verbose output, only show basic information
|
||||||
--list Display a list of speedtest.net servers sorted by distance
|
--csv Suppress verbose output, only show basic information
|
||||||
--server SERVER Specify a server ID to test against
|
in CSV format. Speeds listed in bit/s and not affected
|
||||||
|
by --bytes
|
||||||
|
--csv-delimiter CSV_DELIMITER
|
||||||
|
Single character delimiter to use in CSV output.
|
||||||
|
Default ","
|
||||||
|
--csv-header Print CSV headers
|
||||||
|
--json Suppress verbose output, only show basic information
|
||||||
|
in JSON format. Speeds listed in bit/s and not
|
||||||
|
affected by --bytes
|
||||||
|
--list Display a list of speedtest.net servers sorted by
|
||||||
|
distance
|
||||||
|
--server SERVER Specify a server ID to test against. Can be supplied
|
||||||
|
multiple times
|
||||||
|
--exclude EXCLUDE Exclude a server from selection. Can be supplied
|
||||||
|
multiple times
|
||||||
--mini MINI URL of the Speedtest Mini server
|
--mini MINI URL of the Speedtest Mini server
|
||||||
--source SOURCE Source IP address to bind to
|
--source SOURCE Source IP address to bind to
|
||||||
|
--timeout TIMEOUT HTTP timeout in seconds. Default 10
|
||||||
|
--secure Use HTTPS instead of HTTP when communicating with
|
||||||
|
speedtest.net operated servers
|
||||||
|
--no-pre-allocate Do not pre allocate upload data. Pre allocation is
|
||||||
|
enabled by default to improve upload performance. To
|
||||||
|
support systems with insufficient memory, use this
|
||||||
|
option to avoid a MemoryError
|
||||||
--version Show the version number and exit
|
--version Show the version number and exit
|
||||||
|
|
||||||
|
|
||||||
|
Python API
|
||||||
|
----------
|
||||||
|
|
||||||
|
See the `wiki <https://github.com/sivel/speedtest-cli/wiki>`_.
|
||||||
|
|
||||||
|
|
||||||
|
Inconsistency
|
||||||
|
-------------
|
||||||
|
|
||||||
|
It is not a goal of this application to be a reliable latency reporting tool.
|
||||||
|
|
||||||
|
Latency reported by this tool should not be relied on as a value indicative of ICMP
|
||||||
|
style latency. It is a relative value used for determining the lowest latency server
|
||||||
|
for performing the actual speed test against.
|
||||||
|
|
||||||
|
There is the potential for this tool to report results inconsistent with Speedtest.net.
|
||||||
|
There are several concepts to be aware of that factor into the potential inconsistency:
|
||||||
|
|
||||||
|
1. Speedtest.net has migrated to using pure socket tests instead of HTTP based tests
|
||||||
|
2. This application is written in Python
|
||||||
|
3. Different versions of Python will execute certain parts of the code faster than others
|
||||||
|
4. CPU and Memory capacity and speed will play a large part in inconsistency between
|
||||||
|
Speedtest.net and even other machines on the same network
|
||||||
|
|
||||||
|
Issues relating to inconsistencies will be closed as wontfix and without
|
||||||
|
additional reason or context.
|
||||||
|
|||||||
84
setup.py
84
setup.py
@ -1,28 +1,96 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2012-2018 Matt Martz
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
import setuptools
|
import os
|
||||||
|
import re
|
||||||
|
import codecs
|
||||||
|
|
||||||
setuptools.setup(
|
from setuptools import setup
|
||||||
|
|
||||||
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
|
||||||
|
# Read the version number from a source file.
|
||||||
|
# Why read it, and not import?
|
||||||
|
# see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
|
||||||
|
def find_version(*file_paths):
|
||||||
|
# Open in Latin-1 so that we avoid encoding errors.
|
||||||
|
# Use codecs.open for Python 2 compatibility
|
||||||
|
try:
|
||||||
|
f = codecs.open(os.path.join(here, *file_paths), 'r', 'latin1')
|
||||||
|
version_file = f.read()
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
raise RuntimeError("Unable to find version string.")
|
||||||
|
|
||||||
|
# The version line must have the form
|
||||||
|
# __version__ = 'ver'
|
||||||
|
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
|
||||||
|
version_file, re.M)
|
||||||
|
if version_match:
|
||||||
|
return version_match.group(1)
|
||||||
|
raise RuntimeError("Unable to find version string.")
|
||||||
|
|
||||||
|
|
||||||
|
# Get the long description from the relevant file
|
||||||
|
try:
|
||||||
|
f = codecs.open('README.rst', encoding='utf-8')
|
||||||
|
long_description = f.read()
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
long_description = ''
|
||||||
|
|
||||||
|
|
||||||
|
setup(
|
||||||
name='speedtest-cli',
|
name='speedtest-cli',
|
||||||
version='0.2.5',
|
version=find_version('speedtest.py'),
|
||||||
description=('Command line interface for testing internet bandwidth using '
|
description=('Command line interface for testing internet bandwidth using '
|
||||||
'speedtest.net'),
|
'speedtest.net'),
|
||||||
long_description=open('README.rst').read(),
|
long_description=long_description,
|
||||||
|
keywords='speedtest speedtest.net',
|
||||||
author='Matt Martz',
|
author='Matt Martz',
|
||||||
author_email='matt@sivel.net',
|
author_email='matt@sivel.net',
|
||||||
url='https://github.com/sivel/speedtest-cli',
|
url='https://github.com/sivel/speedtest-cli',
|
||||||
license='Apache License, Version 2.0',
|
license='Apache License, Version 2.0',
|
||||||
py_modules=['speedtest_cli'],
|
py_modules=['speedtest'],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'speedtest=speedtest_cli:main',
|
'speedtest=speedtest:main',
|
||||||
'speedtest-cli=speedtest_cli:main'
|
'speedtest-cli=speedtest:main'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
'License :: OSI Approved :: Apache Software License',
|
'License :: OSI Approved :: Apache Software License',
|
||||||
'Operating System :: OS Independent'
|
'Operating System :: OS Independent',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Programming Language :: Python :: 2.4',
|
||||||
|
'Programming Language :: Python :: 2.5',
|
||||||
|
'Programming Language :: Python :: 2.6',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.1',
|
||||||
|
'Programming Language :: Python :: 3.2',
|
||||||
|
'Programming Language :: Python :: 3.3',
|
||||||
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: 3.5',
|
||||||
|
'Programming Language :: Python :: 3.6',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
.TH "speedtest-cli" 1 "2014-01-26" "speedtest-cli"
|
.TH "speedtest-cli" 1 "2018-01-05" "speedtest-cli"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
speedtest\-cli \- Test your bandwidth througput using speedtest.net
|
speedtest\-cli \- Command line interface for testing internet bandwidth using speedtest.net
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B speedtest\-cli
|
.B speedtest\-cli
|
||||||
[OPTION]...
|
[OPTION...]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Speedtest.net is a web service for testing your broadband connection by downloading a file
|
Speedtest.net is a web service for testing your broadband connection by downloading a file
|
||||||
from a nearby speedtest.net server on the web. This tool allows you to access the service
|
from a nearby speedtest.net server on the web. This tool allows you to access the service
|
||||||
@ -23,9 +23,24 @@ Displays usage for the tool.
|
|||||||
|
|
||||||
.B Options
|
.B Options
|
||||||
|
|
||||||
|
\fB\-\-no\-download\fR
|
||||||
|
.RS
|
||||||
|
Do not perform download test
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-no\-upload\fR
|
||||||
|
.RS
|
||||||
|
Do not perform upload test
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-bytes\fR
|
||||||
|
.RS
|
||||||
|
Display values in bytes instead of bits. Does not affect the image generated by \-\-share, nor output from \-\-json or \-\-csv
|
||||||
|
.RE
|
||||||
|
|
||||||
\fB\-\-share\fR
|
\fB\-\-share\fR
|
||||||
.RS
|
.RS
|
||||||
Generate and provide a URL to the speedtest.net share results image
|
Generate and provide a URL to the speedtest.net share results image, not displayed with \-\-csv
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-simple\fR
|
\fB\-\-simple\fR
|
||||||
@ -33,6 +48,26 @@ Generate and provide a URL to the speedtest.net share results image
|
|||||||
Suppress verbose output, only show basic information
|
Suppress verbose output, only show basic information
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-csv\fR
|
||||||
|
.RS
|
||||||
|
Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by \-\-bytes
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-csv\-delimiter CSV_DELIMITER\fR
|
||||||
|
.RS
|
||||||
|
Single character delimiter to use in CSV output. Default ","
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-csv\-header\fR
|
||||||
|
.RS
|
||||||
|
Print CSV headers
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-json\fR
|
||||||
|
.RS
|
||||||
|
Suppress verbose output, only show basic information in JSON format. Speeds listed in bit/s and not affected by \-\-bytes
|
||||||
|
.RE
|
||||||
|
|
||||||
\fB\-\-list\fR
|
\fB\-\-list\fR
|
||||||
.RS
|
.RS
|
||||||
Display a list of speedtest.net servers sorted by distance
|
Display a list of speedtest.net servers sorted by distance
|
||||||
@ -40,7 +75,12 @@ Display a list of speedtest.net servers sorted by distance
|
|||||||
|
|
||||||
\fB\-\-server SERVER\fR
|
\fB\-\-server SERVER\fR
|
||||||
.RS
|
.RS
|
||||||
Specify a server ID to test against
|
Specify a server ID to test against. Can be supplied multiple times
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-exclude EXCLUDE\fR
|
||||||
|
.RS
|
||||||
|
Exclude a server from selection. Can be supplied multiple times
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
\fB\-\-mini MINI\fR
|
\fB\-\-mini MINI\fR
|
||||||
@ -53,6 +93,21 @@ URL of the Speedtest Mini server
|
|||||||
Source IP address to bind to
|
Source IP address to bind to
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-timeout TIMEOUT\fR
|
||||||
|
.RS
|
||||||
|
HTTP timeout in seconds. Default 10
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-secure\fR
|
||||||
|
.RS
|
||||||
|
Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
|
||||||
|
.RE
|
||||||
|
|
||||||
|
\fB\-\-no\-pre\-allocate\fR
|
||||||
|
.RS
|
||||||
|
Do not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this option to avoid a MemoryError
|
||||||
|
.RE
|
||||||
|
|
||||||
\fB\-\-version\fR
|
\fB\-\-version\fR
|
||||||
.RS
|
.RS
|
||||||
Show the version number and exit
|
Show the version number and exit
|
||||||
|
|||||||
1895
speedtest.py
Executable file
1895
speedtest.py
Executable file
File diff suppressed because it is too large
Load Diff
1077
speedtest_cli.py
1077
speedtest_cli.py
File diff suppressed because it is too large
Load Diff
37
tests/scripts/source.py
Normal file
37
tests/scripts/source.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2018 Matt Martz
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
cmd = [sys.executable, 'speedtest.py', '--source', '127.0.0.1']
|
||||||
|
|
||||||
|
p = subprocess.Popen(
|
||||||
|
cmd,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
|
||||||
|
if p.returncode != 1:
|
||||||
|
raise SystemExit('%s did not fail with exit code 1' % ' '.join(cmd))
|
||||||
|
|
||||||
|
if 'Invalid argument'.encode() not in stderr:
|
||||||
|
raise SystemExit(
|
||||||
|
'"Invalid argument" not found in stderr:\n%s' % stderr.decode()
|
||||||
|
)
|
||||||
12
tox.ini
12
tox.ini
@ -4,16 +4,22 @@ skipsdist=true
|
|||||||
[testenv]
|
[testenv]
|
||||||
commands =
|
commands =
|
||||||
{envpython} -V
|
{envpython} -V
|
||||||
{envpython} speedtest_cli.py
|
{envpython} -m compileall speedtest.py
|
||||||
|
{envpython} speedtest.py
|
||||||
|
{envpython} speedtest.py --source 172.17.0.1
|
||||||
|
{envpython} tests/scripts/source.py
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
basepython=python
|
basepython=python
|
||||||
deps=flake8
|
deps=flake8
|
||||||
commands =
|
commands =
|
||||||
{envpython} -V
|
{envpython} -V
|
||||||
flake8 speedtest_cli.py
|
flake8 speedtest.py
|
||||||
|
|
||||||
[testenv:pypy]
|
[testenv:pypy]
|
||||||
commands =
|
commands =
|
||||||
pypy -V
|
pypy -V
|
||||||
pypy speedtest_cli.py
|
pypy -m compileall speedtest.py
|
||||||
|
pypy speedtest.py
|
||||||
|
pypy speedtest.py --source 172.17.0.1
|
||||||
|
pypy tests/scripts/source.py
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user