Skip to main content

Python SDK for the Skope API

Project description

Skope SDK

A Python SDK for interacting with the Skope API.

Installation

pip install skope-sdk

Usage

from skope_sdk import SkopeClient, Item

# Initialize the client
client = SkopeClient(
    api_key="your_api_key_here",
    base_url="https://api.skope.io"  # Optional, defaults to localhost:8000
)

# Create a single item
item = Item(
    name="Example Item",
    url="https://example.com",
)

result = client.create_item(item)
print(f"Created item: {result}")

# Create multiple events
events = [
    Item(name="Item 1"),
    Item(name="Item 2")
]

results = client.create_items(items)
print(f"Created items: {results}")

Error Handling

The SDK will raise SkopeError if any API requests fail:

from skope_sdk import SkopeError

try:
    result = client.create_item(item)
except SkopeError as e:
    print(f"Failed to create item: {e}")

API Reference

SkopeClient

__init__(api_key: str, base_url: str = "http://localhost:8000")

Initialize a new Skope client.

  • api_key: Your Skope API key
  • base_url: The base URL of the Skope API (optional)

create_item(item: Item) -> Dict[str, Any]

Create a single item.

  • item: An Item object with the item details
  • Returns: The created item data

create_items(items: List[Item]) -> Dict[str, Any]

Create multiple items in one request.

  • items: A list of Item objects
  • Returns: The response data containing created items

Item

A dataclass representing an item in Skope.

Fields:

  • name: str (required)

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

skope_sdk-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

skope_sdk-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file skope_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: skope_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for skope_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 02a6525792fdcc0ee4d3d36297b125c09c2c0c71ac9ff7fb8441417779005485
MD5 8908b75eef5653c4d204b2e784b8e32b
BLAKE2b-256 df4c5ef9b55f33730cfb858318fb8d0a6914da5022333db451284d6de1b2672e

See more details on using hashes here.

File details

Details for the file skope_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: skope_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for skope_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b7f3240be852156a8c3eda6ec0db7d21e3c1d158c68729cd319f86a5cc59065
MD5 db0756de49838babf1778ea21c59cdbd
BLAKE2b-256 d6eea6184a9a3cb7b4cd9f9f009a5bd155e18a9e1007aaf10d04c44602ff3fd3

See more details on using hashes here.

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