(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
builtinsare 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typically-0.1.8.tar.gz.
File metadata
- Download URL: typically-0.1.8.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d58065f8ce5799109731387cbcb191065ac89ec699b685ae7abb06f5c145ab3
|
|
| MD5 |
9f126a856e277d360f7db36069944f54
|
|
| BLAKE2b-256 |
f7cf996a9fcdf5bb01040b3505cab9ddf1fbdbc04ee72b68711d2c3dfd1191f8
|
File details
Details for the file typically-0.1.8-py3-none-any.whl.
File metadata
- Download URL: typically-0.1.8-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c18d275299b971489e72084b4e8a2248716ec0d5ad25fbd7d3ce1a8adff5df9
|
|
| MD5 |
d0576a5dfb9d0fac86cd576d7a47a435
|
|
| BLAKE2b-256 |
74797962867a642d120120b483193beae76b53f53a8d361646c4f431efa1596d
|