pyfileconf.io.file.load.parsers package¶
Submodules¶
pyfileconf.io.file.load.parsers.assign module¶
-
class
pyfileconf.io.file.load.parsers.assign.
AssignmentByVarnameExtractor
(varname)[source]¶ Bases:
pyfileconf.io.file.load.parsers.assign.AssignmentExtractor
-
class
pyfileconf.io.file.load.parsers.assign.
AssignmentExtractor
[source]¶ Bases:
ast.NodeVisitor
-
pyfileconf.io.file.load.parsers.assign.
extract_assignment_from_ast_by_name
(module, name)[source]¶ - Return type
pyfileconf.io.file.load.parsers.base module¶
pyfileconf.io.file.load.parsers.collections module¶
-
class
pyfileconf.io.file.load.parsers.collections.
AstDictListConverter
(convert_str_values=False)[source]¶ Bases:
ast.NodeVisitor
-
pyfileconf.io.file.load.parsers.collections.
extract_collection_from_ast
(ast_node, convert_str_values=False)[source]¶
-
pyfileconf.io.file.load.parsers.collections.
extract_collections_from_ast
(ast_node, convert_str_values=False)[source]¶ returns a list of dicts or lists. Goes through ast, converting ast.Dict to dict and ast.List to list, leaving the rest intact. Returns a list of these created dicts and lists
- Args:
ast_node:
Returns:
pyfileconf.io.file.load.parsers.extname module¶
-
class
pyfileconf.io.file.load.parsers.extname.
NameExtractor
[source]¶ Bases:
ast.NodeVisitor
-
pyfileconf.io.file.load.parsers.extname.
extract_external_name_from_assign_value
(ast_node)[source]¶ Identifies the root part of an assignment value, so long as it is not builtin.
Examples from a import b
b -> ‘b’ b.attr -> ‘b’
import c
c.test -> ‘c’ c.thing.stuff -> ‘c’
‘abc’ -> None 123 -> None
- Args:
ast_node: should be ast form of the value of an assignment
Returns:
pyfileconf.io.file.load.parsers.fromdict module¶
pyfileconf.io.file.load.parsers.funcdef module¶
-
class
pyfileconf.io.file.load.parsers.funcdef.
FunctionDefinitionByNameExtractor
(func_name)[source]¶ Bases:
pyfileconf.io.file.load.parsers.funcdef.FunctionDefinitionExtractor
-
class
pyfileconf.io.file.load.parsers.funcdef.
FunctionDefinitionExtractor
[source]¶ Bases:
ast.NodeVisitor
-
class
pyfileconf.io.file.load.parsers.funcdef.
FunctionDefinitionOrClassInitByNameExtractor
(func_name)[source]¶ Bases:
pyfileconf.io.file.load.parsers.funcdef.FunctionDefinitionByNameExtractor
-
pyfileconf.io.file.load.parsers.funcdef.
extract_function_definition_from_ast_by_name
(module, name)[source]¶ - Return type
Optional
[FunctionDef
]
-
pyfileconf.io.file.load.parsers.funcdef.
extract_function_definition_or_class_init_from_ast_by_name
(module, name)[source]¶ - Return type
Optional
[FunctionDef
]
-
pyfileconf.io.file.load.parsers.funcdef.
extract_function_definitions_from_ast
(module)[source]¶ - Return type
List
[FunctionDef
]
pyfileconf.io.file.load.parsers.imp module¶
-
class
pyfileconf.io.file.load.parsers.imp.
ImportExtractor
[source]¶ Bases:
ast.NodeVisitor
-
pyfileconf.io.file.load.parsers.imp.
extract_imports_from_ast
(module)[source]¶ - Return type
ImportStatementContainer
pyfileconf.io.file.load.parsers.kwargs module¶
-
class
pyfileconf.io.file.load.parsers.kwargs.
KeywordByNameExtractor
(name)[source]¶ Bases:
pyfileconf.io.file.load.parsers.kwargs.KeywordExtractor
-
class
pyfileconf.io.file.load.parsers.kwargs.
KeywordExtractor
[source]¶ Bases:
ast.NodeVisitor