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:
- Async requests based on
asyncio
engine providing a high throughput. - Lazy loading to avoid use and discover not needed elements.
- Authentication flow integrated and transparent.
- Discovery for Sequoia services, API resources and methods.
- Pagination automatically handled using continue-based pagination. It's completely transparent to client users.
- Schema validation, including serialization from Sequoia API types into Python's native types and the opposite.
- Syntactic sugar to allow its usage be pythonic.
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 an specific 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
File details
Details for the file sequoia-client-sdk-async-0.4.0.tar.gz
.
File metadata
- Download URL: sequoia-client-sdk-async-0.4.0.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c448b9d34c0f42c10091d1ea1daaf61ecf6f46709d7da822638d5012b514c29f |
|
MD5 | 5a10e8512d1347c68521e6bebda7e011 |
|
BLAKE2b-256 | 18dc77eb976eff0de9892e9db097cc65847d34364e6a3c7dc3c16c61691b4fd5 |
File details
Details for the file sequoia_client_sdk_async-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: sequoia_client_sdk_async-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cac6bc909011dc1d8fa016550c47d8bc803dacb16592d07e4b08674ee0629483 |
|
MD5 | 1791800db6a608dd8bb7f168587ae0a4 |
|
BLAKE2b-256 | f2a9ab4a9a6c39cb64bb9bf6a637a667b1650dbc02ec8904293a0ed9c77775c0 |