Skip to main content

(UNSTABLE) Collection of common types.

Project description

typically

Overview

When adding comprehensive type annotations to python projects, you often have to choose where to import identical types.

For instance, you might want to use a TypedDict, so you would naturally import:

from typing import TypedDict

The issue is that now if you use your typed dictionary in a pydantic model, you will get an exception. This is because you actually "should have" imported:

from typing_extensions import TypedDict

This package is intended to create a single source of core types for python projects with very few required dependencies, and maybe at most a few optional ones (eg: pydantic).

Suggested pattern:

import typically as t

Installation

With pip:

pip install typically

Or with uv:

uv add typically

Notes

  • Type annotations really shouldn't impose any overhead. Of course, that's possible to avoid, but I'm still aiming to keep the extra import time less than 100 ms. The goal is (maybe) to pack as much commonly used stuff into a single import without incurring overhead.
  • All members of builtins are explicitly imported in the __init__ file,
  • Various type variables are included. These are always named T_... where the ellipses is the type the type variable is bound to, if any.

TODO

  • Implement paramspec objects for functools caching.
  • Add pydantic as submodule, as it imposes overhead and should be optional.
  • Add improved decimal type.

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

typically-0.1.6.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

typically-0.1.6-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file typically-0.1.6.tar.gz.

File metadata

  • Download URL: typically-0.1.6.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.4

File hashes

Hashes for typically-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5b7b6d00300432bbe689379798735603fbc25e481d72dbf4cb8d516d0eb0cafe
MD5 b44ebbbdc488b16841add6c8d699d17f
BLAKE2b-256 ea1d4626baf3befe268f4013ebcddc9b7daa8d47c8183bf4d4418aed63233bc1

See more details on using hashes here.

File details

Details for the file typically-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: typically-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.4

File hashes

Hashes for typically-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ccd54fd47c7664ce14f54a21cd2d462c2471c1815b69d8c78fb9c80ef63b632c
MD5 abb847114815a9c3060e6f4323c53d57
BLAKE2b-256 ae1c40380b5950bd29ef123c3859084c6c6eced6a8f22b27fc2acef68936b4c4

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