Skip to main content

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]

Metadata

Release files for type-annotations-generator 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for type-annotations-generator 1.0
File Size Uploaded
type-annotations-generator-1.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for type-annotations-generator 1.0
File Interpreter ABI Platform
type_annotations_generator-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / type-annotations-generator-1.0.tar.gz

Download URL type-annotations-generator-1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7d99158b92127586587becaff97129c9f2ab9c44676c429945275c3fd2cdfcc6
BLAKE2b-256 checksum
How to use checksums
ccb5119d76de6d3e106563f0c3c5a751eca8fc6276eebf2a1b5542749c320149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / type_annotations_generator-1.0-py3-none-any.whl

Download URL type_annotations_generator-1.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cceb7888c2673f35be89b5c38d87646c908a0fe54a048924110257f6058a1f1
BLAKE2b-256 checksum
How to use checksums
248d550d7e2fe81871b8c6d627a2971f137e900f87cd57e3c7ed21916cf7e0ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page