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_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.2.tar.gz (14.3 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.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: teamver_sdk_core-0.1.2.tar.gz
  • Upload date:
  • Size: 14.3 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.2.tar.gz
Algorithm Hash digest
SHA256 dbf7465481dc53068bae50a737de454ad637a97fb4334538ff179aab8f8363be
MD5 691ed965e3a33d66a0a9078a54d5795f
BLAKE2b-256 6d94484f28a485cb1aab372402c929b4e3a4f8ea784fb5ad89d658a7a0af0c6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teamver_sdk_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f8ef371c03c7bbc708eafb68bc2214056c5e1c1bba42df053b38c96282b880a7
MD5 8fe69a416d248a306fac7818df47c6c0
BLAKE2b-256 a524cede596ecabe5f6b1ef503f6fdcd6dfb886cd3181873b601156dbfe17e13

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