derive types from other types to make it easier to type code!
Project description
typing-derive
derive types from other types to make it easier to type code!
Installation
pip install typing-derive
usage
add as a mypy plugin
[mypy]
plugins = typing_derive.plugin
typing_derive.impl.typeddict_from_func
create a usable TypedDict from some callable. useful if you need to
dynamically build up **kwargs to call a function
from typing_derive.impl import typeddict_from_func
def f(x: int, y: str) -> None: ...
TD = typeddict_from('TD', f)
x: TD = {
'x': 1,
'y': 'hello hello',
}
f(**x)
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
typing_derive-1.0.0.tar.gz
(3.8 kB
view details)
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 typing_derive-1.0.0.tar.gz.
File metadata
- Download URL: typing_derive-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed90ffedb17ad301aa1ab422e9bfb74db13ccb1c311fb68be274a14353f3bce5
|
|
| MD5 |
1a47ab00dda0e16789a6d9c01e4553a2
|
|
| BLAKE2b-256 |
2da52c7a93ca2175a5e88bedfaa5f6b11410c1a002b17037b0213031f076349d
|
File details
Details for the file typing_derive-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: typing_derive-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9226c061879efb0d603d3ae397dc03176a244fd66c871a3213b38a7859e350aa
|
|
| MD5 |
93ed3c92a1c9b56ca51ddbe745bdf0f4
|
|
| BLAKE2b-256 |
f670c0d06f0b56d3325e56f1e68b657f7d0356e48c6967d2f0b53fb37d3f2dfa
|