papyri 0.0.8 Pypi GitHub

ParametersReturns
parse_script(script: 'str', ns: 'Dict', prev, config, *, where=None) -> 'Optional[List[Tuple[str, Optional[str]]]]'

Parameters

script : str

the script to tokenize and infer types on

ns : dict

Extra namespace to use with jedi's Interpreter. This will be used for implicit imports, for example that :None:None:`np` is interpreted as numpy.

: str

previous lines that lead to this.

where : <Insert Type here>

<Multiline Description Here>

config : <Insert Type here>

<Multiline Description Here>

Returns

List of tuples with:
text:

text of the token

reference : str

fully qualified name of the type of current token

Parse a script into tokens and use Jedi to infer the fully qualified names of each token.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /papyri/gen.py#189
type: <class 'function'>
Commit: