Metadata-Version: 2.1
Name: typing_derive
Version: 1.0.0
Summary: derive types from other types to make it easier to type code!
Home-page: https://github.com/asottile/typing-derive
Author: Anthony Sottile
Author-email: asottile@umich.edu
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mypy

[![build status](https://github.com/asottile/typing-derive/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/typing-derive/actions/workflows/main.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/typing-derive/main.svg)](https://results.pre-commit.ci/latest/github/asottile/typing-derive/main)

typing-derive
=============

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

## Installation

```bash
pip install typing-derive
```

## usage

add as a mypy plugin

```ini
[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

```python
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)
```
