onepaste 1.3.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.
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.5
2
+ Name: onepaste
3
+ Version: 1.3.0
4
+ Summary: Collect project code files into a single output for AI assistants
5
+ Project-URL: Homepage, https://github.com/emVisible/codecollector
6
+ Project-URL: Repository, https://github.com/emVisible/codecollector.git
7
+ Project-URL: Issues, https://github.com/emVisible/codecollector/issues
8
+ Author: emVisible
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,cli,code,collector,context,developer-tools,llm,prompt
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Software Development :: Code Generators
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.8
25
+ Requires-Dist: questionary>=2.0.0
26
+ Requires-Dist: rich>=13.0.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: black>=23.0; extra == 'dev'
29
+ Requires-Dist: mypy>=1.0; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
33
+ Requires-Dist: tiktoken>=0.5; extra == 'dev'
34
+ Provides-Extra: tokens
35
+ Requires-Dist: tiktoken>=0.5; extra == 'tokens'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # CodeCollector
39
+
40
+ Collect project code into LLM-ready Markdown. Select a directory, press Enter, copy and paste.
41
+
42
+ ## Installation
43
+
44
+ ### pipx (recommended)
45
+
46
+ ```bash
47
+ brew install pipx
48
+ pipx ensurepath
49
+ pipx install onepaste
50
+
51
+ # Optional: exact token counting via tiktoken
52
+ pipx install "onepaste[tokens]"
53
+ ```
54
+
55
+ Without the `tokens` extra, token counts use a fast characters/4 estimate.
56
+
57
+ ### From source (for development)
58
+
59
+ ```bash
60
+ git clone https://github.com/emVisible/codecollector.git
61
+ cd codecollector
62
+ pipx install -e .
63
+ ```
64
+
65
+ ### Uninstall / reinstall (for updates & debugging)
66
+
67
+ ```bash
68
+ # Uninstall package
69
+ collect --uninstall
70
+
71
+ # Uninstall and remove ~/.config/codecollector
72
+ collect --uninstall --purge-config
73
+
74
+ # Reinstall editable from local source
75
+ cd /path/to/CodeCollector
76
+ pipx install -e .
77
+ ```
78
+
79
+ ## Quick Start
80
+
81
+ ```bash
82
+ # Interactive: navigate to folder → select "Collect this directory" → Enter
83
+ collect
84
+
85
+ # Collect current directory (.gitignore filtering on automatically inside git repos)
86
+ collect .
87
+
88
+ # Pipe straight into another tool — no file written
89
+ collect . --stdout | llm "Explain what this project does"
90
+
91
+ # Only TypeScript sources, skip tests
92
+ collect . --include "src/**/*.ts" --exclude-pattern "*.test.ts"
93
+ ```
94
+
95
+ Output is a single Markdown file (`code_collection.md`) ready to copy-paste into any LLM.
96
+
97
+ ## Usage
98
+
99
+ ```bash
100
+ # Interactive mode
101
+ collect
102
+ collect -i # force .gitignore filter (deprecated: auto inside git)
103
+
104
+ # Collect a specific directory
105
+ collect /path/to/project
106
+ collect . --no-gitignore # include gitignored files too
107
+
108
+ # Non-recursive (current directory only)
109
+ collect . -n
110
+
111
+ # Custom output
112
+ collect . -o my_project.md
113
+ collect . -d ./collected
114
+
115
+ # Glob filtering (repeatable)
116
+ collect . --include "src/**"
117
+ collect . --include "*.py" --include "*.md"
118
+ collect . --exclude-pattern "*.min.js" --exclude-pattern "tests/*"
119
+
120
+ # Split large output (default: 2MB per part)
121
+ collect . --max-output-size 5
122
+
123
+ # Preview without writing
124
+ collect . --dry-run
125
+
126
+ # Extra exclusions
127
+ collect . --exclude vendor --exclude tmp
128
+ ```
129
+
130
+ ## Options
131
+
132
+ | Option | Description |
133
+ | ---------------------------- | ---------------------------------------------------------------------------------- |
134
+ | `path` | Directory to collect (default: interactive picker) |
135
+ | `-i` | Force-enable `.gitignore` filtering (deprecated alias; see below) |
136
+ | `--no-gitignore` | Disable `.gitignore` filtering |
137
+ | `-n, --non-recursive` | Only current directory, skip subdirectories |
138
+ | `-o, --output` | Output filename (default: `code_collection.md`) |
139
+ | `-d, --output-dir` | Output directory (default: current working directory) |
140
+ | `--max-output-size MB` | Max output size per file; auto-split when exceeded (default: 2) |
141
+ | `--exclude DIR` | Extra directory to exclude (repeatable) |
142
+ | `--include GLOB` | Only collect files matching glob (repeatable; overrides extension whitelist) |
143
+ | `--exclude-pattern GLOB` | Skip files matching glob (repeatable) |
144
+ | `--stdout` | Write collection to stdout; progress goes to stderr; no file written |
145
+ | `--dry-run` | Preview collection without writing output |
146
+ | `--force` | Overwrite existing output instead of auto-incrementing |
147
+ | `--config` | Path to config file (merged with global config) |
148
+ | `--init-config` | Generate default config at `~/.config/codecollector/config.json` |
149
+ | `--uninstall` | Uninstall codecollector via pipx and/or pip |
150
+ | `--purge-config` | Also remove `~/.config/codecollector` (with `--uninstall`) |
151
+ | `-v, --version` | Show version |
152
+ | `-h, --help` | Show help |
153
+
154
+ ### .gitignore defaults
155
+
156
+ Inside a git work tree, `.gitignore` filtering is **on by default**. Outside git repos it is off.
157
+ Explicit flags win over the default: `-i` forces it on, `--no-gitignore` forces it off.
158
+ (`-i` used to be required to enable filtering; it still works but the default has changed.)
159
+
160
+ ### Glob patterns
161
+
162
+ `--include` / `--exclude-pattern` match against paths relative to the collected root using
163
+ [fnmatch](https://docs.python.org/3/library/fnmatch.html) semantics:
164
+
165
+ | Pattern | Matches |
166
+ | ---------------- | --------------------------------------------------- |
167
+ | `*.py` | any `.py` file anywhere |
168
+ | `src/**` | everything under `src/` |
169
+ | `tests/*` | files directly inside `tests/` |
170
+ | `*_test.go` | Go test files anywhere |
171
+
172
+ When `--include` patterns are given they **replace** the extension whitelist — you get exactly
173
+ the matched files (still respecting excludes, size limits and binary detection).
174
+
175
+ ### Token counting
176
+
177
+ Summaries show total tokens plus per-file counts, with a Top-10 table of the largest files.
178
+ With the optional `tokens` extra installed, counts are exact (`tiktoken`, `o200k_base`);
179
+ otherwise an estimate (~4 chars/token) is shown and labelled as such.
180
+
181
+ ## Output Format
182
+
183
+ All output is **detailed Markdown** optimized for LLM consumption:
184
+
185
+ - Summary with metadata, token totals, top files by tokens, directory tree, and file list
186
+ - Each source file as a `###` heading with line count, size, tokens, and a fenced code block
187
+ (fences auto-lengthen so source containing backticks never breaks rendering)
188
+ - Auto-split into parts for large projects, each with `Part X of N` header
189
+
190
+ ## Output Behavior
191
+
192
+ ### Auto-increment (no overwrite)
193
+
194
+ If `code_collection.md` already exists, the next run writes to `code_collection_1.md`, then `_2.md`, etc.
195
+
196
+ Use `--force` to overwrite.
197
+
198
+ ### Auto-split
199
+
200
+ When output exceeds the size limit, files are split at source-file boundaries. A manifest JSON is written alongside multi-part output.
201
+
202
+ `--stdout` never splits; it warns on stderr if the limit would have been exceeded.
203
+ It also requires an explicit `path` — the interactive picker would otherwise mix its
204
+ own output into the piped stream.
205
+
206
+ ## Configuration
207
+
208
+ ```bash
209
+ collect --init-config
210
+ ```
211
+
212
+ Edit `~/.config/codecollector/config.json`:
213
+
214
+ ```json
215
+ {
216
+ "exclude_dirs": [
217
+ "node_modules",
218
+ ".git",
219
+ "__pycache__",
220
+ "venv",
221
+ "dist",
222
+ "build"
223
+ ],
224
+ "include_extensions": [".py", ".js", ".ts", ".go", ".rs", ".java"],
225
+ "include_patterns": [],
226
+ "exclude_patterns": [],
227
+ "max_file_size_mb": 5.0,
228
+ "max_output_size_mb": 2.0,
229
+ "auto_increment_output": true,
230
+ "write_manifest": true
231
+ }
232
+ ```
233
+
234
+ `.gitignore` filtering is intentionally not stored in the config file — it resolves
235
+ automatically per run (on inside git work trees) unless overridden by `-i` or
236
+ `--no-gitignore`.
237
+
238
+ ## Requirements
239
+
240
+ - Python 3.8+
241
+ - pipx (for installation)
@@ -0,0 +1,17 @@
1
+ codecollector/__init__.py,sha256=DRtzgke5Y6Q3e2WYXjns38g2PQ4eMI9vENa0122fuFo,294
2
+ codecollector/__main__.py,sha256=0-xhMaaMJ6PJN8eMH8EsnJQ8-dPGr9KwtgicQ7iol7g,116
3
+ codecollector/cli.py,sha256=uzvUEySPxHqvSz9JoUgGXXH73QFfNdmTyzrbvEuJthE,20937
4
+ codecollector/collector.py,sha256=mslgqRt6rPfxWsVA19XfAxUSAd46-IEYO-UsEU9n6QM,8744
5
+ codecollector/config.py,sha256=_nQZ08VEcz29bHF362LErihUpuW_vmrY0aUShlkuXjI,5271
6
+ codecollector/formatter.py,sha256=iwMBcY4K79n7fG5bFTFScFthPjNwNsn-4cRK7VLsK-0,6723
7
+ codecollector/gitignore.py,sha256=6gn8-6zns12k4oNf79Ztpf5k2u5lpQFUQOLZBO8bQws,5078
8
+ codecollector/output.py,sha256=wVFl2zwDN7CueLN2T4pVgqxludl_8_3aLKNKU5t42F0,1811
9
+ codecollector/selector.py,sha256=bxRjihH23VCDegG7qvt7qqvSCKTIqqVSNDprUxBgC6U,3974
10
+ codecollector/splitter.py,sha256=G_ULLZZMfGSawyDpNjQ8dufQiVKdDzaf0hIEk-Gms8c,4062
11
+ codecollector/tokens.py,sha256=o4MYi4Hnq4w24PV9yRXccqg-cWpJlsQZiM4inWyAapk,1651
12
+ codecollector/uninstall.py,sha256=PG9taITRtuQvJRPBYl2GgTuz2PtPHaFgLtDaoncMCYg,3415
13
+ onepaste-1.3.0.dist-info/METADATA,sha256=zbF2MNi_OfW1LiXSd-b-ABMMgL66EtpxOsm-ExNUly8,9104
14
+ onepaste-1.3.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
15
+ onepaste-1.3.0.dist-info/entry_points.txt,sha256=1tXkvu6rGR7aGcqvTal7w0DDIFzIxYVMRFnJ2mGCWmc,51
16
+ onepaste-1.3.0.dist-info/licenses/LICENSE,sha256=5pK0Vz4RfP3iXLaF1qsqpHD8-r4JzMnIG1qNLJUI5bs,1066
17
+ onepaste-1.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ collect = codecollector.cli:main
@@ -0,0 +1,22 @@
1
+
2
+ MIT License
3
+
4
+ Copyright (c) 2024 Your Name
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.