Skip to main content

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, q, format, include_conversations) 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
ask(question, *, limit) Ask a question across your library
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)
  • Vault tier for full API access; Pro for read-only search

Publishing (maintainers)

PyPI project name: capturedit.

  1. First release (registers the project): from packages/sdk-python after tests:

    pip install build twine
    python -m build
    twine upload dist/*
    

    Use a PyPI API token with scope for this project.

  2. Ongoing CI: In PyPI → PublishingAdd 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 tag sdk-python/v0.1.0 (match pyproject.toml version).

  3. Version bumps: Edit version in pyproject.toml before each release.

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

capturedit-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

capturedit-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file capturedit-0.1.0.tar.gz.

File metadata

  • Download URL: capturedit-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for capturedit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7b297a3d4577f3472cee8e357033a806493dbed9a4e8a38d5674c85d33a97b3
MD5 0ca7e40e8e653f4ea1f0f2b10ff40dc4
BLAKE2b-256 a2647d39a98837f3c62f0a7940448b35562949bf8dcbe74182e28b2d696f34e8

See more details on using hashes here.

File details

Details for the file capturedit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: capturedit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for capturedit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b088170697c989034c8c516ee8e658de78c453decdf34ce5eb916db18bd43bcb
MD5 1359015eb02dbfe8ca9790ebdb7efbf4
BLAKE2b-256 09a222c61f443cf193c09ac53afd1480398f4a74900e90b011a6012305e5b472

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