simplibs-extractor-python 0.1.0__py3-none-any.whl
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.
- simplibs/extractor_python/__init__.py +67 -0
- simplibs/extractor_python/actions/PythonOutline.py +23 -0
- simplibs/extractor_python/actions/RemovePythonComments.py +22 -0
- simplibs/extractor_python/actions/RemovePythonDecorators.py +22 -0
- simplibs/extractor_python/actions/RemovePythonDocstrings.py +22 -0
- simplibs/extractor_python/actions/RemovePythonImports.py +22 -0
- simplibs/extractor_python/actions/__init__.py +45 -0
- simplibs/extractor_python/annotations/OnError.py +25 -0
- simplibs/extractor_python/annotations/__init__.py +18 -0
- simplibs/extractor_python/constants/PYTHON_CONFIG_NAMES.py +27 -0
- simplibs/extractor_python/constants/PYTHON_OUTPUT_DIR_NAMES.py +19 -0
- simplibs/extractor_python/constants/PYTHON_SUFFIXES.py +17 -0
- simplibs/extractor_python/constants/PYTHON_TEST_DIR_NAMES.py +18 -0
- simplibs/extractor_python/constants/PYTHON_VENV_DIR_NAMES.py +18 -0
- simplibs/extractor_python/constants/__init__.py +26 -0
- simplibs/extractor_python/file_rules/__init__.py +62 -0
- simplibs/extractor_python/file_rules/atomic/DOT_NAME.py +19 -0
- simplibs/extractor_python/file_rules/atomic/INIT_NAME.py +17 -0
- simplibs/extractor_python/file_rules/atomic/IN_DUNDER_DIR.py +16 -0
- simplibs/extractor_python/file_rules/atomic/MAIN_NAME.py +16 -0
- simplibs/extractor_python/file_rules/atomic/OUTPUT_DIRS.py +17 -0
- simplibs/extractor_python/file_rules/atomic/VCS_DIRS.py +26 -0
- simplibs/extractor_python/file_rules/atomic/VENV_DIRS.py +18 -0
- simplibs/extractor_python/file_rules/atomic/__init__.py +30 -0
- simplibs/extractor_python/file_rules/python/PYTHON_BASE.py +17 -0
- simplibs/extractor_python/file_rules/python/PYTHON_CONFIG.py +18 -0
- simplibs/extractor_python/file_rules/python/PYTHON_STRICT_EXCLUDE.py +24 -0
- simplibs/extractor_python/file_rules/python/PYTHON_TESTS.py +29 -0
- simplibs/extractor_python/file_rules/python/__init__.py +22 -0
- simplibs/extractor_python/file_rules/python/build_python_base.py +58 -0
- simplibs/extractor_python/logic/__init__.py +32 -0
- simplibs/extractor_python/logic/_helpers/SourceOffsets.py +82 -0
- simplibs/extractor_python/logic/_helpers/__init__.py +36 -0
- simplibs/extractor_python/logic/_helpers/collect_definitions.py +60 -0
- simplibs/extractor_python/logic/_helpers/cut_statements.py +126 -0
- simplibs/extractor_python/logic/_helpers/describe_source_failure.py +34 -0
- simplibs/extractor_python/logic/_helpers/find_decorator_spans.py +107 -0
- simplibs/extractor_python/logic/_helpers/find_docstrings.py +46 -0
- simplibs/extractor_python/logic/_helpers/find_imports.py +33 -0
- simplibs/extractor_python/logic/_helpers/first_doc_line.py +37 -0
- simplibs/extractor_python/logic/_helpers/format_type_params.py +29 -0
- simplibs/extractor_python/logic/_helpers/guarded_parse.py +64 -0
- simplibs/extractor_python/logic/_helpers/outline_node.py +72 -0
- simplibs/extractor_python/logic/_helpers/parse_python.py +32 -0
- simplibs/extractor_python/logic/_validations/__init__.py +14 -0
- simplibs/extractor_python/logic/_validations/raise_python_source_error.py +55 -0
- simplibs/extractor_python/logic/python_comment_spans.py +73 -0
- simplibs/extractor_python/logic/python_outline.py +63 -0
- simplibs/extractor_python/logic/remove_python_comments.py +44 -0
- simplibs/extractor_python/logic/remove_python_decorators.py +48 -0
- simplibs/extractor_python/logic/remove_python_docstrings.py +50 -0
- simplibs/extractor_python/logic/remove_python_imports.py +48 -0
- simplibs/extractor_python/plugin/__init__.py +14 -0
- simplibs/extractor_python/plugin/register_all.py +45 -0
- simplibs/extractor_python/presets/PYTHON_CLEAN.py +29 -0
- simplibs/extractor_python/presets/PYTHON_NO_IMPORTS.py +32 -0
- simplibs/extractor_python/presets/__init__.py +30 -0
- simplibs/extractor_python/profiles/PYTHON_CODE_CLEAN.py +29 -0
- simplibs/extractor_python/profiles/PYTHON_CODE_NO_IMPORTS.py +29 -0
- simplibs/extractor_python/profiles/PYTHON_DATA_ALL.py +26 -0
- simplibs/extractor_python/profiles/PYTHON_OUTLINE.py +30 -0
- simplibs/extractor_python/profiles/PYTHON_PROFILES.py +26 -0
- simplibs/extractor_python/profiles/PYTHON_SRC_CLEAN.py +30 -0
- simplibs/extractor_python/profiles/__init__.py +47 -0
- simplibs/extractor_python/py.typed +1 -0
- simplibs_extractor_python-0.1.0.dist-info/METADATA +457 -0
- simplibs_extractor_python-0.1.0.dist-info/RECORD +71 -0
- simplibs_extractor_python-0.1.0.dist-info/WHEEL +5 -0
- simplibs_extractor_python-0.1.0.dist-info/entry_points.txt +2 -0
- simplibs_extractor_python-0.1.0.dist-info/licenses/LICENSE +21 -0
- simplibs_extractor_python-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simplibs-extractor-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The Python add-on of simplibs-extractor: file rules for Python projects, steps that remove comments, docstrings, imports and decorators (found with ast and tokenize, never with a regex), an outline step and five ready profiles.
|
|
5
|
+
Author-email: "Dalibor Sova (Sudip2708)" <daliborsova@seznam.cz>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/simplibs/simplibs-extractor-python
|
|
8
|
+
Project-URL: Repository, https://github.com/simplibs/simplibs-extractor-python
|
|
9
|
+
Project-URL: Issues, https://github.com/simplibs/simplibs-extractor-python/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/simplibs/simplibs-extractor-python/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: extractor,python,code-extractor,project-to-text,ast,tokenize,comments,docstrings,outline,markdown,llm,context,plugin,simplibs,simplibs-extractor,developer-tools
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: simplibs-extractor>=0.2.0
|
|
26
|
+
Requires-Dist: simplibs-text>=0.2.0
|
|
27
|
+
Requires-Dist: simplibs-actions>=0.2.2
|
|
28
|
+
Requires-Dist: simplibs-path>=0.2.0
|
|
29
|
+
Requires-Dist: simplibs-rules>=0.4.0
|
|
30
|
+
Requires-Dist: simplibs-validate>=0.3.2
|
|
31
|
+
Requires-Dist: simplibs-exception>=1.1.4
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=9.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# 🐍 `simplibs-extractor-python`
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/simplibs-extractor-python/)
|
|
40
|
+
[](https://www.python.org/downloads/)
|
|
41
|
+
[](https://github.com/simplibs/simplibs-extractor-python/blob/main/LICENSE)
|
|
42
|
+
[](https://github.com/simplibs/simplibs-extractor-python/actions)
|
|
43
|
+
|
|
44
|
+
**A Python project in one document — the code, with or without its paperwork.**
|
|
45
|
+
|
|
46
|
+
The Python add-on of [`simplibs-extractor`](https://pypi.org/project/simplibs-extractor/). The extractor gathers the
|
|
47
|
+
text files of a folder into one document and knows **no language**; this library teaches it Python: which files are
|
|
48
|
+
worth reading, how to take **comments, docstrings, imports and decorators** out of a source, how to write an
|
|
49
|
+
**outline** of its classes and functions, and five ready **profiles** that put it together. Python is read with `ast`
|
|
50
|
+
and `tokenize`, never with a regex — so a `#` inside a string is left alone.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install simplibs-extractor-python
|
|
54
|
+
simplibs-extractor python src-clean my_project
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from simplibs.extractor_python import remove_python_comments, python_outline
|
|
59
|
+
|
|
60
|
+
remove_python_comments("x = 1 # note\ny = '# not a comment'\n") # -> "x = 1\ny = '# not a comment'\n"
|
|
61
|
+
python_outline("class A:\n def m(self, n: int = 1) -> str:\n return ''\n")
|
|
62
|
+
# -> 'class A:\n def m(self, n: int=1) -> str: ...\n'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> `pip install` is the whole installation: the library announces itself to the extractor through an entry point, so the
|
|
66
|
+
> profiles show up in `simplibs-extractor --list-systems` with nothing to import. The same steps are plain functions
|
|
67
|
+
> (`str -> str`) you can use without the extractor at all.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🧭 The Core Philosophy
|
|
72
|
+
|
|
73
|
+
Cleaning source code with a few regular expressions works until the first file where it does not: a `#` in a URL inside a
|
|
74
|
+
string, an `import` in a docstring, a docstring that was the only statement of a function, `import a; x = 1` on one line.
|
|
75
|
+
`simplibs-extractor-python` is built around those traps:
|
|
76
|
+
|
|
77
|
+
* **Python is read by Python.** The comments are found by `tokenize`, the docstrings, imports and decorators by `ast`.
|
|
78
|
+
A `#` inside `"http://x/#anchor"` is not a comment, and `from` inside a string is not an import.
|
|
79
|
+
* **Cut by position, change nothing else.** A removal cuts exactly the characters of what it found; the rest of the file
|
|
80
|
+
stays as it was written — quotes, spacing, line breaks. The step does not re-format, so the output can be compared with
|
|
81
|
+
the original.
|
|
82
|
+
* **The tree stays.** For a source that parses, the syntax tree of the result equals the tree of the original **minus**
|
|
83
|
+
what the step removes. A block that would be left empty gets a `pass`, a `;` that joined two statements goes with the
|
|
84
|
+
one that was removed — the result is still Python.
|
|
85
|
+
* **One bad file never stops a run.** A file that cannot be read (an old Python 2 file, a half-written module) raises one
|
|
86
|
+
card, the extractor marks **that file** `error` with the reason and goes on. For a profile where "not cleaned" is better
|
|
87
|
+
than "not there", `on_error="keep"` gives the text back unchanged.
|
|
88
|
+
* **A name is a whole name.** A test is `test_a.py`, `a_test.py`, `tests.py`, `conftest.py` or anything in a folder called
|
|
89
|
+
`tests` — not `latest_data.py`, `contest.py` or `attest.py`. A folder is `tests` or it is not.
|
|
90
|
+
* **A package is source.** `__init__.py` holds the public names of a package and `__main__.py` its entry point; both are
|
|
91
|
+
taken by default. What the interpreter made (`__pycache__`) is not.
|
|
92
|
+
* **Rules judge the path inside the source.** A project that lies in a folder called `tests` is not dropped as "a test";
|
|
93
|
+
the rules see only what is *inside* the source folder.
|
|
94
|
+
* **For reading, not for running.** A removal of decorators can change what a function *is*, a removal of imports leaves
|
|
95
|
+
names without their origin. The profiles say so, and the output is built for a reader — a person or a model.
|
|
96
|
+
* **Functions first, actions on top.** Every step is a plain function; the action is a thin wrapper over the function of
|
|
97
|
+
the same name, and the presets and profiles are built from the actions. The logic lives once.
|
|
98
|
+
* **Every error is a card.** An unreadable source is one structured card from
|
|
99
|
+
[`simplibs-exception`](https://pypi.org/project/simplibs-exception/): what, why, how to fix.
|
|
100
|
+
* **Layers that only look left.** `annotations` ← `constants` ← `file_rules` ← `logic` ← `actions` ← `presets` ←
|
|
101
|
+
`profiles` ← `plugin` — every layer imports only from those before it.
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
remove_python_imports("print 'hello'\n") # -> raises: CODE_EXTRACTOR_PYTHON_SOURCE_INVALID — Python 2, the file cannot be read
|
|
105
|
+
remove_python_imports("print 'hello'\n", on_error="keep") # -> "print 'hello'\n" the text back, unchanged
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 📦 Installation
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install simplibs-extractor-python
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Requires Python 3.11+. The package brings [`simplibs-extractor`](https://pypi.org/project/simplibs-extractor/) with it,
|
|
117
|
+
and the command `simplibs-extractor` is available at once. Runtime dependencies, all from the same family:
|
|
118
|
+
[`simplibs-extractor`](https://pypi.org/project/simplibs-extractor/) (the profile, the registry),
|
|
119
|
+
[`simplibs-text`](https://pypi.org/project/simplibs-text/) (cutting the found ranges, the whitespace presets),
|
|
120
|
+
[`simplibs-actions`](https://pypi.org/project/simplibs-actions/) (the steps as actions),
|
|
121
|
+
[`simplibs-path`](https://pypi.org/project/simplibs-path/) and [`simplibs-rules`](https://pypi.org/project/simplibs-rules/)
|
|
122
|
+
(the file rules), [`simplibs-validate`](https://pypi.org/project/simplibs-validate/) and
|
|
123
|
+
[`simplibs-exception`](https://pypi.org/project/simplibs-exception/) (the checks and the error card).
|
|
124
|
+
|
|
125
|
+
> **The running Python decides what is valid.** A source is read by the interpreter that runs the step: a file with syntax
|
|
126
|
+
> newer than that interpreter (`def f[T](x: T)` is Python 3.12+) is a file it cannot read — an `error` line in the
|
|
127
|
+
> report, or an unchanged file with `on_error="keep"`.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 🚀 Quick Start in 60 Seconds
|
|
132
|
+
|
|
133
|
+
### Level 1: The command line
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
simplibs-extractor python src-clean my_project # the project's own logic, cleaned -> my_project/python_src_clean.md
|
|
137
|
+
simplibs-extractor python code-no-imports my_project # the logic only
|
|
138
|
+
simplibs-extractor python outline my_project # signatures without bodies — the smallest overview
|
|
139
|
+
simplibs-extractor python code-clean,data-all my_project # two profiles -> two files, one run
|
|
140
|
+
simplibs-extractor python data-all my_project --dry-run # plan and report, write nothing
|
|
141
|
+
simplibs-extractor --list-profiles python # the five profiles
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Which one? `data-all` gives the files as they are, `code-clean` takes the prose away (comments, docstrings), `src-clean`
|
|
145
|
+
does the same and leaves out tests, configuration, environments and build folders, `code-no-imports` takes also the
|
|
146
|
+
imports and decorators away, `outline` keeps only what a project offers.
|
|
147
|
+
|
|
148
|
+
### Level 2: The steps as functions
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
from simplibs.extractor_python import (
|
|
152
|
+
remove_python_comments, remove_python_docstrings, remove_python_imports, remove_python_decorators, python_outline,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
remove_python_comments("x = 1 # note\n# alone\ny = '# not a comment'\n") # -> "x = 1\ny = '# not a comment'\n"
|
|
156
|
+
remove_python_docstrings('class A:\n """doc"""\n\ndef f():\n """doc"""\n')
|
|
157
|
+
# -> 'class A:\n pass\n\ndef f():\n pass\n' a body needs a statement
|
|
158
|
+
remove_python_imports("import a; x = 1\ny = 2; import b\n") # -> 'x = 1\ny = 2\n'
|
|
159
|
+
remove_python_decorators("@app.route('/')\n@cache(60)\ndef index():\n pass\n") # -> 'def index():\n pass\n'
|
|
160
|
+
python_outline("@dec\nclass A(B):\n def m(self, a: int = 1) -> str:\n return ''\n")
|
|
161
|
+
# -> '@dec\nclass A(B):\n def m(self, a: int=1) -> str: ...\n'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Level 3: Actions and ready-made chains
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from simplibs.extractor_python.actions import PythonOutline, RemovePythonComments, RemovePythonImports
|
|
168
|
+
from simplibs.extractor_python.presets import PYTHON_CLEAN, PYTHON_NO_IMPORTS
|
|
169
|
+
|
|
170
|
+
steps = RemovePythonComments() >> RemovePythonImports()
|
|
171
|
+
steps("import os\n\n# c\nx = 1 # n\n") # -> '\nx = 1\n'
|
|
172
|
+
|
|
173
|
+
PYTHON_CLEAN("import os\n# c\nx = 1 # n\n") # -> 'import os\nx = 1\n'
|
|
174
|
+
PYTHON_NO_IMPORTS('import os\n\n@cache(60)\ndef f():\n """Doc."""\n return 1 # one\n')
|
|
175
|
+
# -> 'def f():\n return 1\n'
|
|
176
|
+
|
|
177
|
+
PythonOutline(docstrings=False)("def f(): '''d'''\n") # -> 'def f(): ...\n'
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Level 4: Your own profile from the parts
|
|
181
|
+
|
|
182
|
+
File rules combine with `&`, `|` and `~`; the steps chain with `>>`; a registered profile is a name for both.
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
from simplibs.extractor import Profile, by_suffix, extract, register_profile
|
|
186
|
+
from simplibs.extractor_python.constants import PYTHON_SUFFIXES
|
|
187
|
+
from simplibs.extractor_python.file_rules import PYTHON_BASE, PYTHON_TESTS
|
|
188
|
+
from simplibs.extractor_python.presets import PYTHON_CLEAN
|
|
189
|
+
|
|
190
|
+
register_profile(Profile(
|
|
191
|
+
system="python", name="tests-clean",
|
|
192
|
+
description="The tests, without comments and docstrings",
|
|
193
|
+
include=PYTHON_BASE & PYTHON_TESTS, # Python files that are tests
|
|
194
|
+
steps=by_suffix(PYTHON_CLEAN, PYTHON_SUFFIXES),
|
|
195
|
+
output_name="python_tests_clean.md",
|
|
196
|
+
))
|
|
197
|
+
|
|
198
|
+
extract(source="my_project", profile="python/tests-clean")
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
A changed copy of a profile of this library is one `dataclasses.replace` away:
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
from dataclasses import replace
|
|
205
|
+
from simplibs.extractor_python.profiles import PYTHON_SRC_CLEAN
|
|
206
|
+
|
|
207
|
+
mine = replace(PYTHON_SRC_CLEAN, name="mine", output_name="mine.md")
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 🛠️ Architecture & Package Structure
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
src/simplibs/extractor_python/
|
|
216
|
+
├── annotations/ ◄── OnError
|
|
217
|
+
├── constants/ ◄── PYTHON_SUFFIXES, PYTHON_CONFIG_NAMES, PYTHON_TEST_DIR_NAMES, PYTHON_VENV_DIR_NAMES, PYTHON_OUTPUT_DIR_NAMES
|
|
218
|
+
├── file_rules/ ◄── Rules on the path inside the source (domain folder)
|
|
219
|
+
│ ├── atomic/ ◄── DOT_NAME, INIT_NAME, MAIN_NAME, IN_DUNDER_DIR, VCS_DIRS, VENV_DIRS, OUTPUT_DIRS
|
|
220
|
+
│ └── python/ ◄── PYTHON_BASE, build_python_base, PYTHON_TESTS, PYTHON_CONFIG, PYTHON_STRICT_EXCLUDE
|
|
221
|
+
├── logic/ ◄── The steps: plain functions that read Python with ast and tokenize
|
|
222
|
+
│ ├── python_comment_spans.py remove_python_comments.py remove_python_docstrings.py ...
|
|
223
|
+
│ └── _helpers/ _validations/ ◄── Private: offsets, the parser guard, statement cutting, the card
|
|
224
|
+
├── actions/ ◄── The steps as Action classes (domain folder)
|
|
225
|
+
├── presets/ ◄── Ready-made chains: PYTHON_CLEAN, PYTHON_NO_IMPORTS (domain folder)
|
|
226
|
+
├── profiles/ ◄── The five Profile objects and PYTHON_PROFILES (domain folder)
|
|
227
|
+
├── plugin/ ◄── register_all: the target of the entry point
|
|
228
|
+
└── py.typed
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Folders named `_helpers/` and `_validations/` are private: they hold the small tools of the steps and the function that
|
|
232
|
+
raises the library's one error card.
|
|
233
|
+
|
|
234
|
+
The package root exports **the steps**, `register_all` and `OnError`. The four domain folders have their own `__all__` and
|
|
235
|
+
are imported through their domain — a function and an action are different kinds of thing and should stay visibly
|
|
236
|
+
different at the import line:
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
from simplibs.extractor_python import remove_python_comments, python_outline, OnError # the steps and the type
|
|
240
|
+
from simplibs.extractor_python.actions import RemovePythonComments # the steps as actions
|
|
241
|
+
from simplibs.extractor_python.file_rules import PYTHON_BASE, build_python_base # the rules
|
|
242
|
+
from simplibs.extractor_python.presets import PYTHON_CLEAN # ready-made chains
|
|
243
|
+
from simplibs.extractor_python.profiles import PYTHON_SRC_CLEAN # the profiles as objects
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The ranges the steps find are `simplibs.text.Span`; the type is taken from `simplibs-text`, not defined here.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 🔧 `logic/` — The steps that read Python
|
|
251
|
+
|
|
252
|
+
Plain functions: a Python source as a text in, a text out (one of them gives the positions of the comments). All take the
|
|
253
|
+
option `on_error`.
|
|
254
|
+
|
|
255
|
+
| Function | Description / Parameters |
|
|
256
|
+
|----------------------------|-----------------------------------------------------------------------------------------------------------------------|
|
|
257
|
+
| `python_comment_spans` | Finds the comments with the tokenizer; returns a `Span` for each, from the blanks in front to the end (`text`, keyword-only: `on_error="raise"`). |
|
|
258
|
+
| `remove_python_comments` | Removes every comment; a line that held only a comment disappears (`text`, keyword-only: `on_error="raise"`). |
|
|
259
|
+
| `remove_python_docstrings` | Removes the docstrings of the module, classes and functions; an emptied body gets `pass` (`text`, keyword-only: `on_error="raise"`). |
|
|
260
|
+
| `remove_python_imports` | Removes the imports at any depth; an emptied body gets `pass`, `import a; x = 1` keeps `x = 1` (`text`, keyword-only: `on_error="raise"`). |
|
|
261
|
+
| `remove_python_decorators` | Removes the decorators of every class and function, from the `@` (`text`, keyword-only: `on_error="raise"`). |
|
|
262
|
+
| `python_outline` | Writes classes and functions as signatures without bodies — valid Python again (`text`, keyword-only: `docstrings=True`, `on_error="raise"`). |
|
|
263
|
+
|
|
264
|
+
➡️ [README_EXTRACTOR_PYTHON_LOGIC](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/logic/README_EXTRACTOR_PYTHON_LOGIC.md)
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 🔗 `actions/` — The steps as pipeline actions
|
|
269
|
+
|
|
270
|
+
Every step except `python_comment_spans` is also an `Action` of
|
|
271
|
+
[`simplibs-actions`](https://pypi.org/project/simplibs-actions/): configured once, called with the **text** as its main
|
|
272
|
+
input, chainable with `>>`. The options of the function are the options of the action:
|
|
273
|
+
`RemovePythonImports(on_error="keep")`.
|
|
274
|
+
|
|
275
|
+
| Action | Over | Description |
|
|
276
|
+
|--------------------------|----------------------------|--------------------------------------------------------------|
|
|
277
|
+
| `RemovePythonComments` | `remove_python_comments` | Takes the comments out of the text flowing in. |
|
|
278
|
+
| `RemovePythonDocstrings` | `remove_python_docstrings` | Takes the docstrings out. |
|
|
279
|
+
| `RemovePythonImports` | `remove_python_imports` | Takes the import statements out. |
|
|
280
|
+
| `RemovePythonDecorators` | `remove_python_decorators` | Takes the decorators out. |
|
|
281
|
+
| `PythonOutline` | `python_outline` | Turns the text into signatures without bodies. |
|
|
282
|
+
|
|
283
|
+
➡️ [README_EXTRACTOR_PYTHON_ACTIONS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_ACTIONS.md)
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## 🧩 `presets/` — Ready-made chains
|
|
288
|
+
|
|
289
|
+
Chains of actions, built once, that the profiles use.
|
|
290
|
+
|
|
291
|
+
| Preset | Chain |
|
|
292
|
+
|---------------------|--------------------------------------------------------------------------------------------------------|
|
|
293
|
+
| `PYTHON_CLEAN` | `RemovePythonComments() >> RemovePythonDocstrings() >> CLEANUP_WHITESPACE` — the imports stay. |
|
|
294
|
+
| `PYTHON_NO_IMPORTS` | `RemovePythonComments() >> RemovePythonDocstrings() >> RemovePythonImports() >> RemovePythonDecorators() >> COMPACT` — the logic only. |
|
|
295
|
+
|
|
296
|
+
`CLEANUP_WHITESPACE` squeezes blank runs to one line, `COMPACT` removes every blank line (also inside a multi-line string).
|
|
297
|
+
|
|
298
|
+
➡️ [README_EXTRACTOR_PYTHON_PRESETS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PRESETS.md)
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 📋 `profiles/` — The five profiles
|
|
303
|
+
|
|
304
|
+
Registered in the system `python`; also importable as `Profile` objects.
|
|
305
|
+
|
|
306
|
+
| Profile | Output | Description |
|
|
307
|
+
|--------------------------|-----------------------------|---------------------------------------------------------------------------------------------|
|
|
308
|
+
| `python/code-clean` | `python_code_clean.md` | Python without comments, docstrings and extra blank lines (imports stay). |
|
|
309
|
+
| `python/code-no-imports` | `python_code_no_imports.md` | Pure logic: no imports, decorators, comments, docstrings or blank lines. |
|
|
310
|
+
| `python/data-all` | `python_data_all.md` | Every relevant `.py` file, as it is. |
|
|
311
|
+
| `python/outline` | `python_outline.md` | Overview of classes and functions: signatures without bodies. |
|
|
312
|
+
| `python/src-clean` | `python_src_clean.md` | Like `code-clean`, without tests, configuration, environments and build folders. |
|
|
313
|
+
|
|
314
|
+
`PYTHON_PROFILES` is the tuple of all five, in the order the listings show them.
|
|
315
|
+
|
|
316
|
+
➡️ [README_EXTRACTOR_PYTHON_PROFILES](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PROFILES.md)
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 📐 `file_rules/` — Which files are worth reading
|
|
321
|
+
|
|
322
|
+
Rules on the path **inside** the source folder: `Rule` objects of
|
|
323
|
+
[`simplibs-rules`](https://pypi.org/project/simplibs-rules/), composable with `&`, `|` and `~`.
|
|
324
|
+
|
|
325
|
+
| Rule / function | Description / Parameters |
|
|
326
|
+
|-------------------------|----------------------------------------------------------------------------------------------------------------|
|
|
327
|
+
| `PYTHON_BASE` | The default choice: Python files, with `__init__.py` and `__main__.py`, without dot files and `__pycache__`. |
|
|
328
|
+
| `build_python_base` | Builds that rule with switches (keyword-only: `include_init=True`, `include_main=True`). |
|
|
329
|
+
| `PYTHON_TESTS` | A test by its whole name (`test_a.py`, `a_test.py`, `tests.py`, `conftest.py`) or by its folder (`tests/`). |
|
|
330
|
+
| `PYTHON_CONFIG` | Project configuration: `setup.py`, `pyproject.toml`, `tox.ini`, `requirements.txt`, ... |
|
|
331
|
+
| `PYTHON_STRICT_EXCLUDE` | Tests, configuration, environments, build output and version control together. |
|
|
332
|
+
|
|
333
|
+
The atomic pieces they are made of: `DOT_NAME`, `INIT_NAME`, `MAIN_NAME`, `IN_DUNDER_DIR`, `VCS_DIRS`, `VENV_DIRS`,
|
|
334
|
+
`OUTPUT_DIRS`.
|
|
335
|
+
|
|
336
|
+
➡️ [README_EXTRACTOR_PYTHON_FILE_RULES](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_FILE_RULES.md)
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 🔖 `annotations/` and `constants/`
|
|
341
|
+
|
|
342
|
+
| Name | Kind | Description |
|
|
343
|
+
|---------------------------|----------|-------------------------------------------------------------------------------------|
|
|
344
|
+
| `OnError` | Literal | `"raise"` or `"keep"`: what a step does with a source it cannot read. Exported from the package root. |
|
|
345
|
+
| `PYTHON_SUFFIXES` | Constant | `(".py",)` — the suffixes of Python source. |
|
|
346
|
+
| `PYTHON_CONFIG_NAMES` | Constant | File names of project configuration. |
|
|
347
|
+
| `PYTHON_TEST_DIR_NAMES` | Constant | `("tests", "test")`. |
|
|
348
|
+
| `PYTHON_VENV_DIR_NAMES` | Constant | `("venv", ".venv", "env", "virtualenv")`. |
|
|
349
|
+
| `PYTHON_OUTPUT_DIR_NAMES` | Constant | `("build", "dist", "out")`. |
|
|
350
|
+
|
|
351
|
+
➡️ [README_EXTRACTOR_PYTHON_ANNOTATIONS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_ANNOTATIONS.md) · [README_EXTRACTOR_PYTHON_CONSTANTS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_CONSTANTS.md)
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 🔌 `plugin/` — The meeting point with the extractor
|
|
356
|
+
|
|
357
|
+
| Function | Description / Parameters |
|
|
358
|
+
|----------------|---------------------------------------------------------------------------------------------------------------------------|
|
|
359
|
+
| `register_all` | Registers the five profiles in the extractor's registry and returns their keys; the target of the entry point `simplibs.extractor.plugins` (keyword-only: `replace_existing=True`). |
|
|
360
|
+
|
|
361
|
+
The entry point lives in this library's `pyproject.toml`; the extractor's `load_plugins()` finds it, so nothing is
|
|
362
|
+
imported by name. From Python, call `load_plugins()` of the extractor once before a profile is looked up.
|
|
363
|
+
|
|
364
|
+
➡️ [README_EXTRACTOR_PYTHON_PLUGIN](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PLUGIN.md)
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## ⚠️ Exceptions
|
|
369
|
+
|
|
370
|
+
The library defines no exceptions of its own. A source that cannot be read is one structured
|
|
371
|
+
[`simplibs.exception`](https://pypi.org/project/simplibs-exception/) card; a caller that wants "any error of the family"
|
|
372
|
+
catches `SimpleError`.
|
|
373
|
+
|
|
374
|
+
| Error name | Class | Wraps | Raised when |
|
|
375
|
+
|----------------------------------------|--------------|--------------|--------------------------------------------------------------------------------------------------|
|
|
376
|
+
| `CODE_EXTRACTOR_PYTHON_SOURCE_INVALID` | `ParamError` | `ValueError` | A step gets a text that cannot be read as Python — a syntax error, a bad indentation, an unterminated string, a null character, line endings other than `\n` — and `on_error` is `"raise"`. |
|
|
377
|
+
|
|
378
|
+
What is an exception and what is not:
|
|
379
|
+
|
|
380
|
+
| Situation | How it is reported |
|
|
381
|
+
|-----------------------------------------------------------------------------|--------------------------------------------------------------------------|
|
|
382
|
+
| A step called directly on **an unreadable source** | the card above, **raised** (or the text back with `on_error="keep"`) |
|
|
383
|
+
| The same inside an **extraction** | **not raised**: that file is `error` in the result, the run continues |
|
|
384
|
+
| A wrong **type** of an argument (`text=5`, `on_error="ignore"`) | a `ValidationError` from `simplibs-validate` |
|
|
385
|
+
| A profile key that is taken, with `register_all(replace_existing=False)` | the card of the extractor's registry (`EXTRACTOR_PROFILE_EXISTS`) |
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## 📚 Documentation
|
|
390
|
+
|
|
391
|
+
The detailed references — every function, rule and profile with its parameters, return value, raised errors, an example
|
|
392
|
+
and a look under the hood:
|
|
393
|
+
|
|
394
|
+
| Reference | What it describes |
|
|
395
|
+
|-----------|-------------------|
|
|
396
|
+
| [LOGIC](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/logic/README_EXTRACTOR_PYTHON_LOGIC.md) | the six steps: comments, docstrings, imports, decorators, the outline |
|
|
397
|
+
| [ACTIONS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_ACTIONS.md) | the steps as pipeline actions |
|
|
398
|
+
| [PRESETS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PRESETS.md) | `PYTHON_CLEAN`, `PYTHON_NO_IMPORTS` |
|
|
399
|
+
| [PROFILES](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PROFILES.md) | the five profiles, one file through each, a profile of your own |
|
|
400
|
+
| [FILE_RULES](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_FILE_RULES.md) | which files are worth reading: the atomic pieces and the rules of a Python project |
|
|
401
|
+
| [ANNOTATIONS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_ANNOTATIONS.md) | `OnError` |
|
|
402
|
+
| [CONSTANTS](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_CONSTANTS.md) | the fixed values: suffixes and folder names |
|
|
403
|
+
| [PLUGIN](https://github.com/simplibs/simplibs-extractor-python/blob/main/docs/README_EXTRACTOR_PYTHON_PLUGIN.md) | `register_all` and how the extractor finds this add-on |
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## 🔗 Related libraries
|
|
408
|
+
|
|
409
|
+
* **[`simplibs-extractor`](https://pypi.org/project/simplibs-extractor/)** — the extractor this library is an add-on of: the six phases, the profiles and the command.
|
|
410
|
+
* **[`simplibs-text`](https://pypi.org/project/simplibs-text/)** — `remove_spans` cuts the ranges the steps find; `CLEANUP_WHITESPACE` and `COMPACT` close the presets.
|
|
411
|
+
* **[`simplibs-actions`](https://pypi.org/project/simplibs-actions/)** — the `Action` the steps are wrapped in.
|
|
412
|
+
* **[`simplibs-path`](https://pypi.org/project/simplibs-path/)** — the path rules (`HasSuffix`, `NameIs`, `AnyParentNameIs`) and `IGNORE_VCS`.
|
|
413
|
+
* **[`simplibs-rules`](https://pypi.org/project/simplibs-rules/)** — the `Rule` object and its building blocks (`IsIn`, `Equals`, `StartsWith`, `Regex`).
|
|
414
|
+
* **[`simplibs-validate`](https://pypi.org/project/simplibs-validate/)** and **[`simplibs-exception`](https://pypi.org/project/simplibs-exception/)** — the checks of every signature and the error card.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## ☯️ About simplibs
|
|
419
|
+
|
|
420
|
+
All libraries in the **simplibs** (Simple Libraries) ecosystem share a common
|
|
421
|
+
engineering philosophy:
|
|
422
|
+
|
|
423
|
+
* **Dyslexia-friendly:**
|
|
424
|
+
We actively minimize cognitive load. Code is atomized into small, self-contained units,
|
|
425
|
+
files are named directly after the logical task they perform, and explanations describe
|
|
426
|
+
*why* something is designed, not just *what* it is.
|
|
427
|
+
* **Programmer's Zen:**
|
|
428
|
+
Nothing should be missing, and nothing should be superfluous. We value clean execution
|
|
429
|
+
paths and robust, understandable code architectures over rushed, messy feature sets.
|
|
430
|
+
* **Defensive Style:**
|
|
431
|
+
We actively anticipate edge cases and failure modes so that only safe operational paths
|
|
432
|
+
remain. Our code is built to degrade gracefully rather than crash unexpectedly.
|
|
433
|
+
* **Minimalism:**
|
|
434
|
+
Find the most direct path to the goal in as few operational steps as possible without
|
|
435
|
+
taking shortcuts on safety, readability, or completeness.
|
|
436
|
+
* **Code as Craft:**
|
|
437
|
+
Code should be pleasant to look at, readable at a glance, and evoke structural harmony.
|
|
438
|
+
We treat software engineering as a precision trade.
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
### 🤝 Contributing & Community
|
|
443
|
+
|
|
444
|
+
This is an **open-source project** built with love and care. We strongly believe in
|
|
445
|
+
community collaboration and welcome any feedback, bug reports, or feature ideas!
|
|
446
|
+
|
|
447
|
+
* **Want to contribute?** Feel free to open an Issue or submit a Pull Request.
|
|
448
|
+
* **Want to get in touch?** If you'd like to discuss the project further, collaborate,
|
|
449
|
+
or just say hello, feel free to open a GitHub Issue or start a Discussion.
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
### 📝 License
|
|
454
|
+
|
|
455
|
+
This library is released under the **MIT License**. Build great things!
|
|
456
|
+
|
|
457
|
+
---
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
simplibs/extractor_python/__init__.py,sha256=qhhxkcDgPPQmeWraOUxVJpYyII0hgWmkHHkrWSX4jg4,2200
|
|
2
|
+
simplibs/extractor_python/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
+
simplibs/extractor_python/actions/PythonOutline.py,sha256=_mIBdJuaGN2CgPi625wB9i3LhXhbcwFfcVh2oilPI60,630
|
|
4
|
+
simplibs/extractor_python/actions/RemovePythonComments.py,sha256=2V5k1TCwwLGWC2J3fE6MvyYm-c5vMdBMaQUSU_mYnoU,653
|
|
5
|
+
simplibs/extractor_python/actions/RemovePythonDecorators.py,sha256=7ARRzBJ26vEVqThS3QBu8xTMISvAyr4wUibPKYNcYl8,589
|
|
6
|
+
simplibs/extractor_python/actions/RemovePythonDocstrings.py,sha256=XbA3RDqkTmdmq_Csksd9BvLP6juuW3yzPCFtgihOCgU,594
|
|
7
|
+
simplibs/extractor_python/actions/RemovePythonImports.py,sha256=admJqxuKcVWI5MTk_JPRLSInLZOzX4oRrrUFWPxIEo8,546
|
|
8
|
+
simplibs/extractor_python/actions/__init__.py,sha256=ga3WHndsB6WhSRqicReyDrxJM9qL0MY7veOxCKGjUs8,1867
|
|
9
|
+
simplibs/extractor_python/annotations/OnError.py,sha256=_xhZTCF3dmQu8-HHAJ0-0a1kKlPMajw_3NMq012SKJw,898
|
|
10
|
+
simplibs/extractor_python/annotations/__init__.py,sha256=AVLM7o0gisxJoU41biafVAijNZ6End3rj4dMvtNINuo,631
|
|
11
|
+
simplibs/extractor_python/constants/PYTHON_CONFIG_NAMES.py,sha256=cPqAW72Z2AyHJjLSIMSxjann0ems8MBgNVq6qREBRKs,575
|
|
12
|
+
simplibs/extractor_python/constants/PYTHON_OUTPUT_DIR_NAMES.py,sha256=_ji2UgeFUqovnrh--xAN_HGJRUkO4pUDqpiqrEVUIb0,570
|
|
13
|
+
simplibs/extractor_python/constants/PYTHON_SUFFIXES.py,sha256=noUH06oul0VrnH__eZxyaDCfL2ozBShY2czrTa0QhOA,442
|
|
14
|
+
simplibs/extractor_python/constants/PYTHON_TEST_DIR_NAMES.py,sha256=iY6gTpZ6TGdzHbv2jiMYEzI5oeGy0KB60abIMJ7KVMI,472
|
|
15
|
+
simplibs/extractor_python/constants/PYTHON_VENV_DIR_NAMES.py,sha256=uNA-EDGpZ3HkGZRcwE3iF64i6OJsHUrtg9FYbqi5SIk,544
|
|
16
|
+
simplibs/extractor_python/constants/__init__.py,sha256=I-Is7SiamEIJCQ7ZRofaMAoTYkIvnH-D3g-PZq8cbTE,1320
|
|
17
|
+
simplibs/extractor_python/file_rules/__init__.py,sha256=LutlcH_9PJ6P_zrSDZs59dEHMq9r7UHtin0DiXtDBuc,1691
|
|
18
|
+
simplibs/extractor_python/file_rules/atomic/DOT_NAME.py,sha256=cJsd-hkI0dzooSwL7BGzndGwCV_ONaFKdBjyW_iQZ8I,529
|
|
19
|
+
simplibs/extractor_python/file_rules/atomic/INIT_NAME.py,sha256=Xc4uHsXbdtffcTvIYLYYUdUrg_Pr506C-OCv82o_RU4,463
|
|
20
|
+
simplibs/extractor_python/file_rules/atomic/IN_DUNDER_DIR.py,sha256=gX-_rJZ3AMjKYI8flOAKocaOTgOVKQ_oQ6435qeqVgo,481
|
|
21
|
+
simplibs/extractor_python/file_rules/atomic/MAIN_NAME.py,sha256=4wJlFqFaLVFiSRxhI3gW3AjmpvLfmziEJSgiAv86LGM,372
|
|
22
|
+
simplibs/extractor_python/file_rules/atomic/OUTPUT_DIRS.py,sha256=ZoOjbRwhsmSUf4B7swPAq4XquNckL0LsodLjeB_-VBk,435
|
|
23
|
+
simplibs/extractor_python/file_rules/atomic/VCS_DIRS.py,sha256=jZjyNQB12Gd_FS1rOPXUZgXfIPM7ZFanXJcjSMQuM2Y,856
|
|
24
|
+
simplibs/extractor_python/file_rules/atomic/VENV_DIRS.py,sha256=cENocM8qW711tzMa4Id10wGVKHDGAjtTdJhxZaH6-qY,488
|
|
25
|
+
simplibs/extractor_python/file_rules/atomic/__init__.py,sha256=R0HRSSd0YamI8gda08urDwosPuajF1NYdgk7pD8R8Ik,1430
|
|
26
|
+
simplibs/extractor_python/file_rules/python/PYTHON_BASE.py,sha256=8xNu01mFNCWf3ZLERamgU0Ih9GT9l1VzT7MFMWH8ypc,464
|
|
27
|
+
simplibs/extractor_python/file_rules/python/PYTHON_CONFIG.py,sha256=U_W1TBWU4_WO8t-2G_7cnsQ9XqYei6S3F13DQSGzsM0,541
|
|
28
|
+
simplibs/extractor_python/file_rules/python/PYTHON_STRICT_EXCLUDE.py,sha256=pRZgOJD2misgcnY8nFIgFYTNIQocrXTg3HuFYgJMvBY,778
|
|
29
|
+
simplibs/extractor_python/file_rules/python/PYTHON_TESTS.py,sha256=6DzD3E3F7AAY8yZnDB0z-HE_Vn39x0hRD7w-41WAgvc,1038
|
|
30
|
+
simplibs/extractor_python/file_rules/python/__init__.py,sha256=pooFV8qjrPZpMrXbFrDXjr_aRbM4ayYM8qL9yQXhsNc,1169
|
|
31
|
+
simplibs/extractor_python/file_rules/python/build_python_base.py,sha256=P7boM2hYOdYv7Lp8CKj81rr0_jb9Ai0G8SK5pH2NWr8,2115
|
|
32
|
+
simplibs/extractor_python/logic/__init__.py,sha256=zNrXWedm5WvvDTH89CQwaDmer6dVBB9KHKLmz4MeMak,1975
|
|
33
|
+
simplibs/extractor_python/logic/python_comment_spans.py,sha256=IRvpBcubw1gxsBJnsSVFabnjcWdfl_pfw5syzoHVvBM,2364
|
|
34
|
+
simplibs/extractor_python/logic/python_outline.py,sha256=uuR4JExu9pqcRQsupkAKw6LjGsIUmpED4FoRXOSIsbE,2317
|
|
35
|
+
simplibs/extractor_python/logic/remove_python_comments.py,sha256=Umas-0zethFzChjl1b4wtc92DUVv_qFkzmuwM2bCUoI,1307
|
|
36
|
+
simplibs/extractor_python/logic/remove_python_decorators.py,sha256=f2KyJkj4cGG0JbFSUUHFJYHcE1atERbp6iXXDs69BM4,1552
|
|
37
|
+
simplibs/extractor_python/logic/remove_python_docstrings.py,sha256=WyYAYM0QkkKNG9-PsRsCs63avsVyGqpN6AhPjmdSORk,1604
|
|
38
|
+
simplibs/extractor_python/logic/remove_python_imports.py,sha256=frO62OCsfyEyYRNbeHP7lscEcNSx_tN6329ehbGfkjc,1550
|
|
39
|
+
simplibs/extractor_python/logic/_helpers/SourceOffsets.py,sha256=C8mrQspA5Rb92aDpDH5pofwkkXNtvXOd_4N5v2nW3-Q,2694
|
|
40
|
+
simplibs/extractor_python/logic/_helpers/__init__.py,sha256=znE_FIRcbYQs9PupGFK1iEASrViXhaAsqCqJNr1R1xs,2264
|
|
41
|
+
simplibs/extractor_python/logic/_helpers/collect_definitions.py,sha256=HemGsaiBHFWP73v4eNq4u-mWA04sxgTb6QPqcfx9V_Y,2247
|
|
42
|
+
simplibs/extractor_python/logic/_helpers/cut_statements.py,sha256=7uorZmJc_0Kz1vqcUSbz7Sfwd7N450SGzoP6e9K1R2k,4738
|
|
43
|
+
simplibs/extractor_python/logic/_helpers/describe_source_failure.py,sha256=oyGV79aKYLICWpMs8AigxC_vGVoS-WF--jimk5dYys8,1091
|
|
44
|
+
simplibs/extractor_python/logic/_helpers/find_decorator_spans.py,sha256=h4ideS4BsA764zurqsanGoRKYsbJ1HdgqnLhD206MTw,4250
|
|
45
|
+
simplibs/extractor_python/logic/_helpers/find_docstrings.py,sha256=uRpLTa9vlqHyOi-PONLIQ21u9mgE3rHRSy0J95TG06M,1363
|
|
46
|
+
simplibs/extractor_python/logic/_helpers/find_imports.py,sha256=2ic-4z6xMUxs-5Lt1rU1AbGl_O7eXfM4ezUYKMiiEWI,964
|
|
47
|
+
simplibs/extractor_python/logic/_helpers/first_doc_line.py,sha256=u7eWP-zDOxQdfbF3LF7t5dTcVtYGnJ8QazIPhS03nU4,1098
|
|
48
|
+
simplibs/extractor_python/logic/_helpers/format_type_params.py,sha256=epjG54vbgbrsC-2EN-t9tkGBHwuFf0vX4cU_Jyj7FxA,864
|
|
49
|
+
simplibs/extractor_python/logic/_helpers/guarded_parse.py,sha256=12aPHBAx9nS-gPmVGP-aKtYtFPU9nzn3DCRFTZjn_As,2131
|
|
50
|
+
simplibs/extractor_python/logic/_helpers/outline_node.py,sha256=FpaIeRtEqfAU7RTI-_qs_6wgvJyOW1d_a72jWSuI_Fc,2605
|
|
51
|
+
simplibs/extractor_python/logic/_helpers/parse_python.py,sha256=upxHTYCsoHr0PIfZnGxHqbvCVSSUXwRuNYo3krmBG94,828
|
|
52
|
+
simplibs/extractor_python/logic/_validations/__init__.py,sha256=UzgZVSbnmGfoJ3eTrIccAd7rvrukC5tkivqQUF2-Js4,479
|
|
53
|
+
simplibs/extractor_python/logic/_validations/raise_python_source_error.py,sha256=Z0PadMy1UGX2H7SH9ddMepp4-J0IonPZoch_0sTaM50,2038
|
|
54
|
+
simplibs/extractor_python/plugin/__init__.py,sha256=0GaexU-zzsefGjqkoyvlKSyrAIvc7abPiYKDFFGFvHk,438
|
|
55
|
+
simplibs/extractor_python/plugin/register_all.py,sha256=_jvHztkxEI2EsM-xwnE-US1YYnyTvmwooR9j8KMRBj8,1517
|
|
56
|
+
simplibs/extractor_python/presets/PYTHON_CLEAN.py,sha256=Kct4MI43HkwsZETJtFQ1AXDhoj4YjGq6MCu-NF11iP8,857
|
|
57
|
+
simplibs/extractor_python/presets/PYTHON_NO_IMPORTS.py,sha256=Wh290eGqG_FRm2mjcF-5lj2VaVs8hWVSpihhCrPkfu4,803
|
|
58
|
+
simplibs/extractor_python/presets/__init__.py,sha256=kl3Cz7Ra6jQBwnB2QowD0lsKFRCCQh8SNwd_u_faNw4,984
|
|
59
|
+
simplibs/extractor_python/profiles/PYTHON_CODE_CLEAN.py,sha256=Am_vOABW4nAUADUutqfHxfYjD2gkVT7-W6To3lwFzdI,822
|
|
60
|
+
simplibs/extractor_python/profiles/PYTHON_CODE_NO_IMPORTS.py,sha256=sjlITwDHslYVnqlsyM_U6rHDJPf-AlikYwUm7u3PmJY,783
|
|
61
|
+
simplibs/extractor_python/profiles/PYTHON_DATA_ALL.py,sha256=dvHyfIgo5vwoECBKSaiuVm9IvwbvfGsVgICCioV9gwg,599
|
|
62
|
+
simplibs/extractor_python/profiles/PYTHON_OUTLINE.py,sha256=lB8II9N3P2clSCsQ-RsTF1ZjTkGJBdT4aKhfKUz63Is,839
|
|
63
|
+
simplibs/extractor_python/profiles/PYTHON_PROFILES.py,sha256=Fu-72uFobbUd7Ra1dmmW4_VNTVCOLbDRQhNvED0tPC8,677
|
|
64
|
+
simplibs/extractor_python/profiles/PYTHON_SRC_CLEAN.py,sha256=6vI7zLba9hqh9xsiwiJBaljDAC74pUWNZqT65TYBX14,832
|
|
65
|
+
simplibs/extractor_python/profiles/__init__.py,sha256=sLrXap2lVbXwo_7Z6H_XVVpjE39FqeRhYIRn0G6VNJc,1947
|
|
66
|
+
simplibs_extractor_python-0.1.0.dist-info/licenses/LICENSE,sha256=iMJUFcbjkLu6dZpunWGLySIYPdMK_vu8PcVbmAKkph4,1100
|
|
67
|
+
simplibs_extractor_python-0.1.0.dist-info/METADATA,sha256=26NAuHoVTWSW40ss5Rv2hN_3ibMY_58df0-MvvX1TIc,30019
|
|
68
|
+
simplibs_extractor_python-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
69
|
+
simplibs_extractor_python-0.1.0.dist-info/entry_points.txt,sha256=KxEqzHINukoS-tWHNcADRUbanA9FM9btvpI4hL3me5M,77
|
|
70
|
+
simplibs_extractor_python-0.1.0.dist-info/top_level.txt,sha256=xaQIA-7fMYUXhc2gGL2-moaltZWXucNiTVXBx-lNB3I,9
|
|
71
|
+
simplibs_extractor_python-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dalibor Sova (Sudip2708)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
simplibs
|