# Rehive Python SDK
A tool primarly used for quick interfacing with the Rehive API.
## Install
```
pip install rehive
```
## Documentation
For more in depth api details go to: http://docs.rehive.com/
## Examples And How-to
```python
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.
The SDK will default to the live API. To easily switch to staging there is a network flag:
```python
rehive = Rehive(network='staging')
```
Login:
```python
rehive.auth.login(
user="test@rehive.com",
company="test_company",
password="12345678"
)
```
Get:
```python
rehive.admin.accounts.get()
```
Get nested objects:
```python
rehive.admin.accounts.obj('5AT24mW61H').currencies.get()
```
Get with filters:
```python
rehive.admin.transactions.get(filters={"status":"confirmed"})
```
Create:
```python
rehive.admin.users.emails.create('1d3e584d-ac56-483c-8aa5-d4ef059608ba', 'connor+899@rehive.com', verified=True)
```
Patch/Put:
```python
rehive.admin.company.switches.patch('1', enabled=True) # Patch switch with identifier 1
```
Pagination:
```python
rehive.admin.currencies.get()
rehive.admin.currencies.get_next()
rehive.admin.currencies.get_previous()
```
## Exception And Error Handling
```python
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 Rehive
```
## Idempotent requests
```python
rehive.user.update(last_name='test7777', idempotent_key='{UNIQUE_KEY}')
```
A tool primarly used for quick interfacing with the Rehive API.
## Install
```
pip install rehive
```
## Documentation
For more in depth api details go to: http://docs.rehive.com/
## Examples And How-to
```python
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.
The SDK will default to the live API. To easily switch to staging there is a network flag:
```python
rehive = Rehive(network='staging')
```
Login:
```python
rehive.auth.login(
user="test@rehive.com",
company="test_company",
password="12345678"
)
```
Get:
```python
rehive.admin.accounts.get()
```
Get nested objects:
```python
rehive.admin.accounts.obj('5AT24mW61H').currencies.get()
```
Get with filters:
```python
rehive.admin.transactions.get(filters={"status":"confirmed"})
```
Create:
```python
rehive.admin.users.emails.create('1d3e584d-ac56-483c-8aa5-d4ef059608ba', 'connor+899@rehive.com', verified=True)
```
Patch/Put:
```python
rehive.admin.company.switches.patch('1', enabled=True) # Patch switch with identifier 1
```
Pagination:
```python
rehive.admin.currencies.get()
rehive.admin.currencies.get_next()
rehive.admin.currencies.get_previous()
```
## Exception And Error Handling
```python
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 Rehive
```
## Idempotent requests
```python
rehive.user.update(last_name='test7777', idempotent_key='{UNIQUE_KEY}')
```
Metadata
Release files for rehive 1.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rehive-1.1.10.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rehive-1.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / rehive-1.1.10.tar.gz
| Download URL | rehive-1.1.10.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b69c8c5930b9039fec36b93d6b8deb368899345396e09590ae3403de90919abc
|
|
BLAKE2b-256 checksum How to use checksums |
cc66e5f5effd7e4fbbfe6af86d92da61df9ce0b9f06416d5e9c9b20536dca78c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Release files / rehive-1.1.10-py3-none-any.whl
| Download URL | rehive-1.1.10-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1332f4f3bc9b916b862bf024f10fe0b0b80f86e61b8168e2a8d97590d41a76d
|
|
BLAKE2b-256 checksum How to use checksums |
639b29a798476fc1e6d41bc41b2c72a9c0a5736185aa01fe43ce70e18cd4335f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|