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 keybase_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
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
skope_sdk-0.1.0.tar.gz
(3.0 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 skope_sdk-0.1.0.tar.gz.
File metadata
- Download URL: skope_sdk-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd46e8d7ad0823d23684a176121ba472d332d68178baf32b9fceefab47461cf9
|
|
| MD5 |
0bfc3a17636d02647d1e265149d2d1ae
|
|
| BLAKE2b-256 |
1b14e2644af6685a3ca7a0379bbd0b4bdb21d990a91c295cb186163fe60cac61
|
File details
Details for the file skope_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: skope_sdk-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d5d487b81dbdd2ad77eff21c40b7c0ed2b683a6ee38b56b4831cfa6d5b0f5e2
|
|
| MD5 |
9b717c53a739946ba74231eaa01d68a1
|
|
| BLAKE2b-256 |
99ba0dfdd90c28efa84c96a66becbbf5e67818a39685646c8020de6732042d4d
|