type-annotations-generator provides a function for generating type annotations for a object
Project description
type-annotations-generator
type-annotations-generator provides a function for generating type annotations. That can be useful if you work with a API which has a complex data structure. It supports PEP 585 and PEP 604.
import type_annotations_generator
data = {
"elements": [
{
"name": "foo",
"age": 42
}
],
"count": 1
}
print(type_annotations_generator.generate_annotations(data))
# Dict[str, Union[List[Dict[str, Union[str, int]]], int]]
print(type_annotations_generator.generate_annotations(data, pep_585=True))
# dict[str, Union[list[dict[str, Union[str, int]]], int]]
print(type_annotations_generator.generate_annotations(data, pep_585=True, pep_604=True))
# dict[str, list[dict[str, str | int]] | int]
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
Built Distribution
Close
Hashes for type-annotations-generator-1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d99158b92127586587becaff97129c9f2ab9c44676c429945275c3fd2cdfcc6 |
|
MD5 | 95ed89fe46ce64e5d6e39c9974ec9900 |
|
BLAKE2b-256 | ccb5119d76de6d3e106563f0c3c5a751eca8fc6276eebf2a1b5542749c320149 |
Close
Hashes for type_annotations_generator-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cceb7888c2673f35be89b5c38d87646c908a0fe54a048924110257f6058a1f1 |
|
MD5 | 2e409baac263ace7912c90ddb36cf83a |
|
BLAKE2b-256 | 248d550d7e2fe81871b8c6d627a2971f137e900f87cd57e3c7ed21916cf7e0ef |