A lightweight collection of typing helpers, aliases, protocols, and foundational type utilities for modern Python applications.
Project description
typal
A lightweight collection of reusable typing utilities for modern Python.
Overview
typal provides small, composable building blocks for Python type annotations.
It avoids type explosion and focuses on clarity, reuse, and native typing features.
Features
- Optional type helpers (
Opt[T]) - Functional type aliases (
Mapper,Predicate,Action) - Collection shortcuts (
Seq[T],List[T]) - Common type unions (
StrOrInt,PathOrStr, etc.) - Enum-aware type utilities
- Clean separation of typing concerns
Installation
Using uv:
uv add typal
Or pip:
pip install typal
Usage
Optionals
from typal.optionals import Opt
value: Opt[int] = None
Collections
from typal.collections import Seq
def process(items: Seq[str]) -> None:
...
Functional types
from typal.functional import Mapper, Predicate, Action
def transform(x: int) -> str:
return str(x)
m: Mapper[int, str] = transform
Unions
from typal.unions import StrOrInt, PathOrStr
def load(path: PathOrStr) -> StrOrInt:
...
Tuples
from typal.tuples import Pair, Triple
Point = Pair[float]
RGB = Triple[int]
Design Philosophy
typal follows these principles:
- Prefer native Python typing (
|,list[T],dict[K, V]) - Avoid combinatorial type explosion
- Provide reusable abstractions, not exhaustive aliases
- Keep the API small, predictable, and composable
Non-goals
typal does NOT aim to:
- Replace Python's built-in typing system
- Provide exhaustive pre-generated type variants
- Introduce framework-specific abstractions
- Replace domain models
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
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 typal-0.1.3.tar.gz.
File metadata
- Download URL: typal-0.1.3.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40b710e36166ec3b7506f4ec065af6a2deb61166f453e6852f851e77dd9c82cf
|
|
| MD5 |
aade7b1075bd1c0751e7b4367ce7b0c9
|
|
| BLAKE2b-256 |
f19e402bb2131cb53905da97fb50e80014f859e3f90b20a7b42a9a108085dc89
|
Provenance
The following attestation bundles were made for typal-0.1.3.tar.gz:
Publisher:
python-publish.yml on agrahub/typal-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typal-0.1.3.tar.gz -
Subject digest:
40b710e36166ec3b7506f4ec065af6a2deb61166f453e6852f851e77dd9c82cf - Sigstore transparency entry: 1573509514
- Sigstore integration time:
-
Permalink:
agrahub/typal-py@899e81646710ee9c75653d7b826281ef59da5b38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/agrahub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@899e81646710ee9c75653d7b826281ef59da5b38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file typal-0.1.3-py3-none-any.whl.
File metadata
- Download URL: typal-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b23e5ee32c9d09a7ce2d42660c2d87ea0a35f1cb758b04b5821a06a9495ceac
|
|
| MD5 |
24dfcd20af436f3478f1aa1a0de91c9b
|
|
| BLAKE2b-256 |
1dc1a577d410ee3c814a2ef09387c1d26ee3709427efe52c0f9ab8ceda21bbe2
|
Provenance
The following attestation bundles were made for typal-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on agrahub/typal-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typal-0.1.3-py3-none-any.whl -
Subject digest:
7b23e5ee32c9d09a7ce2d42660c2d87ea0a35f1cb758b04b5821a06a9495ceac - Sigstore transparency entry: 1573509527
- Sigstore integration time:
-
Permalink:
agrahub/typal-py@899e81646710ee9c75653d7b826281ef59da5b38 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/agrahub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@899e81646710ee9c75653d7b826281ef59da5b38 -
Trigger Event:
release
-
Statement type: