Live API#
This API generates type hints and exports the results into a cache-based folder within this package. Once the type hints are generated, this information becomes instantly available for IDEs and type checkers. Unless the cache-based folder is deleted, the generated type information can be reused at any time.
For more details on fine-tuning the type information, see Configuration.
How to use it?#
Input data to be hinted can be provided either as a Python object or from a YAML file:
Keep in mind that when information is loaded from a YAML file, comments starting with
#
are parsed and used as docstrings for the corresponding data structures.
What are some of its potential use-cases?#
This is ideal for data exploratory analysis when the structure of the given data is not well-defined. The corresponding type information can be interpreted by the IDE, which will provide additional functionalities such as autocompletion.
How does it work?#
When the Live API
is used:
- The type information is generated just like with the
Standard API
. This type is identified by the literal provided inclass_name
. - The type information is stored in a temporary folder within the library's directory.
- Stub-based files (
*.pyi
) are generated to overwrite the original interface and return a new type when theclass_name
matches the given identifier.
How can I reset the cache-based folder?#
It is as simple as doing:
This will remove all cached interfaces so far.