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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27fad36c1b0c4dd5979371e4f6948f35b84af7c451069377c844c07754d79fb6 |
|
MD5 | 614332fdc408f4de748268fcfdca9db7 |
|
BLAKE2b-256 | 605e227a03b5e9f2050d0c2f0740bab2c2972cc20c85e71b66bed8210419199a |
Close
Hashes for sequoia_client_sdk_async-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12aa69ac0bb2cae9df941f8ab0c4f4547d638a626b55ed69765de412c924fa35 |
|
MD5 | f45c5e9919a2663e75e265ae7e332ab8 |
|
BLAKE2b-256 | 1cb018ab8986b72ac1ae960373685972d286e205a814de4abfe2a4f320bd84d5 |