semvec/pypi-packages huggingface dataset:
acontext-py 0.0.1.dev2
Python SDK for the Acontext API
Requires Python: >=3.13
Keywords: acontext, sdk, client, api

## acontext client for python

Python SDK for interacting with the Acontext REST API.

### Installation

```bash
pip install acontext-py
```

> Requires Python 3.13 or newer.

### Quickstart

```python
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

```python
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()
```
toml-decouple 0.6.0
TOML powered .env file configuration and secrets
Requires Python: >=3.12

# TOML-decouple

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/blfpd/toml-decouple/publish.yaml)
![PyPI - Version](https://img.shields.io/pypi/v/toml-decouple)
![Pypi - Python Version](https://img.shields.io/badge/python-3.12%2B-blue)
![PyPI - Downloads](https://img.shields.io/pypi/dm/toml-decouple)
![License](https://img.shields.io/github/license/blfpd/toml-decouple)

## TOML powered .env file configuration and secrets

Package available in [PyPI](https://pypi.org/project/toml-decouple/).

## Getting Started

### Install the library

Using pip:
```sh
pip install toml-decouple
```

Using uv:
```sh
uv add toml-decouple
```

### Basic Usage

```toml
# my_project/.env
SECRET_KEY = "S3cre7"
DEBUG = true
DB = postgresql://USER:PASSWORD@HOST:PORT/NAME
```

```python
import dj_database_url
from toml_decouple import config

SECRET_KEY = config.SECRET_KEY
DEBUG = config("DEBUG", false)
DATABASES["default"] = config("DB", to=dj_database_url.parse)
```

Assuming this environment variable is set:
```sh
MY_PROJECT_DEBUG=true
```

Create your configuration dataclass and parse config and env into it:

```python
from dataclasses import dataclass
from toml_decouple import TomlDecouple

@dataclass
class Config:
    SECRET_KEY: str = ""
    DEBUG: bool = False

config: Config = TomlDecouple().load_dataclass(Config)
```

You can now access the fields of your fully typed config Class
that contains values from a TOML config file and the environment.

For example:

```python
SECRET_KEY = config.SECRET_KEY
DEBUG = config("DEBUG", False)
print(SECRET_KEY)  # prints "S3cre7"
print(DEBUG)  # prints True
print(config.DB)  # raise AttributeError: 'Config' object has no attribute 'DB'
```

## Configuration

To configure, you have to use `TomlDecouple(**options).load()`, like:

```python
from toml_decouple import TomlDecouple

config = TomlDecouple(
    env_files=[".env.docker"],
    secrets=["/run/secrets"],  # this is the default
    initial={"DEBUG": True}
    prefix="BACKEND_",  # to use env variables BACKEND_ENV_VAR=value
).load()
```

## Tests

Run tests from the project root with:
```sh
make test
```

## Issues

Feel free to send issues or suggestions to https://github.com/blfpd/toml-decouple/issues.