Skip to main content

Respan SDK

respan.ai | Documentation | PyPI

Light weight library for Respan type definitions and API payload preprocessing

Features:

  • Definition of types, what data structure Respan expects to receive in API calls.
  • Preprocessing, separating Respan-specific parameters from LLM-specific parameters
  • Conversion, converting input types from Anthropic API format into OpenAI API format.
  • Filter types — typed vocabulary for the Respan filter system, shared across BE and SDKs.

For tracing, please go to Respan Tracing instead.

Filter Types

The SDK exports the full Respan filter vocabulary so every package (backend, tracing, exporters) uses the same typed definitions instead of raw dicts.

from respan_sdk import (
    # TypedDict versions (lightweight, no validation)
    FilterParamDict,      # Dict[str, MetricFilterParam | List[MetricFilterParam] | FilterBundle]
    MetricFilterParam,    # Single filter condition (operator + value)
    FilterBundle,         # Nested group with connector (AND/OR)

    # Pydantic versions (with validation)
    FilterParamDictPydantic,
    MetricFilterParamPydantic,
    FilterBundlePydantic,

    # Value type
    MetricFilterValueType,  # Union[str, int, float, bool, List[...]]
)

Operators — the full operator vocabulary available in operator field:

Category Operators
Equality "", "=", "==", "eq", "equals"
Negation "not", "not_in", "not_contains", "not_startswith", "not_endswith", "not_overlap"
Numeric "gt", "gte", "lt", "lte"
String "contains", "icontains", "startswith", "endswith", "ilike", "regex"
Membership "in", "overlap" (array field shares any value)
Null/Empty "isnull", "empty", "notEmpty", "not_empty"
JSON "has_key"
Search "trigram_word_similar", "full_text_search"

Example — filter spans by status:

export_filter: FilterParamDict = {
    "status_code": {"operator": "", "value": "ERROR"},
}

Example — numeric range:

export_filter: FilterParamDict = {
    "latency": {"operator": "gte", "value": 1000},
}

Example — nested bundle with OR:

export_filter: FilterParamDict = {
    "model": {"operator": "in", "value": ["gpt-4", "claude-3"]},
    "filter_bundle": {
        "connector": "OR",
        "filter_params": {
            "status_code": {"operator": "", "value": "ERROR"},
            "latency": {"operator": "gte", "value": 5000},
        },
    },
}

Metadata

Release files for respan-sdk 2.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-sdk 2.11.0
File Size Uploaded Provenance Actions
respan_sdk-2.11.0.tar.gz 41.4 kB With provenance Details for respan_sdk-2.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for respan-sdk 2.11.0
File Interpreter ABI Platform Actions
respan_sdk-2.11.0-py3-none-any.whl Python 3 none any Details for respan_sdk-2.11.0-py3-none-any.whl

Total release size: 100.4 kB

Release files / respan_sdk-2.11.0.tar.gz

Download URL respan_sdk-2.11.0.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d2812081cfc1374cff17a1636e6ac8859c9d4c25fc55981000d399aa76c55005
BLAKE2b-256 checksum
How to use checksums
66ff9730fd33d4dac4ba8af5eb3c4f820a47ce1a8a3ccc53d4c661eb09603d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / respan_sdk-2.11.0-py3-none-any.whl

Download URL respan_sdk-2.11.0-py3-none-any.whl
Size 59.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51c10f210c36ea88930e7fc03d633925fc0fc15d3888c659d39fa4fafaa53ceb
BLAKE2b-256 checksum
How to use checksums
ba0f243fb055feb44987b30e41bafc60b41ad703b68ed5b5ff3f89a38fffd0b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for respan-sdk 2.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for respan_sdk-2.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.11.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page