Skip to main content

Shared core for Teamver SDKs: async transport, unified errors, retry, context, pagination, masking

Project description

teamver-sdk-core

Shared async HTTP core for Teamver Python SDKs: transport, unified errors, retry, request context, pagination, and secret masking.

Used by teamver-mail-agent, teamver-agent-sdk, and other Teamver packages.

변경 이력

일시 (KST) 변경 내용
2026-08-02 22:55 production API host defaults (defaults.py) 추가

Install

pip install teamver-sdk-core

Python ≥ 3.11.

Quick start

import asyncio
from teamver_sdk_core import (
    TeamverAsyncTransport,
    TransportConfig,
    RequestContext,
    TeamverSDKError,
)

async def main():
    config = TransportConfig(base_url="https://api.teamver.com", token="tv_ak_…")
    async with TeamverAsyncTransport(config) as transport:
        ctx = RequestContext(workspace_id="WS-…")
        try:
            resp = await transport.request("GET", "/api/v2/collab/channels", context=ctx)
            print(resp.json)
        except TeamverSDKError as exc:
            print(exc.code, exc.status_code, exc.request_id)

asyncio.run(main())

Features

Module Role
defaults Production API hosts: https://api.teamver.com, https://agent-api.teamver.com, https://mail-api.teamver.com
transport TeamverAsyncTransport — httpx async requests, retry, error normalization
errors TeamverSDKError tree + error_for_status / parse_error_body
retry RetryPolicy — safe retries (non-idempotent POST needs idempotency_key)
context RequestContextrequest_id / correlation_id
pagination cursor iterate_pages
masking mask tokens / Bearer / internal keys in logs

Default API hosts (SSOT)

Constant Host Used by
DEFAULT_CHANNEL_API_BASE / DEFAULT_MAIN_API_BASE https://api.teamver.com channel/Drive/DM, be-sdk, app-sdk
DEFAULT_AGENT_API_BASE https://agent-api.teamver.com agent-sdk jobs/heartbeat
DEFAULT_MAIL_API_BASE https://mail-api.teamver.com mail-agent, agent-sdk mail

No path suffix (/api, /v1). Override per package via env.

Error tree

TeamverSDKError
├─ ConfigurationError
├─ AuthenticationError        (401)
├─ AuthorizationError         (403)
├─ NotFoundError              (404)
├─ ConflictError              (409)
│  ├─ IdempotencyConflictError
│  └─ VersionConflictError
├─ RateLimitError             (429)
├─ TemporaryUnavailableError  (502/503/504)
└─ TransportError

Retry rules

  • Retried: transport failure, 429, 502, 503, 504
  • GET/HEAD/PUT/DELETE — treated as idempotent
  • POST/PATCH — retried only when idempotency_key is set

Documentation

Public docs: github.com/NeuralStudioKr/teamver-sdk-docs/tree/main/sdk-core

Development

pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

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

teamver_sdk_core-0.1.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

teamver_sdk_core-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file teamver_sdk_core-0.1.1.tar.gz.

File metadata

  • Download URL: teamver_sdk_core-0.1.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.9

File hashes

Hashes for teamver_sdk_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9174ce34b27ee0a8a714b37fa7a2460f997bc2e1efebc3a1ea72b0debce9dd6f
MD5 56425604ebf9caaaed8accaaa241a38b
BLAKE2b-256 eda3f12790bab57d7c608f606257379484fec313288bf8d97a9a84459dcd73c2

See more details on using hashes here.

File details

Details for the file teamver_sdk_core-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for teamver_sdk_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6693af1be7609797ab55bda19628cc62315e9974b6b4e1e515240c85906e62
MD5 89d931f5b2afac3f533e27ad19a02d3a
BLAKE2b-256 c63596f98ba52f1f768c5de339735429ace07fb42b72aee665a106effea869ff

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