astToolkit 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/PKG-INFO +1 -1
- asttoolkit-0.3.3/astToolkit/__init__.py +72 -0
- asttoolkit-0.3.3/astToolkit/_joinClassmethod.py +1260 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_theSSOT.py +1 -1
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolkitAST.py +0 -45
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/transformationTools.py +25 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit.egg-info/PKG-INFO +1 -1
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit.egg-info/SOURCES.txt +3 -8
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit.egg-info/top_level.txt +0 -1
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/pyproject.toml +1 -1
- asttoolkit-0.3.3/tests/test_joinClassmethod.py +119 -0
- asttoolkit-0.3.2/astToolkit/__init__.py +0 -37
- asttoolkit-0.3.2/toolFactory/Z0Z_hardcoded.py +0 -135
- asttoolkit-0.3.2/toolFactory/__init__.py +0 -31
- asttoolkit-0.3.2/toolFactory/_snippets.py +0 -16
- asttoolkit-0.3.2/toolFactory/datacenter.py +0 -251
- asttoolkit-0.3.2/toolFactory/docstrings.py +0 -106
- asttoolkit-0.3.2/toolFactory/factory3.py +0 -603
- asttoolkit-0.3.2/toolFactory/factory_annex.py +0 -66
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/LICENSE +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/README.md +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_astTypes.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolBe.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolClassIsAndAttribute.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolDOT.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolGrab.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolIfThis.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolMake.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolThen.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolkitContainers.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_toolkitNodeVisitor.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/_types.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit/py.typed +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit.egg-info/dependency_links.txt +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/astToolkit.egg-info/requires.txt +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/setup.cfg +0 -0
- /asttoolkit-0.3.2/toolFactory/py.typed → /asttoolkit-0.3.3/tests/conftest.py +0 -0
- {asttoolkit-0.3.2 → asttoolkit-0.3.3}/tests/test_basic.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: astToolkit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: A powerfully composable, type-safe toolkit for Python abstract syntax tree (AST) manipulation, analysis, transformation, and code generation with a layered architecture designed for building sophisticated code processing assembly-lines.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AST Toolkit for Python - A comprehensive utility library for AST manipulation and transformation
|
|
3
|
+
|
|
4
|
+
The astToolkit package provides a powerful set of tools for working with Python's Abstract Syntax Tree (AST),
|
|
5
|
+
enabling sophisticated code analysis, transformation, and generation. The toolkit is designed around a
|
|
6
|
+
composable architecture with specialized modules for different aspects of AST manipulation:
|
|
7
|
+
|
|
8
|
+
Core Components:
|
|
9
|
+
- NodeTourist/NodeChanger: AST traversal and transformation engines
|
|
10
|
+
- Make: Factory methods for creating AST nodes with clean semantics
|
|
11
|
+
- IfThis/Then: Predicate-based node matching and transformation
|
|
12
|
+
- IngredientsFunction/IngredientsModule: Containers for storing code components with dependencies
|
|
13
|
+
|
|
14
|
+
Tool Categories:
|
|
15
|
+
- Antecedents: Be, ClassIsAndAttribute, IfThis
|
|
16
|
+
- Actions: Make, Then
|
|
17
|
+
- Modify antecedents and actions: DOT, Grab
|
|
18
|
+
- AST Organization: LedgerOfImports - Manage import statements
|
|
19
|
+
- Code Generation: extractFunctionDef, parseLogicalPath2astModule - Extract and parse code
|
|
20
|
+
|
|
21
|
+
The toolkit enables developers to perform complex AST operations with semantically clear code,
|
|
22
|
+
maintaining type safety and providing a declarative approach to code transformation.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from astToolkit._astTypes import * # noqa: F403
|
|
26
|
+
|
|
27
|
+
from astToolkit._types import (
|
|
28
|
+
str_nameDOTname as str_nameDOTname,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
from astToolkit._toolkitNodeVisitor import (
|
|
32
|
+
NodeChanger as NodeChanger,
|
|
33
|
+
NodeTourist as NodeTourist,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
from astToolkit._toolBe import Be as Be
|
|
37
|
+
from astToolkit._toolClassIsAndAttribute import ClassIsAndAttribute as ClassIsAndAttribute
|
|
38
|
+
from astToolkit._toolDOT import DOT as DOT
|
|
39
|
+
from astToolkit._toolGrab import Grab as Grab
|
|
40
|
+
from astToolkit._toolMake import Make as Make
|
|
41
|
+
from astToolkit._joinClassmethod import (
|
|
42
|
+
Add as Add,
|
|
43
|
+
BitAnd as BitAnd,
|
|
44
|
+
BitOr as BitOr,
|
|
45
|
+
BitXor as BitXor,
|
|
46
|
+
Div as Div,
|
|
47
|
+
FloorDiv as FloorDiv,
|
|
48
|
+
LShift as LShift,
|
|
49
|
+
MatMult as MatMult,
|
|
50
|
+
Mod as Mod,
|
|
51
|
+
Mult as Mult,
|
|
52
|
+
Pow as Pow,
|
|
53
|
+
RShift as RShift,
|
|
54
|
+
Sub as Sub,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
from astToolkit._toolIfThis import IfThis as IfThis
|
|
58
|
+
from astToolkit._toolThen import Then as Then
|
|
59
|
+
|
|
60
|
+
from astToolkit._toolkitContainers import (
|
|
61
|
+
IngredientsFunction as IngredientsFunction,
|
|
62
|
+
IngredientsModule as IngredientsModule,
|
|
63
|
+
LedgerOfImports as LedgerOfImports,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
from astToolkit._toolkitAST import (
|
|
67
|
+
astModuleToIngredientsFunction as astModuleToIngredientsFunction,
|
|
68
|
+
extractClassDef as extractClassDef,
|
|
69
|
+
extractFunctionDef as extractFunctionDef,
|
|
70
|
+
parseLogicalPath2astModule as parseLogicalPath2astModule,
|
|
71
|
+
parsePathFilename2astModule as parsePathFilename2astModule,
|
|
72
|
+
)
|