No project description provided
Project description
Dopt Blocks Python Library
Installation
Add this dependency to your project's build file:
pip install dopt-blocks-python-client
# or
poetry add dopt-blocks-python-client
Usage
from dopt.client import DoptApi
client = DoptApi(api_key="YOUR_API_KEY)
# Fetch a flow from dopt, including its blocks. The first fetch of
# this (flow.sid, flow.version) tuple will initialize the flow for
# the `user_identifier`
flow = client.flows.get_flow(
sid="example-flow",
version=1,
include="block",
user_identifier="joe_mckenney",
group_identifier=None,
)
print(flow)
# Fetch a block for some previously initialized flow
block = client.blocks.get_block(
uid="9sKe7gx4HZj_VI7oxfVD3", version=1, user_identifier="joe_mckenney"
)
print(block)
Async Client
import asyncio
from dopt.client import AsyncDoptApi
async_client = AsyncDoptApi(api_key="YOUR_API_KEY)
async def get_flow() -> None:
response = async_client.flows.get_flow(
sid="example-flow",
version=1,
include="block",
user_identifier="joe_mckenney",
group_identifier=None,
);
print(response)
asyncio.run(get_flow())
Contributing
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!
Project details
Release history Release notifications | RSS feed
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 dopt_blocks_python_client-1.0.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19172fe945e7f99198c547793f60961343adf2b688240ba4e49eff967ec22784 |
|
MD5 | 8ad0e346920a9f00c8891a5af7270df3 |
|
BLAKE2b-256 | 03428db05b22e8a8ff2b9733fc5ef991875215b760fe23b860a8c98017813b04 |
Close
Hashes for dopt_blocks_python_client-1.0.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0a5595aebf8d8a10c3b6fe3b7026660ad6d21b3a855144e1bff6a37a18ea077 |
|
MD5 | 0d88770c3883fc18d6dcf0d6a3590890 |
|
BLAKE2b-256 | 6eb4a5919df4fd81125859044fd6fe82a25dd1506f7dfe9277dbd22c97b6341a |