Metadata-Version: 2.4
Name: octospark-sdk
Version: 0.1.3
Summary: Generated Python SDK for the Octospark public API.
Project-URL: Homepage, https://docs.octospark.ai
Project-URL: Documentation, https://docs.octospark.ai/sdks
Project-URL: Repository, https://github.com/Just-Understanding-Data-Ltd/octospark
Project-URL: Issues, https://github.com/Just-Understanding-Data-Ltd/octospark/issues
Author: Octospark
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agent,api-client,automation,content-calendar,instagram,octospark,scheduling,scheduling tool,sdk,social media,social media scheduling tool,social-media,threads,tiktok,twitter,x,youtube
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# octospark-sdk

[![PyPI version](https://img.shields.io/pypi/v/octospark-sdk.svg)](https://pypi.org/project/octospark-sdk/)
[![license](https://img.shields.io/pypi/l/octospark-sdk.svg)](https://pypi.org/project/octospark-sdk/)

The official Python SDK for the [Octospark](https://docs.octospark.ai) public API.

- **A method for every operation.** Every public API operation is a client method, generated from the same OpenAPI document that powers the [API reference](https://docs.octospark.ai/api-reference/organizations/list-organizations).
- **Zero dependencies.** Built on the Python standard library; nothing else is installed with the package.
- **One error type.** Every non-2xx response raises `OctosparkApiError` with the HTTP status and parsed body.
- **Python 3.9+.**

## Install

```bash
pip install octospark-sdk
```

## Quick start

Create an API key in Octospark under **Organization settings, API Keys**, export it, and you are ready:

```bash
export OCTOSPARK_TOKEN="octo_live_..."
```

```python
import os

from octospark_sdk import OctosparkClient

octospark = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])

organizations = octospark.organizations_list_organizations(query={"limit": 1})
print(organizations["data"][0])
```

Full authentication guide: https://docs.octospark.ai/authentication

## A complete flow

Discover your organization, pick a team, and list its posts:

```python
import os

from octospark_sdk import OctosparkClient

octospark = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])

organizations = octospark.organizations_list_organizations(query={"limit": 1})
organization_id = organizations["data"][0]["id"]

teams = octospark.teams_list_teams(query={"organizationId": organization_id, "limit": 1})
team_id = teams["data"][0]["id"]

posts = octospark.social_list_posts(teamId=team_id, query={"limit": 10})
```

## Error handling

Every non-2xx response raises `OctosparkApiError`, carrying the HTTP `status` and the parsed response `body`:

```python
import os

from octospark_sdk import OctosparkApiError, OctosparkClient

octospark = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])

try:
    octospark.organizations_list_organizations(query={"limit": 1})
except OctosparkApiError as error:
    print(error.status, error.body)
```

## Custom base URL

The client defaults to `https://api.octospark.ai`. Pass `base_url` to the constructor to target a different Octospark API environment.

## Documentation

| Resource | Link |
| --- | --- |
| Get started | https://docs.octospark.ai/start |
| Authentication | https://docs.octospark.ai/authentication |
| SDKs | https://docs.octospark.ai/sdks |
| API reference | https://docs.octospark.ai/api-reference/organizations/list-organizations |
| OpenAPI document | https://docs.octospark.ai/openapi.json |

## License

MIT
