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

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.7.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 typed-core 0.7.0
File Size Uploaded
typed_core-0.7.0.tar.gz 27.2 kB Details

Built distribution (wheel)

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

Total release size: 54.3 kB

Release files / typed_core-0.7.0.tar.gz

Download URL typed_core-0.7.0.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3c143cdabb64e92f4a81adc2ea11bbdede64515b2f81699f649c0931754f1e31
BLAKE2b-256 checksum
How to use checksums
7287d7d191420a09e2a3782c586cae1f4ec3feab2711e25beeeb1f59a66d3cf2
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 6, 2026.

Transparency log

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

Download URL typed_core-0.7.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27aacaec3b97af2aad6baccf763fe9a881c110f6f2fc8cae53bd3d39aa6a312a
BLAKE2b-256 checksum
How to use checksums
431d9e0acfb916434344d049ecc6fdb77549647c3920096c37f8328a9ddae085
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 6, 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

0.8.1

2 release files

0.8.0

2 release files

This release

0.7.0 This release

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