OnionPy
========
A comprehensive pure-Python wrapper for the OnionOO Tor status API, with memcached support to cache queried data.
Installing OnionPy
===================
You can install onion-py manually by doing the following (requires setuptools!)::
git clone https://github.com/duk3luk3/onion-py.git
cd onion-py
#run tests if desired
PYTHONPATH=. python bin/onion.py test
sudo python setup.py install
For the optional memcached support, install pymemcache and six::
sudo pip install six
sudo pip install https://github.com/pinterest/pymemcache.git
The package is also on [Pypi](https://pypi.python.org/pypi/OnionPy).
**Beware**: <del>OnionPy has been developed and tested exclusively with Python 3. Please let Python 2 rest in peace forevermore.</del> OnionPy is compatible with Python 2.7 upwards.
Usage
=====
>>> from onion_py.manager import Manager
>>> from onion_py.caching import OnionSimpleCache
>>> manager = Manager(OnionSimpleCache())
>>> s = manager.query('summary', limit=4)
>>> s.relays[0].fingerprint
'695D027F728A3B95D0D7F6464D63F82229BFA361'
>>> s.relays[0].nickname
'GREATWHITENORTH'
Accepted Queries
=====
Summary, details, bandwidth, weights, clients, uptime
>>> s = manager.query('summary', limit=4)
>>> s = manager.query('details', limit=4)
>>> s = manager.query('bandwidth', limit=4)
>>> s = manager.query('weights', limit=4)
>>> s = manager.query('clients', limit=4)
>>> s = manager.query('uptime', limit=4)
License
=======
BSD 3-clause. See LICENSE.
Portions of this work obviously belong to to OnionOO and therefore the Tor Project. See ONIONOO-LICENSE.
========
A comprehensive pure-Python wrapper for the OnionOO Tor status API, with memcached support to cache queried data.
Installing OnionPy
===================
You can install onion-py manually by doing the following (requires setuptools!)::
git clone https://github.com/duk3luk3/onion-py.git
cd onion-py
#run tests if desired
PYTHONPATH=. python bin/onion.py test
sudo python setup.py install
For the optional memcached support, install pymemcache and six::
sudo pip install six
sudo pip install https://github.com/pinterest/pymemcache.git
The package is also on [Pypi](https://pypi.python.org/pypi/OnionPy).
**Beware**: <del>OnionPy has been developed and tested exclusively with Python 3. Please let Python 2 rest in peace forevermore.</del> OnionPy is compatible with Python 2.7 upwards.
Usage
=====
>>> from onion_py.manager import Manager
>>> from onion_py.caching import OnionSimpleCache
>>> manager = Manager(OnionSimpleCache())
>>> s = manager.query('summary', limit=4)
>>> s.relays[0].fingerprint
'695D027F728A3B95D0D7F6464D63F82229BFA361'
>>> s.relays[0].nickname
'GREATWHITENORTH'
Accepted Queries
=====
Summary, details, bandwidth, weights, clients, uptime
>>> s = manager.query('summary', limit=4)
>>> s = manager.query('details', limit=4)
>>> s = manager.query('bandwidth', limit=4)
>>> s = manager.query('weights', limit=4)
>>> s = manager.query('clients', limit=4)
>>> s = manager.query('uptime', limit=4)
License
=======
BSD 3-clause. See LICENSE.
Portions of this work obviously belong to to OnionOO and therefore the Tor Project. See ONIONOO-LICENSE.
Release files for OnionPy 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| OnionPy-0.5.0.tar.gz | 8.9 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| OnionPy-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
| OnionPy-0.5.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size:31.3 kB
Release files / OnionPy-0.5.0.tar.gz
| Download URL | OnionPy-0.5.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c049d0970b868867ace27c7aabb4427ec7d4b2dfadcf61e2e87ed6793842128
|
|
BLAKE2b-256 checksum How to use checksums |
8111e85ae3c7c71730c9f8c3c912d572f7b7fbc605b103ece722c223a15b21c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / OnionPy-0.5.0-py3-none-any.whl
| Download URL | OnionPy-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4faac7abe40d84e36e53a0ac8684248f039b713ef203032b11169e1f93177bde
|
|
BLAKE2b-256 checksum How to use checksums |
d075fdc9e64a27bfbb63424ff8232755f3f66426259080ecf913fe7d365d0f38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / OnionPy-0.5.0-py2-none-any.whl
| Download URL | OnionPy-0.5.0-py2-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
9bbc20c943c78a40c55d5e28d5ad041756b5b127832731e300e7f3ddee12615f
|
|
BLAKE2b-256 checksum How to use checksums |
23aef4ac89fecf800d385a8f082d0f3d8b2fa6b3c26e8cebe4bc37e74aa1baa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |