Skip to main content

Python client for StatelyDB API

Project description

StatelyDB SDK for Python

This is the Python SDK for StatelyDB.

Getting started:

Disclaimer:

We're still in an invite-only preview mode - if you're interested, please reach out to preview@stately.cloud.

When you join the preview program, we'll set you up with a few bits of information:

  1. STATELY_CLIENT_ID - a client identifier so we know what client you are.
  2. STATELY_CLIENT_SECRET - a sensitive secret that lets your applications authenticate with the API.
  3. A store ID that identifies which store in your organization you're using.
  4. Access to our in-depth Getting Started Guide.

Begin by following our Getting Started Guide which will help you define, generate, and publish a DB schema so that it can be used.

Install the SDK
pip install statelydb

Usage:

Create an authenticated client, then import your item types from your generated schema module and use the client!

from schema import Client, MyItem
async def put_my_item() -> None:
    # Create a client. This will use the environment variables
    # STATELY_CLIENT_ID and STATELY_CLIENT_SECRET for your client.
    client = Client(store_id=<store-id>)

    # Instantiate an item from your schema
    item = MyItem(name="Jane Doe")

    # put and get the item!
    put_result = await client.put(item)
    get_result = await client.get(MyItem, put_result.key_path())
    assert put_result == get_result

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

statelydb-0.4.1.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statelydb-0.4.1-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

Details for the file statelydb-0.4.1.tar.gz.

File metadata

  • Download URL: statelydb-0.4.1.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for statelydb-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cb72a20efefd1e7ade4ab8b7e8409f6f8dee15c621e287aadde30905cd917426
MD5 55b2e76180b412c589cd8661f2f92635
BLAKE2b-256 7a55c519907de44e14e79c7a3e8620804167076bf0087964b56d2fdc3a2874e6

See more details on using hashes here.

File details

Details for the file statelydb-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: statelydb-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 56.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for statelydb-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93ad866552d4946f6b97b07566f05b8faeda1c091ee05846216106abade94ac9
MD5 f69aa6b76dfe4e7c3436e1eff50b8fbe
BLAKE2b-256 591a3a9a1f6e1955989f53712a86df70eb72c8295a21fd8787cfd73cc0c6765f

See more details on using hashes here.

Supported by

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