Python SDK for the Acontext API
Project description
acontext client for python
Python SDK for interacting with the Acontext REST API.
Installation
pip install acontext
Requires Python 3.13 or newer.
Quickstart
from acontext import AcontextClient, MessagePart
with AcontextClient(api_key="sk_project_token") as client:
# List spaces for the authenticated project
spaces = client.spaces.list()
# Create a session bound to the first space
session = client.sessions.create(space_id=spaces[0]["id"])
# Send a text message to the session
client.sessions.send_message(
session["id"],
role="user",
parts=[MessagePart.text_part("Hello from Python!")],
)
See the inline docstrings for the full list of helpers covering sessions, spaces, artifacts and file uploads.
Working with pages and blocks
from acontext import AcontextClient
client = AcontextClient(api_key="sk_project_token")
space = client.spaces.create()
try:
page = client.pages.create(space["id"], title="Kick-off Notes")
client.blocks.create(
space["id"],
parent_id=page["id"],
block_type="text",
title="First block",
props={"text": "Plan the sprint goals"},
)
finally:
client.close()
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
acontext-0.0.1.dev0.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acontext-0.0.1.dev0.tar.gz.
File metadata
- Download URL: acontext-0.0.1.dev0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0be20c86f2a8923c02315e1a269da97be5be73e2a0e5a6558c7eaccb33358c32
|
|
| MD5 |
0582b937b4f5f179e2d7f5fec31aa6c3
|
|
| BLAKE2b-256 |
03a36a81813b4efbd3308fb711907203922580aab2853a3d4a19622ecbb9f84e
|
File details
Details for the file acontext-0.0.1.dev0-py3-none-any.whl.
File metadata
- Download URL: acontext-0.0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de84f2fe226e9973e197053bd8af13eff018e3b0f12ad90b07681a3b6b452d87
|
|
| MD5 |
178c18478cc502c6c34fa80f6d2d6a46
|
|
| BLAKE2b-256 |
bd6382d043a58a9f4cfc1e9c717edbc33fc3b2d4bbe91435024fd96e1d7795ee
|