Skip to main content

Typed Core

Shared core types and utilities for Typed Clients

PyPI version License

Every Typed Client builds its core on top of this package. Prefer it over a client-local copy of the same logic — a client's own core/ should hold only what's genuinely venue-specific (envelope extraction, error mapping, signing, wire quirks), not a reimplementation of transport, timestamps, or error types.

Installation

pip install typed-core

What it provides

module contents
typed_core.exceptions Error, NetworkError, ValidationError, ApiError (BadRequest, AuthError, RateLimited), LogicError
typed_core.http async HTTP client and response helpers
typed_core.ws websocket socket, streams, JSON-RPC, streams-over-RPC
typed_core.times TimeConverter, EpochConverter, IsoConverter — parse/dump between a venue's wire timestamp and a real datetime
typed_core.util RateLimit, paging and stream helpers
from typed_core.times import EpochConverter, IsoConverter

timestamp_millis = EpochConverter.milliseconds()  # epoch, milliseconds
timestamp_iso = IsoConverter()                    # RFC 3339, Z-suffixed

A wire value carrying no offset is read as UTC, matching what dump already assumes of a naive datetime; pass tz=None to keep it naive instead. Every converter raises ValueError on a value of the wrong kind, so a null on a non-nullable field arrives as an ordinary validation error rather than an AttributeError.

Paging

Every generated <method>_paged returns a PaginatedResponse: awaitable (every row, flattened) and async-iterable (one page of rows at a time). Each page is one pure next(state) call, so a caller can retry or resume a single page rather than the whole walk.

from typed_core import PaginatedResponse

paging = client.market.kline_paged(symbol='BTCUSDT', interval='1', start=start, end=end)
candles = await paging                       # every row, flattened
async for rows in paging: ...                # one page at a time
async for page in paging.pages():            # Page(rows, state, next), for checkpointing
  checkpoint(page.next)
paging.resume(saved_state)                   # restart from a checkpointed state
paging.via(retried)                          # route every page fetch through a middleware

via(call) hands each page fetch to call as one zero-argument coroutine function, so a retry or logging layer wraps a page without unrolling the loop by hand.

Clients re-export the exceptions users are expected to catch from their own package root, so from kraken import AuthError works while implementation imports still come from typed_core. Route those re-exports through lazy_loader.attach_stub, not a plain from typed_core.exceptions import ... in an __init__.py — the latter breaks type-checking for every downstream consumer of a py.typed package.

License

MIT — see LICENSE.

Release files for typed-core 0.8.1

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

Source distribution (sdist)

Source distribution for typed-core 0.8.1
File Size Uploaded
typed_core-0.8.1.tar.gz 32.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typed-core 0.8.1
File Interpreter ABI Platform
typed_core-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.7 kB

Release files / typed_core-0.8.1.tar.gz

Download URL typed_core-0.8.1.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6f68a8ab6ff3937e2a7bbcb38e4e9da17d659874206d4cbd11f1aa0840454246
BLAKE2b-256 checksum
How to use checksums
e46ce2069949b3ea08c5fbf8e721ab55bdb785d71d32165116b82be49b2e6e86
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 Sep 10, 2026.

Transparency log

Release files / typed_core-0.8.1-py3-none-any.whl

Download URL typed_core-0.8.1-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c15ce93177eb0a78405723d72a7a1c3377e830d95e8921641d669232852389f6
BLAKE2b-256 checksum
How to use checksums
2f05e976c0cd9c705cc5b64159353de2fd382ccefc58940e39acf3566cec2902
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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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