Skip to main content

Python SDK and CLI for the ctxd platform.

Project description

ctxd

Python SDK and CLI for the ctxd platform.

Install:

pip install ctxd

The SDK exposes sync and async clients:

  • Client
  • AsyncClient

Authentication:

  1. Preferred for headless and scripts: create a user-bound API key through app.ctxd.dev
  2. For CLI automation, set CTXD_API_KEY
  3. ctxd login prompts for an API key interactively and stores it in plaintext in the ctxd config directory for future CLI and SDK usage
  4. ctxd status checks whether an API key is available from the active authentication source

CLI manual:

export CTXD_API_KEY=...       # Use env-based auth for this shell/session
ctxd --version                # Print the installed ctxd version
ctxd login                    # Prompt for an API key and store it
ctxd status                   # Check whether an API key is configured
ctxd install-app              # Open the app installation page
ctxd search "text:deployment"
ctxd search text:test application:slack
ctxd fetch doc-123
ctxd profile
ctxd logout                   # Remove the stored API key

CTXD_API_KEY does not require ctxd login. Commands such as ctxd search, ctxd fetch, and ctxd profile use the environment variable directly when it is set.

Example:

from ctxd import Client

client = Client(api_key="<api-key>")

results = client.search("text:deployment application:slack")
profile = client.get_profile()
document = client.fetch_document("doc-123")

API key example:

from ctxd import Client

client = Client(api_key="<api-key>")
results = client.search("text:deployment application:slack")

Async example:

from ctxd import AsyncClient

async with AsyncClient(api_key="<api-key>") as client:
    results = await client.search("text:deployment")

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

ctxd-0.1.13.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

ctxd-0.1.13-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ctxd-0.1.13.tar.gz.

File metadata

  • Download URL: ctxd-0.1.13.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctxd-0.1.13.tar.gz
Algorithm Hash digest
SHA256 133b5712e3dce42985fed682ee6190a2d2267fbb329da42dbbba2f880503cb2e
MD5 92445ce05496798cf31240a69003fab3
BLAKE2b-256 cb370c5930083cd8eb5aaabf95e904c32f69ce476c3bf3d56549db77d5548c7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctxd-0.1.13.tar.gz:

Publisher: ci.yaml on ctxd-dev/ctxd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ctxd-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: ctxd-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctxd-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 fecffe5b61da613fd925f4433658bd3b5a4b565089d8d0100164f6240f9b1fd8
MD5 9c86e21077862cdf87a52939f5720d10
BLAKE2b-256 c6477a3434fb5036300e2e796cb7aed91894977ff1fa8ea5efc67b052303960a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctxd-0.1.13-py3-none-any.whl:

Publisher: ci.yaml on ctxd-dev/ctxd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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