A Python SDK for the Rehive Platform API.
pip install rehiveFor documentation on the Rehive ecosystem: Docs Portal
For the full Rehive Platform API specification: API Reference
from rehive import Rehive, APIException
rehive = Rehive() # OR Rehive(API_TOKEN_HERE)You can parse an api token or leave blank if manually logging in. Each object instance will store it's own token and act as another user.
Auth:
rehive = Rehive(REHIVE_API_KEY)Get:
rehive.admin.accounts.get()Get nested objects:
rehive.admin.accounts.obj('5AT24mW61H').currencies.get()Get with filters:
rehive.admin.transactions.get(filters={"status":"complete"})Create:
rehive.admin.users.emails.create('1d3e584d-ac56-483c-8aa5-d4ef059608ba', '[email protected]', verified=True)Patch/Put:
rehive.admin.company.switches.patch('1', enabled=True) # Patch switch with identifier 1Pagination:
rehive.admin.currencies.get()
rehive.admin.currencies.get_next()
rehive.admin.currencies.get_previous()from rehive import APIException
try:
rehive.admin.currencies.get()
except APIException as e:
print(e.status_code) # Error code status code from Rehive
print(e.data) # Any custom error messages and data returned from Rehiverehive.user.update(last_name='test7777', idempotent_key='{UNIQUE_KEY}')Generate a python package.
python setup.py sdistInstall twine if you have not done so already.
pip install twineUpload the python package:
twine upload dist/*