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
Getting it into PyPi is planned.
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'
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file OnionPy-0.1.4.tar.gz
.
File metadata
- Download URL: OnionPy-0.1.4.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db7be73fdb1af0840ec10c8c8ba0d01d5a9a92e22f5c7f32894e1784fe57252 |
|
MD5 | 3c63f0457740200f5c544bb52e887de4 |
|
BLAKE2b-256 | cfea16ec22c551a18a323fff75b754282035de621ebfc6f496da30e866947168 |
File details
Details for the file OnionPy-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: OnionPy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f5c9575ca617b8dfd99787b57ff07e84cbf5f6d4b8f42b65bcd0c9d2a1dc525 |
|
MD5 | 58d3f7659c0f9b5f2e1087613d631adb |
|
BLAKE2b-256 | 7592d730ab0e66bda376d987697e25df320e761bdd1d604080059215c2d0e53b |