Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / module
python_parser
codeintel.parsers.python_parser
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| _docstring | python_parser.py | same file |
| _Extractor | python_parser.py | same file |
| _resolve_relative | python_parser.py | same file |
| _signature | python_parser.py | same file |
| _start_line | python_parser.py | same file |
| module_path_for | python_parser.py | same file |
| parse_python | python_parser.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| base | base.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| parsers | __init__.py | through an import |
codeintel.parsers.python_parserbackend/app/codeintel/parsers/python_parser.py, lines 1–40Open source
"""Python symbol extraction with the standard-library ``ast`` module."""from __future__ import annotationsimport astfrom .base import ( MAX_DOCSTRING_CHARS, MAX_SIGNATURE_CHARS, ParseResult, Symbol, clip,)def module_path_for(path: str) -> str: """``pkg/sub/mod.py`` -> ``pkg.sub.mod``; ``pkg/__init__.py`` -> ``pkg``. A leading ``src/`` (the PyPA "src layout") is not part of the import path: ``src/flask/app.py`` is ``flask.app``, which is also what other files import, so call/import resolution can match it. """ parts = path.split("/") if len(parts) > 2 and parts[0] == "src": parts = parts[1:] last = parts[-1] for suffix in (".pyi", ".py"): if last.endswith(suffix): last = last[: -len(suffix)] break parts[-1] = last if parts[-1] == "__init__": parts = parts[:-1] return ".".join(p for p in parts if p)def _resolve_relative(module_path: str, is_package: bool, level: int, module: str | None) -> str: """Absolute module name for ``from <level dots><module> import …``.""" base = module_path.split(".") if module_path else [] # For a module, level 1 means "my package" (drop the module itself);Shows the first 40 of 225 lines. The rest is on GitHub at this commit.
What the index recorded
- Signature
module backend.app.codeintel.parsers.python_parser- File
backend/app/codeintel/parsers/python_parser.py- Lines
- 1–225
- Parser
- python-ast
- Git blob
63495bcda67d5742151d40ab76540e513f44e088- Outside this subset
- 1 more edges reach code outside the graph shown here
