No project description provided
Project description
Sequoia Client SDK Async
Python asyncio based SDK for interacting with Piksel Palette services, providing a high level interface to ease the development of different pieces on top of this ecosystem.
Among other characteristics it provides the following:
- Authentication flow integrated and transparent.
- Async requests based on
asyncio
engine providing a high throughput. - Discovery for Sequoia services, API resources and methods.
- Lazy loading to avoid use and discover not needed elements.
- Pagination automatically handled using continue-based pagination. It's completely transparent to client users.
Requirements
- Python 3.6+
Installation
$ pip install sequoia-client-sdk-async
Usage
The client understand three kind of elements:
Service
: Sequoia service against to the request will be performed.Resource
: An specific resource of previous service.Method
: Operation that will be performed (create
,retrieve
,update
,delete
,list
).
The syntax to interact with the client is the following for a resource (create
, retrieve
, update
, delete
):
await client.service.resource.method(params={}, headers={})
And the next one for interacting with collections (list
):
async for item in client.service.resource.method(params={}, headers={}):
... # Do something
Examples
Here is a list of some client usage examples.
Iterate over a list of metadata offers filtered by availabilityStartAt
import sequoia
async with sequoia.Client(client_id="foo", client_secret="bar", registry_url="https://foo.bar") as client:
async for offer in client.metadata.offers.list(params={"withAvailabilityStartAt": "2000-01-01T00:00:00.000Z"}):
... # Do fancy things with this offer
Create a metadata offer
import sequoia
async with sequoia.Client(client_id="foo", client_secret="bar", registry_url="https://foo.bar") as client:
await client.metadata.offers.create(json={"foo": "bar"})
Retrieve a metadata offer
import sequoia
async with sequoia.Client(client_id="foo", client_secret="bar", registry_url="https://foo.bar") as client:
offer = await client.metadata.offers.retrieve(pk="foo")
Update a metadata offer
import sequoia
async with sequoia.Client(client_id="foo", client_secret="bar", registry_url="https://foo.bar") as client:
await client.metadata.offers.update(pk="foo", json={"foo": "bar"})
Delete a metadata offer
import sequoia
async with sequoia.Client(client_id="foo", client_secret="bar", registry_url="https://foo.bar") as client:
await client.metadata.offers.delete(pk="foo")
Project details
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 sequoia-client-sdk-async-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd4e73bc1ffc33a89c3bf858d443ffa89b79c8fc2824663c2ac6b64e91a67c0 |
|
MD5 | 2295305b9364b32cc32e70d66994f015 |
|
BLAKE2b-256 | 5d4f4431ff98d0276eb20c71e21e121194256057b37893c4235e53f22cc51c51 |
Close
Hashes for sequoia_client_sdk_async-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1621c974544d28f707d9a9b711ab1303bd4d3d4454d72c65066133b4857999a5 |
|
MD5 | 6e6f54a0aee245aff2617238c15aaa48 |
|
BLAKE2b-256 | 3e037ddd20aaec35fd411c2c05e37329587aa801320397d7d7b6071ec976d428 |