Nuclino Python API Client
A Python client library for interacting with the Nuclino API. This library provides a clean, Pythonic interface to Nuclino's REST API, making it easy to manage workspaces, items, and collections programmatically.
Features
- Typed client methods and object models
- Support for core Nuclino API v0 resources
- Configurable client-side request throttling
- Structured exception hierarchy
- Convenient helper methods for common operations
- Support for items, collections, workspaces, teams, users, and files
- Cursor-based list endpoints via
limitandafter
Installation
pip install nuclino
Quick Start
from nuclino import NuclinoAPI
# Initialize the client
client = NuclinoAPI(api_key="your-api-key")
# Get items from a workspace
items = client.get_items(workspace_id="your-workspace-id")
# Create a new item
new_item = client.create_item(
workspace_id="your-workspace-id",
title="My New Item",
content="This is the content of my new item"
)
# Update an item
updated_item = client.update_item(
item_id="your-item-id",
title="Updated Title",
content="Updated content"
)
# Delete an item
client.delete_item("your-item-id")
Features in Detail
Items and Collections
The library supports all operations on both items and collections:
- Create, read, update, and delete items
- Create, read, update, and delete collections
- Organize items within collections
- Manage item content and metadata
Error Handling
The library provides detailed error handling with specific exception classes:
NuclinoAuthenticationError: Authentication failuresNuclinoPermissionError: Permission-related issuesNuclinoValidationError: Invalid request parametersNuclinoNotFoundError: Resource not foundNuclinoRateLimitError: Rate limit exceededNuclinoTimeoutError: Request timed outNuclinoServerError: Server-side errors
Rate Limiting
Built-in rate limiting support helps prevent API quota exhaustion:
- Automatic client-side request throttling
- Automatic retry handling for rate-limit responses
- Configurable requests per minute limit
Type Safety
The library exposes typed client methods and model objects:
- Public methods have return type annotations
- Models preserve the raw API payload while exposing Python-style attribute access
- Support for IDE autocompletion
- Checked with mypy in CI
API Reference
Main Client
class NuclinoAPI:
def __init__(
self,
api_key: str,
base_url: str = "https://api.nuclino.com/v0",
requests_per_minute: int = 140,
timeout: float = 30.0,
rate_limit_retries: int = 3,
)
Item Operations
def get_items(
team_id: Optional[str] = None,
workspace_id: Optional[str] = None,
limit: Optional[int] = None,
after: Optional[str] = None
) -> List[Union[Item, Collection]]
def get_item(item_id: str) -> Union[Item, Collection]
def create_item(
workspace_id: Optional[str] = None,
parent_id: Optional[str] = None,
object: str = "item",
title: Optional[str] = None,
content: Optional[str] = None,
index: Optional[int] = None
) -> Union[Item, Collection]
def update_item(
item_id: str,
title: Optional[str] = None,
content: Optional[str] = None
) -> Union[Item, Collection]
def delete_item(item_id: str) -> BaseDeleteResponse
Collection Operations
def get_collection(collection_id: str) -> Collection
def create_collection(
workspace_id: Optional[str] = None,
parent_id: Optional[str] = None,
title: Optional[str] = None,
index: Optional[int] = None
) -> Collection
def update_collection(
collection_id: str,
title: Optional[str] = None
) -> Collection
def delete_collection(collection_id: str) -> BaseDeleteResponse
Error Handling
try:
client.get_item("non-existent-id")
except NuclinoNotFoundError:
print("Item not found")
except NuclinoAuthenticationError:
print("Invalid API key")
except NuclinoPermissionError:
print("Insufficient permissions")
except NuclinoRateLimitError as e:
print(f"Rate limit exceeded. Try again in {e.retry_after} seconds")
Development
uv sync --dev
uv run ruff check .
uv run mypy nuclino
uv run pytest
uv build
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- Built for the Nuclino API
- Inspired by modern Python API client design patterns
Metadata
Release files for nuclino 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nuclino-0.2.0.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nuclino-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.7 kB
Release files / nuclino-0.2.0.tar.gz
| Download URL | nuclino-0.2.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0155bb2501d45ddadf40fd4039f850ab9c502559690570ea81bb9c14abfa5610
|
|
BLAKE2b-256 checksum How to use checksums |
a60e1dbb1c6d61a8843c6588c7caae9dd19d21089b21292771f4abd2d3074800
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Release files / nuclino-0.2.0-py3-none-any.whl
| Download URL | nuclino-0.2.0-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c4f9b81c5cc581cf56cd1bf7acc2cc457042b1d22c4ce6422ec1c3a42fa7d0a
|
|
BLAKE2b-256 checksum How to use checksums |
bfb72be2fd1e7708c1e017f256df8dac25ed88cf24d856409351b44020de9ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|