module documentation
Convert docspec objects to their pydocspec augmented version.
This converter is supposed to be fully compatible with docspec_python.
Usage:
import pydocspec from docspec_python import load_python_modules from pydocspec.converter import convert_docspec_modules root: pydocspec.TreeRoot = convert_docspec_modules(load_python_modules(...))
TODO: Converter should not crash when calling unstring_annotation or exract_expr.
| Function | back |
Convert a list of pydocspec.Module instances into a list of docspec.Module. This the reverse of convert_docspec_modules, this is useful to be able to dump modules to JSON using docspec.dump_module. |
| Function | convert |
Convert a list of docspec.Module instances into a list of pydocspec.Module. |
| Class | _ |
Converts pydocspec objects back to docspec in order to serialize them. |
| Class | _ |
Undocumented |
| Class | _ |
Converts docspec objects to their pydocspec augmented version. |
| Class | _ |
Visit each docspec objects of a module and create their pydocspec augmented counterparts. |
| Class | _ |
Undocumented |
| Class | _ |
Undocumented |
| Function | _get |
Undocumented |
| Function | _nest |
Reparent modules to their respective parent packages such that we have an actual hiearchy of packages. |
| Variable | _ |
Undocumented |
Convert a list of pydocspec.Module instances into a list of docspec.Module.
This the reverse of convert_docspec_modules, this is useful to be able to dump
modules to JSON using docspec.dump_module.
Example:
import json import docspec import pydocspec from pydocspec import converter root = pydocspec.load_python_modules(...) docspec_modules = converter.back_convert_modules(root.root_modules) raw_docspec_json = {'modules': []} for m in docspec_modules: raw_docspec_json['modules'].append(docspec.dump_module(m)) with open('~/.mysoftware/docspec_modules.json', 'w') as f: json.dump(raw_docspec_json, f)
| Parameters | |
modules:Sequence[ | Modules to convert back to docspec. |
| Returns | |
Sequence[ | Undocumented |
Convert a list of docspec.Module instances into a list of pydocspec.Module.
| Parameters | |
modules:Iterable[ | Modules to convert. |
options:Optional[ | Undocumented |
| Returns | |
pydocspec.TreeRoot | The TreeRoot instance. |
| Note | |
| It will transform the tree such that we have an actual hiearchy of packages. | |
Undocumented
| Parameters | |
relativeroots:Iterable[ | Undocumented |
name:dottedname.DottedName | Undocumented |
| Returns | |
Optional[ | Undocumented |
Reparent modules to their respective parent packages such that we have an actual hiearchy of packages.
| Parameters | |
modules:Iterable[ | Undocumented |
| Returns | |
List[ | Undocumented |