No project description provided
Project description
typeapi
Typeapi provides a stable and documented API to introspect Python typing
type hints.
Installation
$ pip install typeapi
Quickstart
import typing
import typeapi
print(typeapi.of(typing.Any)) # Type(object)
print(typeapi.of(typing.List)) # Type(list)
print(typeapi.of(typing.Mapping[str, int])) # Type(collections.abc.Mapping, (Type(str), Type(int)))
print(typeapi.of(typing.Union[str, int])) # Union(int, str)
print(typeapi.of(str | int)) # Union(int, str)
print(typeapi.of(str | int | None)) # Optional(Union[int, str])
print(typeapi.of(typing.Annotated[int, 42])) # Annotated(int, 42)
print(typeapi.of(typing.Annotated[int, 42])) # Annotated(int, 42)
print(typeapi.of('str', __name__)) # Type(str)
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
typeapi-0.1.0a3.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for typeapi-0.1.0a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f967454960101848b4f11d4a0aef8132a21853efaa7ce799a39b0fc13789131 |
|
MD5 | e07cbae0e4c848300dd98aba273b3f7c |
|
BLAKE2b-256 | ae40cda78ddfb2931aa3209a3f951946f787b84d326f5279a458eb0789a51a2c |