Parse type strings into typing instances
Project description
Installation
You can install typestring-parser via pip from PyPI:
$ pip install typestring-parser
Usage
Use the parse function to convert type strings into typing instances:
>>> from typestring_parser import parse
>>>
>>> parse('int')
<class 'int'>
>>> parse('int or str')
typing.Union[int, str]
>>> parse('list of str or str')
typing.Union[typing.List[str], str]
>>> parse('list of (int, str)')
typing.List[typing.Tuple[int, str]]
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
typestring-parser-0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for typestring_parser-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3fa5a41b0503a19d4829e7930f2077fddf5447f5a4095cdca362738446fd3ea |
|
MD5 | 20a378303ed672067cf11ce942aae3ba |
|
BLAKE2b-256 | 0d0d488466822c77a9a7c6b8ea1009dc1365653f6614ca5cb456e576156c89e1 |