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

There's also types, collections, collections.abc, annotated_types, etc.

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, as sometimes one might like to override them, but also be able to access original builtin type.
  • 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.7.tar.gz (6.2 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.7-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for typically-0.1.7.tar.gz
Algorithm Hash digest
SHA256 2236bbb5adcae372e61ceabe82b8e4146611b7c2c4905d6efd269d2481feaa02
MD5 8781d1ad75b36e58be405c8d07a8dd46
BLAKE2b-256 1641c91b30fc5b694ca18aa1337e4f668b38060c2a6d70a08cbc07d1c74775a6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for typically-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b37e6950c1f7ee746115985cceaf9eb43dca0f520fe311b8d534a87eae2c484d
MD5 b90d8402a4e61af77428b6c8e17639c6
BLAKE2b-256 061b360f98c41d06b0f5753ed2471cb9b9a75fd1d822070e9e3f0a06676e873d

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