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.
Metadata
Release files for capturedit 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 | |
|---|---|---|---|
| capturedit-0.2.0.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capturedit-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.7 kB
Release files / capturedit-0.2.0.tar.gz
| Download URL | capturedit-0.2.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
045a5eeb91df766d8d30cd51f7ab4b306a80b6e43567c88f58b8f178461669d3
|
|
BLAKE2b-256 checksum How to use checksums |
21365af399f6a1f325f5f202d731bfad400be055e920eece62352ee4ef4ced36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / capturedit-0.2.0-py3-none-any.whl
| Download URL | capturedit-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c04dbeedb37ab28b120b16022d439287704a1f21fae09d58b7e0d95f837c26e
|
|
BLAKE2b-256 checksum How to use checksums |
efc899c406ddd3291c06f4899349e5c9506482c790698b002dbbb4dc38e416b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|