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.8.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.8.0
File Size Uploaded
respan_sdk-2.8.0.tar.gz 41.2 kB Details

Built distribution (wheel)

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

Total release size: 100.0 kB

Release files / respan_sdk-2.8.0.tar.gz

Download URL respan_sdk-2.8.0.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6fd908b838f134b7e48f52bb95a8c99df0e34e80149d3c60aaaa838b827b9d9f
BLAKE2b-256 checksum
How to use checksums
85dd7c81c55225aa1d62d93f328a446c91cbbed75c783a82e537dc514a0484f6
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 Oct 6, 2026.

Transparency log

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

Download URL respan_sdk-2.8.0-py3-none-any.whl
Size 58.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19e5d55400012ed845cb9c24744539f672c9ddbfb3735eac06796c514351b851
BLAKE2b-256 checksum
How to use checksums
6f0b05065d9c43d86d1705d3c3a5627fce8d99eb281ce02d076ada92b36ca81b
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 Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

2.9.0

2 release files

This release

2.8.0 This release

2 release files

2.7.6

2 release files

2.7.5

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.26

2 release files

2.6.25

2 release files

2.6.22

2 release files

2.6.21

2 release files

2.6.20

2 release files

2.6.19

2 release files

2.6.18

2 release files

2.6.17

2 release files

2.6.16

2 release files

2.6.15

2 release files

2.6.14

2 release files

2.6.13

2 release files

2.6.12

2 release files

2.6.11

2 release files

2.6.10

2 release files

2.6.9

2 release files

2.6.8

2 release files

2.6.7

2 release files

2.6.6

2 release files

2.6.5

2 release files

2.6.4

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

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