Skip to main content

derive types from other types to make it easier to type code!

Project description

build status pre-commit.ci status

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typing_derive-1.0.0-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2Python 3

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

Hashes for typing_derive-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ed90ffedb17ad301aa1ab422e9bfb74db13ccb1c311fb68be274a14353f3bce5
MD5 1a47ab00dda0e16789a6d9c01e4553a2
BLAKE2b-256 2da52c7a93ca2175a5e88bedfaa5f6b11410c1a002b17037b0213031f076349d

See more details on using hashes here.

File details

Details for the file typing_derive-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for typing_derive-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9226c061879efb0d603d3ae397dc03176a244fd66c871a3213b38a7859e350aa
MD5 93ed3c92a1c9b56ca51ddbe745bdf0f4
BLAKE2b-256 f670c0d06f0b56d3325e56f1e68b657f7d0356e48c6967d2f0b53fb37d3f2dfa

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