ModuleRecord
Handsdown API Index / Handsdown / AST Parser / Node Records / ModuleRecord
Auto-generated documentation for handsdown.ast_parser.node_records.module_record module.
ModuleRecord
Show source in module_record.py:20
Wrapper for an ast.Module
node with corresponding node info.
Responsible for parsing Python source as well.
Arguments
node
- Result ofast.parse
.
Signature
See also
ModuleRecord()._get_comment_docstring
Show source in module_record.py:218
Get comment docstring preceding the object from the source code.
Returns only lines starting with #
, lines joined with a single space.
Arguments
node_record
- Node record for source lookup.
Returns
A docstring as a string.
Signature
See also
ModuleRecord()._get_function_def_lines
Show source in module_record.py:195
Get all function definition lines for comment type hints lookup.
Removes indentation.
Arguments
function_record
- Function record for source lookup.
Returns
Function definition lines as an array.
Signature
See also
ModuleRecord().build_children
Show source in module_record.py:136
Collect full information about Module child records.
Used only when doc for this ModuleRecord is building.
Signature
ModuleRecord.create_from_source
Show source in module_record.py:44
Create new ModuleRecord from path.
Arguments
source_path
- Path to a Python source file.import_string
- File absolute import string.encoding
- File encoding.
Returns
New ModuleRecord instance.
Signature
@classmethod
def create_from_source(
cls, source_path: Path, import_string: ImportString, encoding: str = ENCODING
) -> "ModuleRecord":
...
See also
ModuleRecord().find_record
Show source in module_record.py:72
Find child in the Module by an absolute or relative import string.
Attributes
import_string
- record import string.
Returns
Found child record on None.
Signature
See also
ModuleRecord().get_related_import_strings
Show source in module_record.py:250
Get a set of related_names
found in module class, function, method and attribute records.
Returns
A set of absolute import strings found.
Signature
See also
ModuleRecord().is_init
Show source in module_record.py:280
Check if this module is the init.py file.
Returns
True if this module is the init.py file.
Signature
ModuleRecord().iter_records
Show source in module_record.py:91
Iterate over Module class, method and fucntion records.
Yields
A child record.