Skip to main content

No project description provided

Project description

Piksel Palette

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

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

sequoia-client-sdk-async-0.4.0.tar.gz (22.3 kB view hashes)

Uploaded Source

Built Distribution

sequoia_client_sdk_async-0.4.0-py3-none-any.whl (23.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page