Skip to main content

Python wrapper for the OnionOO tor status API

Project description

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.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OnionPy-0.5.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distributions

OnionPy-0.5.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

OnionPy-0.5.0-py2-none-any.whl (11.2 kB view details)

Uploaded Python 2

File details

Details for the file OnionPy-0.5.0.tar.gz.

File metadata

  • Download URL: OnionPy-0.5.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for OnionPy-0.5.0.tar.gz
Algorithm Hash digest
SHA256 3c049d0970b868867ace27c7aabb4427ec7d4b2dfadcf61e2e87ed6793842128
MD5 5fe48322d4b2629c095387d8971f36d4
BLAKE2b-256 8111e85ae3c7c71730c9f8c3c912d572f7b7fbc605b103ece722c223a15b21c3

See more details on using hashes here.

File details

Details for the file OnionPy-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for OnionPy-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4faac7abe40d84e36e53a0ac8684248f039b713ef203032b11169e1f93177bde
MD5 36c730e3c20e982eab44cca00505dea5
BLAKE2b-256 d075fdc9e64a27bfbb63424ff8232755f3f66426259080ecf913fe7d365d0f38

See more details on using hashes here.

File details

Details for the file OnionPy-0.5.0-py2-none-any.whl.

File metadata

File hashes

Hashes for OnionPy-0.5.0-py2-none-any.whl
Algorithm Hash digest
SHA256 9bbc20c943c78a40c55d5e28d5ad041756b5b127832731e300e7f3ddee12615f
MD5 94bbf292e621a60a1c344a8b45e400cf
BLAKE2b-256 23aef4ac89fecf800d385a8f082d0f3d8b2fa6b3c26e8cebe4bc37e74aa1baa2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page