Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duk3luk3/onion-py
Python wrapper for the OnionOO tor status API
https://github.com/duk3luk3/onion-py
Last synced: 3 months ago
JSON representation
Python wrapper for the OnionOO tor status API
- Host: GitHub
- URL: https://github.com/duk3luk3/onion-py
- Owner: duk3luk3
- License: other
- Created: 2014-03-30T20:34:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-03T12:22:10.000Z (over 7 years ago)
- Last Synced: 2024-10-11T19:47:51.884Z (4 months ago)
- Language: Python
- Size: 39.1 KB
- Stars: 32
- Watchers: 7
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-network-stuff - **27**星
README
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 installFor the optional memcached support, install pymemcache and six::
sudo pip install six
sudo pip install https://github.com/pinterest/pymemcache.gitThe package is also on [Pypi](https://pypi.python.org/pypi/OnionPy).
**Beware**:
OnionPy has been developed and tested exclusively with Python 3. Please let Python 2 rest in peace forevermore.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.