pyofiles 0.1.0__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,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, windows-latest, macos-latest]
15
+ python-version: ['3.9', '3.13']
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - name: Build wheel
22
+ uses: PyO3/maturin-action@v1
23
+ with:
24
+ args: --release --out dist
25
+ - name: Install and test
26
+ run: |
27
+ pip install dist/*.whl
28
+ python -c "import pyofiles; print('walk:', len(pyofiles.walk('.'))); print('find:', len(pyofiles.find('.', extensions=['.rs']))); print('glob:', len(pyofiles.glob('.', '**/*.toml'))); print('list_dir:', len(pyofiles.list_dir('.'))); print('index:', len(pyofiles.index('.', ['.rs', '.toml']))); usage = pyofiles.disk_usage('.'); print(f'disk_usage: {usage.total_files} files, {usage.total_size_mb:.2f} MB'); print('All OK')"
29
+ shell: bash
@@ -0,0 +1,85 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ linux:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ target: [x86_64, aarch64]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: PyO3/maturin-action@v1
19
+ with:
20
+ target: ${{ matrix.target }}
21
+ args: --release --out dist -i python3.9 -i python3.10 -i python3.11 -i python3.12 -i python3.13
22
+ manylinux: auto
23
+ - uses: actions/upload-artifact@v4
24
+ with:
25
+ name: wheels-linux-${{ matrix.target }}
26
+ path: dist
27
+
28
+ windows:
29
+ runs-on: windows-latest
30
+ strategy:
31
+ matrix:
32
+ target: [x64]
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: PyO3/maturin-action@v1
36
+ with:
37
+ args: --release --out dist
38
+ - uses: actions/upload-artifact@v4
39
+ with:
40
+ name: wheels-windows-${{ matrix.target }}
41
+ path: dist
42
+
43
+ macos:
44
+ runs-on: macos-latest
45
+ strategy:
46
+ matrix:
47
+ target: [x86_64, aarch64]
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: PyO3/maturin-action@v1
51
+ with:
52
+ target: ${{ matrix.target }}-apple-darwin
53
+ args: --release --out dist
54
+ - uses: actions/upload-artifact@v4
55
+ with:
56
+ name: wheels-macos-${{ matrix.target }}
57
+ path: dist
58
+
59
+ sdist:
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: PyO3/maturin-action@v1
64
+ with:
65
+ command: sdist
66
+ args: --out dist
67
+ - uses: actions/upload-artifact@v4
68
+ with:
69
+ name: wheels-sdist
70
+ path: dist
71
+
72
+ publish:
73
+ needs: [linux, windows, macos, sdist]
74
+ runs-on: ubuntu-latest
75
+ environment: pypi
76
+ permissions:
77
+ id-token: write
78
+ steps:
79
+ - uses: actions/download-artifact@v4
80
+ with:
81
+ path: dist
82
+ merge-multiple: true
83
+ - uses: pypa/gh-action-pypi-publish@release/v1
84
+ with:
85
+ packages-dir: dist/
@@ -0,0 +1,44 @@
1
+ # Rust
2
+ /target
3
+ Cargo.lock
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.egg-info/
10
+ *.egg
11
+ dist/
12
+ build/
13
+ *.whl
14
+ *.so
15
+ *.pyd
16
+ *.dll
17
+
18
+ # Maturin
19
+ target/
20
+
21
+ # Virtual environments
22
+ .venv/
23
+ venv/
24
+ env/
25
+
26
+ # IDE
27
+ .vscode/
28
+ .idea/
29
+ *.swp
30
+ *.swo
31
+ .vs/
32
+
33
+ # OS
34
+ .DS_Store
35
+ desktop.ini
36
+ Thumbs.db
37
+
38
+ # References (local only)
39
+ references/
40
+
41
+ # Misc
42
+ *.log
43
+
44
+ .claude/
@@ -0,0 +1,356 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.4"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.0"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
19
+
20
+ [[package]]
21
+ name = "bstr"
22
+ version = "1.12.1"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab"
25
+ dependencies = [
26
+ "memchr",
27
+ "serde",
28
+ ]
29
+
30
+ [[package]]
31
+ name = "crossbeam"
32
+ version = "0.8.4"
33
+ source = "registry+https://github.com/rust-lang/crates.io-index"
34
+ checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8"
35
+ dependencies = [
36
+ "crossbeam-channel",
37
+ "crossbeam-deque",
38
+ "crossbeam-epoch",
39
+ "crossbeam-queue",
40
+ "crossbeam-utils",
41
+ ]
42
+
43
+ [[package]]
44
+ name = "crossbeam-channel"
45
+ version = "0.5.15"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
48
+ dependencies = [
49
+ "crossbeam-utils",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "crossbeam-deque"
54
+ version = "0.8.6"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
57
+ dependencies = [
58
+ "crossbeam-epoch",
59
+ "crossbeam-utils",
60
+ ]
61
+
62
+ [[package]]
63
+ name = "crossbeam-epoch"
64
+ version = "0.9.18"
65
+ source = "registry+https://github.com/rust-lang/crates.io-index"
66
+ checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
67
+ dependencies = [
68
+ "crossbeam-utils",
69
+ ]
70
+
71
+ [[package]]
72
+ name = "crossbeam-queue"
73
+ version = "0.3.12"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115"
76
+ dependencies = [
77
+ "crossbeam-utils",
78
+ ]
79
+
80
+ [[package]]
81
+ name = "crossbeam-utils"
82
+ version = "0.8.21"
83
+ source = "registry+https://github.com/rust-lang/crates.io-index"
84
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
85
+
86
+ [[package]]
87
+ name = "either"
88
+ version = "1.15.0"
89
+ source = "registry+https://github.com/rust-lang/crates.io-index"
90
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
91
+
92
+ [[package]]
93
+ name = "globset"
94
+ version = "0.4.18"
95
+ source = "registry+https://github.com/rust-lang/crates.io-index"
96
+ checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
97
+ dependencies = [
98
+ "aho-corasick",
99
+ "bstr",
100
+ "log",
101
+ "regex-automata",
102
+ "regex-syntax",
103
+ ]
104
+
105
+ [[package]]
106
+ name = "heck"
107
+ version = "0.5.0"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
110
+
111
+ [[package]]
112
+ name = "indoc"
113
+ version = "2.0.7"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
116
+ dependencies = [
117
+ "rustversion",
118
+ ]
119
+
120
+ [[package]]
121
+ name = "jwalk"
122
+ version = "0.8.1"
123
+ source = "registry+https://github.com/rust-lang/crates.io-index"
124
+ checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56"
125
+ dependencies = [
126
+ "crossbeam",
127
+ "rayon",
128
+ ]
129
+
130
+ [[package]]
131
+ name = "libc"
132
+ version = "0.2.183"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
135
+
136
+ [[package]]
137
+ name = "log"
138
+ version = "0.4.29"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
141
+
142
+ [[package]]
143
+ name = "memchr"
144
+ version = "2.8.0"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
147
+
148
+ [[package]]
149
+ name = "memoffset"
150
+ version = "0.9.1"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
153
+ dependencies = [
154
+ "autocfg",
155
+ ]
156
+
157
+ [[package]]
158
+ name = "once_cell"
159
+ version = "1.21.4"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
162
+
163
+ [[package]]
164
+ name = "portable-atomic"
165
+ version = "1.13.1"
166
+ source = "registry+https://github.com/rust-lang/crates.io-index"
167
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
168
+
169
+ [[package]]
170
+ name = "proc-macro2"
171
+ version = "1.0.106"
172
+ source = "registry+https://github.com/rust-lang/crates.io-index"
173
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
174
+ dependencies = [
175
+ "unicode-ident",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "pyo3"
180
+ version = "0.27.2"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d"
183
+ dependencies = [
184
+ "indoc",
185
+ "libc",
186
+ "memoffset",
187
+ "once_cell",
188
+ "portable-atomic",
189
+ "pyo3-build-config",
190
+ "pyo3-ffi",
191
+ "pyo3-macros",
192
+ "unindent",
193
+ ]
194
+
195
+ [[package]]
196
+ name = "pyo3-build-config"
197
+ version = "0.27.2"
198
+ source = "registry+https://github.com/rust-lang/crates.io-index"
199
+ checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
200
+ dependencies = [
201
+ "target-lexicon",
202
+ ]
203
+
204
+ [[package]]
205
+ name = "pyo3-ffi"
206
+ version = "0.27.2"
207
+ source = "registry+https://github.com/rust-lang/crates.io-index"
208
+ checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089"
209
+ dependencies = [
210
+ "libc",
211
+ "pyo3-build-config",
212
+ ]
213
+
214
+ [[package]]
215
+ name = "pyo3-macros"
216
+ version = "0.27.2"
217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
218
+ checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02"
219
+ dependencies = [
220
+ "proc-macro2",
221
+ "pyo3-macros-backend",
222
+ "quote",
223
+ "syn",
224
+ ]
225
+
226
+ [[package]]
227
+ name = "pyo3-macros-backend"
228
+ version = "0.27.2"
229
+ source = "registry+https://github.com/rust-lang/crates.io-index"
230
+ checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9"
231
+ dependencies = [
232
+ "heck",
233
+ "proc-macro2",
234
+ "pyo3-build-config",
235
+ "quote",
236
+ "syn",
237
+ ]
238
+
239
+ [[package]]
240
+ name = "pyofiles"
241
+ version = "0.1.0"
242
+ dependencies = [
243
+ "globset",
244
+ "jwalk",
245
+ "pyo3",
246
+ ]
247
+
248
+ [[package]]
249
+ name = "quote"
250
+ version = "1.0.45"
251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
252
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
253
+ dependencies = [
254
+ "proc-macro2",
255
+ ]
256
+
257
+ [[package]]
258
+ name = "rayon"
259
+ version = "1.11.0"
260
+ source = "registry+https://github.com/rust-lang/crates.io-index"
261
+ checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
262
+ dependencies = [
263
+ "either",
264
+ "rayon-core",
265
+ ]
266
+
267
+ [[package]]
268
+ name = "rayon-core"
269
+ version = "1.13.0"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
272
+ dependencies = [
273
+ "crossbeam-deque",
274
+ "crossbeam-utils",
275
+ ]
276
+
277
+ [[package]]
278
+ name = "regex-automata"
279
+ version = "0.4.14"
280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
281
+ checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
282
+ dependencies = [
283
+ "aho-corasick",
284
+ "memchr",
285
+ "regex-syntax",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "regex-syntax"
290
+ version = "0.8.10"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
293
+
294
+ [[package]]
295
+ name = "rustversion"
296
+ version = "1.0.22"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
299
+
300
+ [[package]]
301
+ name = "serde"
302
+ version = "1.0.228"
303
+ source = "registry+https://github.com/rust-lang/crates.io-index"
304
+ checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
305
+ dependencies = [
306
+ "serde_core",
307
+ ]
308
+
309
+ [[package]]
310
+ name = "serde_core"
311
+ version = "1.0.228"
312
+ source = "registry+https://github.com/rust-lang/crates.io-index"
313
+ checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
314
+ dependencies = [
315
+ "serde_derive",
316
+ ]
317
+
318
+ [[package]]
319
+ name = "serde_derive"
320
+ version = "1.0.228"
321
+ source = "registry+https://github.com/rust-lang/crates.io-index"
322
+ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
323
+ dependencies = [
324
+ "proc-macro2",
325
+ "quote",
326
+ "syn",
327
+ ]
328
+
329
+ [[package]]
330
+ name = "syn"
331
+ version = "2.0.117"
332
+ source = "registry+https://github.com/rust-lang/crates.io-index"
333
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
334
+ dependencies = [
335
+ "proc-macro2",
336
+ "quote",
337
+ "unicode-ident",
338
+ ]
339
+
340
+ [[package]]
341
+ name = "target-lexicon"
342
+ version = "0.13.5"
343
+ source = "registry+https://github.com/rust-lang/crates.io-index"
344
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
345
+
346
+ [[package]]
347
+ name = "unicode-ident"
348
+ version = "1.0.24"
349
+ source = "registry+https://github.com/rust-lang/crates.io-index"
350
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
351
+
352
+ [[package]]
353
+ name = "unindent"
354
+ version = "0.2.4"
355
+ source = "registry+https://github.com/rust-lang/crates.io-index"
356
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
@@ -0,0 +1,14 @@
1
+ [package]
2
+ name = "pyofiles"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ readme = "README.md"
6
+
7
+ [lib]
8
+ name = "pyofiles"
9
+ crate-type = ["cdylib"]
10
+
11
+ [dependencies]
12
+ pyo3 = { version = "0.27", features = ["extension-module"] }
13
+ jwalk = "0.8"
14
+ globset = "0.4"
pyofiles-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pyofiles contributors
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 all
13
+ 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 THE
21
+ SOFTWARE.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyofiles
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: Implementation :: CPython
9
+ Classifier: Programming Language :: Rust
10
+ Classifier: Topic :: System :: Filesystems
11
+ License-File: LICENSE
12
+ Summary: Fast, Rust-powered file operations for Python
13
+ Keywords: files,filesystem,rust,fast,parallel,walk,find,glob
14
+ License-Expression: MIT
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
17
+
18
+ # pyofiles
19
+
20
+ Fast, Rust-powered file operations for Python. Drop-in replacements for `os.walk`, `os.listdir`, and `glob.glob` -- built on parallel directory walkers for maximum speed.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ pip install pyofiles
26
+ ```
27
+
28
+ ## Functions
29
+
30
+ ### `walk(directory, extensions=None, skip_hidden=False, max_depth=None)`
31
+ Parallel recursive directory walk. Returns `list[FileEntry]`.
32
+
33
+ ```python
34
+ import pyofiles
35
+
36
+ # Walk everything
37
+ entries = pyofiles.walk("/path/to/dir")
38
+
39
+ # Only Python files
40
+ entries = pyofiles.walk("/path", extensions=[".py"])
41
+
42
+ for e in entries:
43
+ if e.is_file:
44
+ print(f"{e.name} ({e.size} bytes)")
45
+ ```
46
+
47
+ ### `find(directory, names=None, extensions=None, min_size_mb=None, max_size_mb=None, ...)`
48
+ Search for files by name substrings, extensions, and size. Accepts **multiple substrings** -- a file matches if its name contains ANY of them (case-insensitive).
49
+
50
+ ```python
51
+ # Find files containing "report" or "invoice" in the name
52
+ results = pyofiles.find("/data", names=["report", "invoice"])
53
+
54
+ # Find large videos
55
+ results = pyofiles.find("/media", extensions=[".mp4", ".avi"], min_size_mb=100)
56
+
57
+ # Combine: name + extension + size
58
+ results = pyofiles.find("/docs", names=["2024"], extensions=[".pdf"], max_size_mb=50)
59
+ ```
60
+
61
+ ### `list_dir(directory)`
62
+ Non-recursive single-directory listing. Returns `list[FileEntry]`.
63
+
64
+ ```python
65
+ entries = pyofiles.list_dir("/path")
66
+ ```
67
+
68
+ ### `index(directory, extensions, skip_hidden=False)`
69
+ Build a file index grouped by filename stem. Useful for finding related files with different extensions.
70
+
71
+ ```python
72
+ idx = pyofiles.index("/src", extensions=[".py", ".pyi", ".pyc"])
73
+ # {"main": {".py": "/src/main.py", ".pyc": "/src/__pycache__/main.pyc"}}
74
+ ```
75
+
76
+ ### `glob(directory, pattern, skip_hidden=False)`
77
+ Parallel glob pattern matching. Returns `list[str]` of full paths.
78
+
79
+ ```python
80
+ paths = pyofiles.glob("/project", "**/*.py")
81
+ paths = pyofiles.glob("/project", "src/**/*.{rs,toml}")
82
+ ```
83
+
84
+ ### `disk_usage(directory, depth=1, top=20, skip_hidden=False)`
85
+ Analyze disk space usage by directory. Returns a `DiskUsage` object.
86
+
87
+ ```python
88
+ usage = pyofiles.disk_usage("/home", depth=2, top=10)
89
+ print(f"Total: {usage.total_size_gb:.2f} GB across {usage.total_files} files")
90
+ for entry in usage.entries:
91
+ print(f" {entry.path}: {entry.size_mb:.1f} MB ({entry.file_count} files)")
92
+ ```
93
+
94
+ ## Types
95
+
96
+ ### `FileEntry`
97
+ Returned by `walk`, `find`, `list_dir`.
98
+
99
+ | Attribute | Type |
100
+ |-------------|--------|
101
+ | `path` | `str` |
102
+ | `name` | `str` |
103
+ | `is_file` | `bool` |
104
+ | `is_dir` | `bool` |
105
+ | `size` | `int` |
106
+ | `extension` | `str` |
107
+
108
+ ### `SizeEntry`
109
+ Returned inside `DiskUsage.entries`.
110
+
111
+ | Attribute | Type |
112
+ |--------------|---------|
113
+ | `path` | `str` |
114
+ | `size` | `int` |
115
+ | `file_count` | `int` |
116
+ | `size_mb` | `float` |
117
+ | `size_gb` | `float` |
118
+
119
+ ### `DiskUsage`
120
+ Returned by `disk_usage`.
121
+
122
+ | Attribute | Type |
123
+ |-----------------|-------------------|
124
+ | `entries` | `list[SizeEntry]` |
125
+ | `total_size` | `int` |
126
+ | `total_files` | `int` |
127
+ | `total_size_mb` | `float` |
128
+ | `total_size_gb` | `float` |
129
+
130
+ ## Performance
131
+
132
+ Built on [jwalk](https://crates.io/crates/jwalk) (parallel directory walker) and [PyO3](https://pyo3.rs). Typically **5-50x faster** than equivalent Python code, especially on large directories and network drives.
133
+
134
+ ## License
135
+
136
+ MIT
137
+