Skip to main content

Generated Python SDK for the Octospark public API.

Project description

octospark-sdk

PyPI version license

The official Python SDK for the Octospark 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.
  • 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

pip install octospark-sdk

Quick start

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

export OCTOSPARK_TOKEN="octo_live_..."
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:

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:

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

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

octospark_sdk-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

octospark_sdk-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file octospark_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: octospark_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for octospark_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4180780ee179b4acc7a2db642db2382bf42f8263fd963e610efe9e1991c2fb00
MD5 4f52f109101b48e6419b0f884b17f00f
BLAKE2b-256 4a13ee7a17bae418419add13f63e175b48f317f91a1ad04f7f3e069459ca4ade

See more details on using hashes here.

Provenance

The following attestation bundles were made for octospark_sdk-0.1.2.tar.gz:

Publisher: publish-python-sdk.yml on Just-Understanding-Data-Ltd/octospark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file octospark_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: octospark_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for octospark_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 50239d29a7b90c2806ae1db61018c80bdb705d7d99400eaaea7ebea72f2b8455
MD5 fd9bca71d0d9398d80fdbda6df5cc3ee
BLAKE2b-256 28f0adbf53941175707c1d7b4c13d042aef5c82687e33a5131547d4b38596322

See more details on using hashes here.

Provenance

The following attestation bundles were made for octospark_sdk-0.1.2-py3-none-any.whl:

Publisher: publish-python-sdk.yml on Just-Understanding-Data-Ltd/octospark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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