pystreamliner 1.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.
@@ -0,0 +1,185 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License.
67
+
68
+ Subject to the terms and conditions of this License, each Contributor
69
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
70
+ royalty-free, irrevocable copyright license to reproduce, prepare Derivative
71
+ Works of, publicly display, publicly perform, sublicense, and distribute
72
+ the Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License.
75
+
76
+ Subject to the terms and conditions of this License, each Contributor
77
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
78
+ royalty-free, irrevocable (except as stated in this section) patent
79
+ license to make, have made, use, offer to sell, sell, import, and otherwise
80
+ transfer the Work, where such license applies only to those patent
81
+ claims licensable by such Contributor that are necessarily infringed by
82
+ their Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a cross-claim
85
+ or counterclaim in a lawsuit) alleging that the Work or a Contribution
86
+ incorporated within the Work constitutes direct or contributory patent
87
+ infringement, then any patent licenses granted to You under this License
88
+ for that Work shall terminate as of the date such litigation is filed.
89
+
90
+ 4. Redistribution.
91
+
92
+ You may reproduce and distribute copies of the Work or Derivative Works
93
+ thereof in any medium, with or without modifications, and in Source or
94
+ Object form, provided that You meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear.
118
+
119
+ The contents of the NOTICE file are for informational purposes only
120
+ and do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions.
134
+
135
+ Unless You explicitly state otherwise, any Contribution intentionally
136
+ submitted for inclusion in the Work by You to the Licensor shall be
137
+ under the terms and conditions of this License, without any additional
138
+ terms or conditions. Notwithstanding the above, nothing herein shall
139
+ supersede or modify the terms of any separate license agreement you
140
+ may have executed with Licensor regarding such Contributions.
141
+
142
+ 6. Trademarks.
143
+
144
+ This License does not grant permission to use the trade
145
+ names, trademarks, service marks, or product names of the Licensor,
146
+ except as required for reasonable and customary use in describing the
147
+ origin of the Work and reproducing the content of the NOTICE file.
148
+
149
+ 7. Disclaimer of Warranty.
150
+
151
+ Unless required by applicable law or agreed to in writing, Licensor
152
+ provides the Work (and each Contributor provides its Contributions)
153
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
154
+ either express or implied, including, without limitation, any warranties
155
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS
156
+ FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
157
+ appropriateness of using or redistributing the Work and assume any
158
+ risks associated with Your exercise of permissions under this License.
159
+
160
+ 8. Limitation of Liability.
161
+
162
+ In no event and under no legal theory, whether in tort (including negligence),
163
+ contract, or otherwise, unless required by applicable law (such as deliberate
164
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
165
+ liable to You for damages, including any direct, indirect, special, incidental,
166
+ or consequential damages of any character arising as a result of this License or
167
+ out of the use or inability to use the Work (including but not limited to damages
168
+ for loss of goodwill, work stoppage, computer failure or malfunction, or any
169
+ and all other commercial damages or losses), even if such Contributor has been
170
+ advised of the possibility of such damages.
171
+
172
+ 9. Accepting Warranty or Additional Liability.
173
+
174
+ While redistributing the Work or Derivative Works thereof, You may choose to
175
+ offer, and charge a fee for, acceptance of support, warranty, indemnity,
176
+ or other liability obligations and/or rights consistent with this License.
177
+ However, in accepting such obligations, You may act only on Your own behalf
178
+ and on Your sole responsibility, not on behalf of any other Contributor, and
179
+ only if You agree to indemnify, defend, and hold each Contributor harmless
180
+ for any liability incurred by, or claims asserted against, such Contributor
181
+ by reason of your accepting any such warranty or additional liability.
182
+
183
+ END OF TERMS AND CONDITIONS
184
+
185
+ Copyright 2026 Supe232323
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: pystreamliner
3
+ Version: 1.3
4
+ Summary: A script to analyze and clean Python files
5
+ Project-URL: Homepage, https://github.com
6
+ Project-URL: Repository, https://github.com
7
+ Project-URL: Documentation, https://github.com/wiki
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Dynamic: license-file
12
+
13
+ # pystreamliner
14
+
15
+ [![PyPI version](https://img.shields.io/pypi/v/pystreamliner.svg)](https://pypi.org/project/pystreamliner/)
16
+ [![PyPI downloads](https://img.shields.io/pypi/dm/pystreamliner)](https://pypi.org/project/pystreamliner/)
17
+
18
+ **Automatically clean up messy Python files — without breaking anything.**
19
+
20
+ pystreamliner uses Python's AST (abstract syntax tree) to safely detect and fix common code issues. It operates on two tiers: things it can fix automatically with zero risk, and things it flags for you to review manually.
21
+
22
+ ---
23
+
24
+ ## What it does
25
+
26
+ **Auto-fixes (Tier 1 — applied immediately):**
27
+ - Removes unused imports, or trims partially unused `from x import y` statements
28
+ - Removes consecutive duplicate lines
29
+ - Caps excessive blank lines
30
+
31
+ **Warnings (Tier 2 — reported, never auto-changed):**
32
+ - Unused variables
33
+ - Unused top-level functions
34
+ - Vague variable names (`x`, `tmp`, `foo`, `bar`, etc.)
35
+
36
+ pystreamliner never touches code it isn't certain about. If there's any doubt, it warns you instead.
37
+
38
+ ---
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install pystreamliner
44
+ ```
45
+
46
+ No dependencies. Runs on Python 3.10+.
47
+
48
+ ---
49
+
50
+ ## Usage
51
+
52
+ ```bash
53
+ python streamliner.py your_file.py
54
+ ```
55
+
56
+ This will:
57
+ 1. Analyze `your_file.py`
58
+ 2. Write the cleaned version in-place
59
+ 3. Print a full report of what was changed and what needs manual review
60
+ 4. Show a diff of every modification
61
+
62
+ **Preview changes without modifying anything:**
63
+
64
+ ```bash
65
+ python streamliner.py --dry-run your_file.py
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Example output
71
+
72
+ ```
73
+ ══════════════════════════════════════════
74
+ PyStreamliner Report
75
+ ══════════════════════════════════════════
76
+ File: main.py
77
+ Lines analyzed: 312
78
+
79
+ Auto-fixes applied:
80
+ Unused imports removed: 3
81
+ Duplicate lines removed: 1
82
+ Blank lines reduced: 2
83
+
84
+ Warnings (manual review needed):
85
+ Unused variables detected: 2
86
+ Unused functions detected: 1
87
+ Vague variable names: 1
88
+ ──────────────────────────────────────────
89
+
90
+ Unused imports removed:
91
+ • line 4: import os
92
+ • line 5: import sys
93
+ • line 7: from pathlib import Path, PurePath (partially cleaned: kept 'Path')
94
+
95
+ Unused variables:
96
+ ⚠ line 42: result
97
+ ⚠ line 87: temp_val
98
+
99
+ Vague variable names:
100
+ ⚠ line 23: tmp
101
+ ══════════════════════════════════════════
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Why not just use Black / isort / autoflake?
107
+
108
+ Those are great tools and pystreamliner doesn't replace them. The difference:
109
+
110
+ - **Black** formats style. pystreamliner removes dead code.
111
+ - **autoflake** removes unused imports but doesn't warn about unused variables, vague names, or dead functions.
112
+ - **pystreamliner** combines lightweight static analysis with conservative auto-fixing and a human-readable report — in a single file with zero dependencies.
113
+
114
+ ---
115
+
116
+ ## Contributing
117
+
118
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,106 @@
1
+ # pystreamliner
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/pystreamliner.svg)](https://pypi.org/project/pystreamliner/)
4
+ [![PyPI downloads](https://img.shields.io/pypi/dm/pystreamliner)](https://pypi.org/project/pystreamliner/)
5
+
6
+ **Automatically clean up messy Python files — without breaking anything.**
7
+
8
+ pystreamliner uses Python's AST (abstract syntax tree) to safely detect and fix common code issues. It operates on two tiers: things it can fix automatically with zero risk, and things it flags for you to review manually.
9
+
10
+ ---
11
+
12
+ ## What it does
13
+
14
+ **Auto-fixes (Tier 1 — applied immediately):**
15
+ - Removes unused imports, or trims partially unused `from x import y` statements
16
+ - Removes consecutive duplicate lines
17
+ - Caps excessive blank lines
18
+
19
+ **Warnings (Tier 2 — reported, never auto-changed):**
20
+ - Unused variables
21
+ - Unused top-level functions
22
+ - Vague variable names (`x`, `tmp`, `foo`, `bar`, etc.)
23
+
24
+ pystreamliner never touches code it isn't certain about. If there's any doubt, it warns you instead.
25
+
26
+ ---
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install pystreamliner
32
+ ```
33
+
34
+ No dependencies. Runs on Python 3.10+.
35
+
36
+ ---
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ python streamliner.py your_file.py
42
+ ```
43
+
44
+ This will:
45
+ 1. Analyze `your_file.py`
46
+ 2. Write the cleaned version in-place
47
+ 3. Print a full report of what was changed and what needs manual review
48
+ 4. Show a diff of every modification
49
+
50
+ **Preview changes without modifying anything:**
51
+
52
+ ```bash
53
+ python streamliner.py --dry-run your_file.py
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Example output
59
+
60
+ ```
61
+ ══════════════════════════════════════════
62
+ PyStreamliner Report
63
+ ══════════════════════════════════════════
64
+ File: main.py
65
+ Lines analyzed: 312
66
+
67
+ Auto-fixes applied:
68
+ Unused imports removed: 3
69
+ Duplicate lines removed: 1
70
+ Blank lines reduced: 2
71
+
72
+ Warnings (manual review needed):
73
+ Unused variables detected: 2
74
+ Unused functions detected: 1
75
+ Vague variable names: 1
76
+ ──────────────────────────────────────────
77
+
78
+ Unused imports removed:
79
+ • line 4: import os
80
+ • line 5: import sys
81
+ • line 7: from pathlib import Path, PurePath (partially cleaned: kept 'Path')
82
+
83
+ Unused variables:
84
+ ⚠ line 42: result
85
+ ⚠ line 87: temp_val
86
+
87
+ Vague variable names:
88
+ ⚠ line 23: tmp
89
+ ══════════════════════════════════════════
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Why not just use Black / isort / autoflake?
95
+
96
+ Those are great tools and pystreamliner doesn't replace them. The difference:
97
+
98
+ - **Black** formats style. pystreamliner removes dead code.
99
+ - **autoflake** removes unused imports but doesn't warn about unused variables, vague names, or dead functions.
100
+ - **pystreamliner** combines lightweight static analysis with conservative auto-fixing and a human-readable report — in a single file with zero dependencies.
101
+
102
+ ---
103
+
104
+ ## Contributing
105
+
106
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pystreamliner"
7
+ version = "1.3"
8
+ description = "A script to analyze and clean Python files"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+
12
+ [project.scripts]
13
+ pystreamliner = "streamliner:main"
14
+
15
+ [tool.setuptools.packages.find]
16
+ include = ["streamliner*"]
17
+ exclude = ["test_messy*", "tests*"]
18
+
19
+ [project.urls]
20
+ Homepage = "https://github.com"
21
+ Repository = "https://github.com"
22
+ Documentation = "https://github.com/wiki"
23
+
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: pystreamliner
3
+ Version: 1.3
4
+ Summary: A script to analyze and clean Python files
5
+ Project-URL: Homepage, https://github.com
6
+ Project-URL: Repository, https://github.com
7
+ Project-URL: Documentation, https://github.com/wiki
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Dynamic: license-file
12
+
13
+ # pystreamliner
14
+
15
+ [![PyPI version](https://img.shields.io/pypi/v/pystreamliner.svg)](https://pypi.org/project/pystreamliner/)
16
+ [![PyPI downloads](https://img.shields.io/pypi/dm/pystreamliner)](https://pypi.org/project/pystreamliner/)
17
+
18
+ **Automatically clean up messy Python files — without breaking anything.**
19
+
20
+ pystreamliner uses Python's AST (abstract syntax tree) to safely detect and fix common code issues. It operates on two tiers: things it can fix automatically with zero risk, and things it flags for you to review manually.
21
+
22
+ ---
23
+
24
+ ## What it does
25
+
26
+ **Auto-fixes (Tier 1 — applied immediately):**
27
+ - Removes unused imports, or trims partially unused `from x import y` statements
28
+ - Removes consecutive duplicate lines
29
+ - Caps excessive blank lines
30
+
31
+ **Warnings (Tier 2 — reported, never auto-changed):**
32
+ - Unused variables
33
+ - Unused top-level functions
34
+ - Vague variable names (`x`, `tmp`, `foo`, `bar`, etc.)
35
+
36
+ pystreamliner never touches code it isn't certain about. If there's any doubt, it warns you instead.
37
+
38
+ ---
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install pystreamliner
44
+ ```
45
+
46
+ No dependencies. Runs on Python 3.10+.
47
+
48
+ ---
49
+
50
+ ## Usage
51
+
52
+ ```bash
53
+ python streamliner.py your_file.py
54
+ ```
55
+
56
+ This will:
57
+ 1. Analyze `your_file.py`
58
+ 2. Write the cleaned version in-place
59
+ 3. Print a full report of what was changed and what needs manual review
60
+ 4. Show a diff of every modification
61
+
62
+ **Preview changes without modifying anything:**
63
+
64
+ ```bash
65
+ python streamliner.py --dry-run your_file.py
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Example output
71
+
72
+ ```
73
+ ══════════════════════════════════════════
74
+ PyStreamliner Report
75
+ ══════════════════════════════════════════
76
+ File: main.py
77
+ Lines analyzed: 312
78
+
79
+ Auto-fixes applied:
80
+ Unused imports removed: 3
81
+ Duplicate lines removed: 1
82
+ Blank lines reduced: 2
83
+
84
+ Warnings (manual review needed):
85
+ Unused variables detected: 2
86
+ Unused functions detected: 1
87
+ Vague variable names: 1
88
+ ──────────────────────────────────────────
89
+
90
+ Unused imports removed:
91
+ • line 4: import os
92
+ • line 5: import sys
93
+ • line 7: from pathlib import Path, PurePath (partially cleaned: kept 'Path')
94
+
95
+ Unused variables:
96
+ ⚠ line 42: result
97
+ ⚠ line 87: temp_val
98
+
99
+ Vague variable names:
100
+ ⚠ line 23: tmp
101
+ ══════════════════════════════════════════
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Why not just use Black / isort / autoflake?
107
+
108
+ Those are great tools and pystreamliner doesn't replace them. The difference:
109
+
110
+ - **Black** formats style. pystreamliner removes dead code.
111
+ - **autoflake** removes unused imports but doesn't warn about unused variables, vague names, or dead functions.
112
+ - **pystreamliner** combines lightweight static analysis with conservative auto-fixing and a human-readable report — in a single file with zero dependencies.
113
+
114
+ ---
115
+
116
+ ## Contributing
117
+
118
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,8 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ pystreamliner.egg-info/PKG-INFO
5
+ pystreamliner.egg-info/SOURCES.txt
6
+ pystreamliner.egg-info/dependency_links.txt
7
+ pystreamliner.egg-info/entry_points.txt
8
+ pystreamliner.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pystreamliner = streamliner:main
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+