Official Python SDK for the CapturedIt Context Hub API
Project description
capturedit
Official Python SDK for the CapturedIt Context Hub API.
Install
pip install capturedit
Quick start
from capturedit import CapturedIt
client = CapturedIt(api_key="your_api_key")
# Search your library
results = client.search("machine learning")
for item in results.items:
print(item.title)
# Get context for an AI prompt
context = client.get_context(q="project roadmap", format="text")
# Save a new item
result = client.create_item(
"link",
title="Interesting article",
source_url="https://example.com/article",
)
print(f"Created item: {result.id}")
# Ask about a specific item
response = client.ask_about_item(result.id, question="Summarize this")
print(response.message)
Async usage
from capturedit import AsyncCapturedIt
async with AsyncCapturedIt(api_key="your_api_key") as client:
results = await client.search("machine learning")
for item in results.items:
print(item.title)
Configuration
client = CapturedIt(
api_key="your_api_key",
base_url="https://api.capturedit.app", # optional
timeout=30.0, # optional, seconds
)
Methods
| Method | Description |
|---|---|
get_capabilities() |
Returns plan tier and feature flags |
search(query, *, limit, offset) |
Full-text search over your items |
get_context(*, limit, offset, q, format, include_conversations, max_chars) |
Recent or query-relevant items for AI context |
create_item(type, *, title, content_text, source_url, is_private) |
Create a new item |
capture_file(filename, mime_type, content_base64, *, ...) |
Upload a file (base64) |
get_item(item_id, *, include) |
Get a single item with enrichments |
delete_item(item_id) |
Delete an item |
transcribe(audio_base64, *, mime_type) |
Speech-to-text (max 20MB decoded audio) |
ask(question) |
Ask a question across your library (uses your plan's ask quota) |
ask_about_item(item_id, *, question, preset) |
Ask about a specific item |
list_conversations(item_id, *, limit, offset) |
Paginated conversation history |
delete_conversations(item_id) |
Clear conversation history for an item |
Webhook verification
from capturedit import verify_webhook_signature
is_valid = verify_webhook_signature(
payload=request.body,
header=request.headers["X-CapturedIt-Signature"],
secret="your_webhook_secret",
)
Error handling
from capturedit import RateLimitError, AuthenticationError
try:
results = client.search("query")
except RateLimitError as e:
print(f"Retry after {e.retry_after} seconds")
except AuthenticationError:
print("Invalid API key")
Requirements
- Python 3.10+
- CapturedIt API key (create at Dashboard → Security)
- All plans can use the API from the app surfaces; a Vault plan unlocks full integrator access (
api_write) and the context endpoint.askis available on all plans within your monthly quota.
Publishing (maintainers)
PyPI project name: capturedit.
-
First release (registers the project): from
packages/sdk-pythonafter tests:pip install build twine python -m build twine upload dist/*
Use a PyPI API token with scope for this project.
-
Ongoing CI: In PyPI → Publishing → Add a trusted publisher → GitHub, point to this repository and workflow
.github/workflows/publish-sdk-pypi.yml. Then use Actions → Publish capturedit to PyPI or push tagsdk-python/v0.1.0(matchpyproject.tomlversion). -
Version bumps: Edit
versioninpyproject.tomlbefore each release.
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
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 capturedit-0.2.0.tar.gz.
File metadata
- Download URL: capturedit-0.2.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045a5eeb91df766d8d30cd51f7ab4b306a80b6e43567c88f58b8f178461669d3
|
|
| MD5 |
4cced10312518068ff899a36a3aff1b9
|
|
| BLAKE2b-256 |
21365af399f6a1f325f5f202d731bfad400be055e920eece62352ee4ef4ced36
|
File details
Details for the file capturedit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: capturedit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c04dbeedb37ab28b120b16022d439287704a1f21fae09d58b7e0d95f837c26e
|
|
| MD5 |
52340f0602ec58f1f718d844be578743
|
|
| BLAKE2b-256 |
efc899c406ddd3291c06f4899349e5c9506482c790698b002dbbb4dc38e416b9
|