docstring_type_tag_checker - package to check the validity of docstrings type
This package contains the 'BaseDocstringType' class that helps analyse a type docstring. It is able to check if your type docstring format is correct and get the types used in the docstring.
Basic Use
You simply have to import the class and pass the docstring to it :
from docstring_type_tag_checker import BaseDocstringType
type_string = "dict[str, numpy.ndarray[int | float] | list[int | float]]"
the_instance = BaseDocstringType.get_type_object(type_string)
from this step, you can now check if the format is valid:
the_instance.is_valid()
>>> True
You can also get the string of the different types used in the docstring (primitve types are ignored)
the_instance.get_type_strings()
>>> {'numpy.ndarray'}
You can also get a representation of the structure of the docstring with the str function
str(the_instance)
>>> GENERIC[dict]
STRING str
UNION
GENERIC[numpy.ndarray]
UNION
STRING int
STRING float
GENERIC[list]
UNION
STRING int
STRING float
Release files for docstring-type-tag-checker 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docstring_type_tag_checker-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / docstring_type_tag_checker-1.0-py3-none-any.whl
| Download URL | docstring_type_tag_checker-1.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40365a85af4ed6943cbe7f2874a10fd326527f59a4d76bfe06f77d13eab6b6db
|
|
BLAKE2b-256 checksum How to use checksums |
88b479deb9f3f56c6ee59eda4df54c5a37a4269bdd19f908bae4511703143a0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.3
|