The astToolFactory manufactures what manufacturers manufacture: manufactured tools. These tools refactor code that refactors other code, creating a factory line where each factory specializes in factoring ast nodes into manageable factors.
Manufactured by design, the factory refactors legacy ast patterns, then re-manufactures them into refined factories. Each refactored component factors cleanly into the manufacturing process, where systematic factorization enables factory-grade manufacturing at manufacturing scale.
Every manufactured factory requires raw materials: ast.Module factories need manufactured ast.stmt statements, manufactured ast.FunctionDef factories need factored ast.arg arguments, and re-manufactured ast.Call factories demand specially manufactured ast.expr expressions. But manufacturing a factory means factoring in the manufacturing requirements when manufacturers manufacture ast.Attribute factories with factory-fresh attributes, ast.Subscript factories with subscripted manufacturing specs, and ast.BinOp factories with binary manufacturing operations between factored left nodes and refactored right nodes.
The astToolFactory manufactures manufacturing tools that manufacture the factories:
- astToolkit.Be factors whether manufactured ast.AST nodes factor as authentic ast.FunctionDef factories or refactored ast.ClassDef manufacturers
- astToolkit.DOT dots into factory-manufactured ast.AST attributes—manufacturing DOT.name() factories, factoring DOT.args() manufacturers, refactoring DOT.body() assembly lines
- astToolkit.Grab grabs manufactured ast.AST attributes to refactor their manufacturing—grab the factory-made ast.FunctionDef.name to re-manufacture its naming, grab the refactored ast.Call.args to factor different manufacturing arguments
- astToolkit.Make manufactures brand-new ast.AST factory nodes from raw manufacturing materials—manufacturing Make.FunctionDef() factories, factoring Make.Call() manufacturing calls, refactoring Make.Name() naming factories
Where ast.NodeVisitor visits but never refactors the manufacturing process, astToolkit.NodeTourist tours through manufactured ast trees, discovering ast.FunctionDef factories that manufacture functions, ast.ClassDef manufacturers that factory classes, ast.Call factories that manufacture callable refactorizations, and ast.Name manufacturers that factory naming conventions.
Where ast.NodeTransformer transforms through wholesale manufacturing replacements, astToolkit.NodeChanger refactors ast trees with surgical manufacturing precision—refactor this manufactured ast.Add into a factory-fresh ast.Sub, re-manufacture this ast.Constant value through controlled factorization, refactor this ast.Name identifier via systematic re-manufacturing, but preserve the original factory specifications for all other manufactured ast tree components.
From typeshed/stdlib/ast.pyi spring the manufacturing specifications: every ast.FunctionDef factory has a name that identifies its manufacturing purpose, args that factor into its manufacturing process, body statements that embody its factory operations. Every ast.Call factory has a func that functions as its manufactured callable, args that factor as manufacturing arguments, keywords that key their manufacturing words into the factory process. Every ast.Name factory has an id that identifies its manufactured purpose, a context that contextualizes its factory operations.
astToolFactory reads ast.pyi manufacturing blueprints to understand the ast manufacturing universe, then manufactures the factories that factory ast tools through systematic refactorization.
astToolkit manufacturing patterns follow the factor-refactor-manufacture pattern: factor ast nodes through manufactured predicates, then refactor those factored ast nodes with factory-grade manufacturing actions. The factorization process asks "does this manufactured ast.AST node factor as an authentic ast.FunctionDef factory?" and the refactoring process manufactures answers like "then factor-extract its manufactured ast.stmt body through systematic refactorization" or "then re-manufacture its str name via factory specifications" or "then completely refactor its manufacturing through wholesale factory replacement."
astToolkit.NodeTourist(Be.FunctionDef, Then.factorIt) tours for manufactured ast.FunctionDef nodes, then factors them through controlled refactorization. astToolkit.NodeChanger(Be.Call, Grab.funcAttribute(Refactor.systematically)) refactors ast.Call factories by grabbing their manufactured func attributes and re-manufacturing them through systematic factory processes.
The astToolFactory manufactures all the ast manufacturing that manufacturing-grade astToolkit requires:
- Manufactured ast.expr expressions and refactored ast.stmt statements
- Factory-grade ast.FunctionDef functions and manufactured ast.ClassDef classes
- Refactored ast.Call calls and factory-fresh ast.Name names
- Manufactured ast.BinOp operations and refactored ast.Constant constants
- Factory-specified ast.If conditions and manufactured ast.For loops
- Refactored ast.arg arguments and factory-grade ast.keyword keywords
- All 100+ manufactured ast node types that populate Python's factory-built ast.Module modules
astToolFactory manufactures astToolkit's tools that refactor Python's ast.AST abstract syntax trees through systematic manufacturing processes. Whether you need to factor ast trees, refactor ast nodes, manufacture ast data, or factory-build ast code, astToolkit's manufactured ast tools help you ast through industrial-grade manufacturing.