Ark Python client library
Project description
Ark Python client
Basic usage:
from ark_client import Client, ClientError
api = Client(YOUR_APP_ID, YOUR_SECRET_KEY, "https://ark.provider.tld/api/v1/")
ark_name = api.create(
"http://somewhere.tld/some-resource/", {
"who": "someone",
"what": "something",
"where": "somewhere"
}
)
ark_infos = api.read(ark_name)
api.update(ark_name, "http://somewhereelse.tld/some-resource/")
try:
api.read("doesnot/exist")
except ClientError as e:
print(e.response.status_code) # response contains a Python/Requests response object
Batch mode:
batch = api.batch()
batch.read(ark_name)
batch.create("http://somewhere.tld/some-resource/")
batch.update(anothe_ark_name,"http://somewhere.tld/some-other-resource/")
for item in batch.commit():
print("{}: {}".format(item["ark_name"], item["ark_location"]))
In batch mode, method chaining is available:
api.batch()
.read(some_ark_name)
.read(some_other_ark_name)
.update(yet_another_name, "http://somewhereelse.tld/")
.commit()
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
Close
Hashes for ark_client_certic-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36fd88fb2ee417c1c99d4766e0432e33278cb17646f532c6166da11fae316871 |
|
MD5 | 84fbddd18c01698843a6bee41382199d |
|
BLAKE2b-256 | 6297478d2a3a5984161b82b1156f64d0df0ce74f4fe63f67dc3823871a68d335 |