Source code for pyfileconf.io.file.load.parsers.kwargs
import ast
[docs]def extract_keywords_from_ast(node: ast.AST) -> dict:
ke = KeywordExtractor()
ke.visit(node)
return ke.kwargs
[docs]def extract_keywords_from_ast_by_name(node: ast.AST, name: str) -> dict:
ke = KeywordByNameExtractor(name)
ke.visit(node)
return ke.kwargs