Module: Parsed Source Module#
- class arch.code.Module.Module(*, sig='', doc=<factory>, code=<factory>, lang=Lang.PY, indent=0, annotations=<factory>, name='', args=<factory>, type='', members=<factory>, initial=<factory>, private=<factory>, primary=<factory>, public=<factory>)#
A parsed class body, split into the standard architectonic method sections.
- classmethod new(*, sig='', name='', code='', lang=Lang.PY, **kwargs)#
Build a module from a class signature and body, splitting the body by section banners.
- render_section(section)#
Render the given section (by symbol or name) below its comment banner.
- property sections#
Return the (name, buffer) pairs for every section, in canonical order.
- render()#
Render the signature, and the docstring plus every section as the code.
- parse_methods()#
Parse the methods in every section.
- Returns:
A mapping of section symbol to the method blocks found in that section.
- parse_doc()#
Split this module’s docstring into title/division and body.
A strict ``
idx: DIVISION NOUN `` header is preferred; when it does not match, the first non-empty line is treated as the title and the remainder as the body.
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].