Skip to main content

Fast, Rust-powered file operations for Python

Project description

pyofiles

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.

Install

pip install pyofiles

Functions

walk(directory, extensions=None, skip_hidden=False, max_depth=None)

Parallel recursive directory walk. Returns list[FileEntry].

import pyofiles

# Walk everything
entries = pyofiles.walk("/path/to/dir")

# Only Python files
entries = pyofiles.walk("/path", extensions=[".py"])

for e in entries:
    if e.is_file:
        print(f"{e.name} ({e.size} bytes)")

find(directory, names=None, extensions=None, min_size_mb=None, max_size_mb=None, ...)

Search for files by name substrings, extensions, and size. Accepts multiple substrings -- a file matches if its name contains ANY of them (case-insensitive).

# Find files containing "report" or "invoice" in the name
results = pyofiles.find("/data", names=["report", "invoice"])

# Find large videos
results = pyofiles.find("/media", extensions=[".mp4", ".avi"], min_size_mb=100)

# Combine: name + extension + size
results = pyofiles.find("/docs", names=["2024"], extensions=[".pdf"], max_size_mb=50)

list_dir(directory)

Non-recursive single-directory listing. Returns list[FileEntry].

entries = pyofiles.list_dir("/path")

index(directory, extensions, skip_hidden=False)

Build a file index grouped by filename stem. Useful for finding related files with different extensions.

idx = pyofiles.index("/src", extensions=[".py", ".pyi", ".pyc"])
# {"main": {".py": "/src/main.py", ".pyc": "/src/__pycache__/main.pyc"}}

glob(directory, pattern, skip_hidden=False)

Parallel glob pattern matching. Returns list[str] of full paths.

paths = pyofiles.glob("/project", "**/*.py")
paths = pyofiles.glob("/project", "src/**/*.{rs,toml}")

disk_usage(directory, depth=1, top=20, skip_hidden=False)

Analyze disk space usage by directory. Returns a DiskUsage object.

usage = pyofiles.disk_usage("/home", depth=2, top=10)
print(f"Total: {usage.total_size_gb:.2f} GB across {usage.total_files} files")
for entry in usage.entries:
    print(f"  {entry.path}: {entry.size_mb:.1f} MB ({entry.file_count} files)")

Types

FileEntry

Returned by walk, find, list_dir.

Attribute Type
path str
name str
is_file bool
is_dir bool
size int
extension str

SizeEntry

Returned inside DiskUsage.entries.

Attribute Type
path str
size int
file_count int
size_mb float
size_gb float

DiskUsage

Returned by disk_usage.

Attribute Type
entries list[SizeEntry]
total_size int
total_files int
total_size_mb float
total_size_gb float

Performance

Built on jwalk (parallel directory walker) and PyO3. Typically 5-50x faster than equivalent Python code, especially on large directories and network drives.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyofiles-0.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyofiles-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (845.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyofiles-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl (902.0 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

pyofiles-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pyofiles-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (928.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

pyofiles-0.1.0-cp312-cp312-win_amd64.whl (741.3 kB view details)

Uploaded CPython 3.12Windows x86-64

pyofiles-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyofiles-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (928.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

pyofiles-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (976.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyofiles-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (930.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

pyofiles-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (976.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyofiles-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (930.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

pyofiles-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (978.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyofiles-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (932.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

File details

Details for the file pyofiles-0.1.0.tar.gz.

File metadata

  • Download URL: pyofiles-0.1.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyofiles-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43fce8637bf97cb7bb04f2c63b156264dec8dc03fd2ee1ec672a3adba1121ffc
MD5 257d820cf5341bc9784859f0c0118049
BLAKE2b-256 827c004b02ab495a075e1e079c9fd45f9fcac6403426f1249491e48d61b69918

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0.tar.gz:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4a4bfc86701c8286369d0524c46b09a4c89c314db3f436cdc50b8de759b8e81
MD5 5effa08068c40fb12c7e4df24254cef3
BLAKE2b-256 7e484e5432afa46eee23d9924aaf34f36faaea48f531267f3bce760bb40dd3f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b784c6fbcc71d5c6492e96fece92aaf221cdec5ce5308b955958f76f3565313f
MD5 751d01f03c60dbcb85868e81b6c9f157
BLAKE2b-256 54b9139cbd043a0ac51ca1490b58930f0694fc21b4a1df943216848244eb0831

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ea71270d360d2804ee7fe5eff0660a74d6f6b103d7cd9d19371c5d9e622a870
MD5 06fe0e90f9cb85e60c6c7ec4dc81880c
BLAKE2b-256 9d04bceaab5b2092f8ba95404c142a59f16b9f7399809f27b5befbda43db8d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed80ed7b86a87932f40061f9cac405be4293dd60461761c7c30a099d52bb68f5
MD5 271a860ce2fcbf728190b9b2e293c0ae
BLAKE2b-256 dd3fe00d95e5c750be565e5667f480fbad2d069f09c91857544dc5150a5216db

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyofiles-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 741.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyofiles-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3837963b264b74f3e75c19abc551a3e461babcfde6f6bebf5581439419611584
MD5 0a9e8ee20d099848cd2fd318277e376b
BLAKE2b-256 6ffae8f9d8daa3db2e6d34de3ed047e7c395db62d389369a63eb1630241a35b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0964b7f13759653c18d3436b22a9a9456ceb0c09c66810bd442be4b233a02628
MD5 82a6f92e75a189628876710fb9b2718e
BLAKE2b-256 44f4f640b06cd9f227f3836f1a62a9f54ecc6e3f7d72f55e0051295f3b078313

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ea3db0149a6138f60ee57ad79369abfa2a9869d4315b9ea9821aad61ca39a4c9
MD5 5641144ae1cb41f6526f787680075353
BLAKE2b-256 58b466cba7dbcfdf4996df4af729bf6ff0c3cc0839be08ba4518c766a969df18

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c8e61b5df830ddb2e3d353a819d683cfd31e840af2803b4af26e9aa9d144c90
MD5 fb3592ac9cca7add740fddf20f052516
BLAKE2b-256 8489dc6999bb1effbc8032d91639859c974f9e8ca561731dba11ddab11c53129

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 93827603b6eeaa57ffbfa4e565839de28e4cf95df21479c7904a395898e838b4
MD5 c73e89d35161deb93f28e44013363cbb
BLAKE2b-256 f57790a25a1f33ef5e1aadd0d504f3a262f1fa14e4319980ccc547c4260c2a63

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 570be14bc41b9f74a08adda3e1e5e69f13c0ed1a69be30619406c2d0b3340c23
MD5 893e9e462bb13768303ca7e55048d01e
BLAKE2b-256 9b84a562472eed06425f1b618f34cc901d57e959ceaa66e1ef8e25ade1de686e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3ec8da801a5efc47a9c26d11f3ca3009bc90f7484f91da723c2b54edfa55fa1f
MD5 0cbe1c7594a280a51cff3f640ae7015e
BLAKE2b-256 cd80f3fc5a139d81163e9ac6233068eba60c481619842332cccd242a1d66d117

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbcc93cd3f7f90b69636881fd7d352c6774fee99b578be139127c03f73f76e4b
MD5 d45247414ae9f148ea589295fa4b50cf
BLAKE2b-256 e71b5339d37b00fa4a497a3c1733556e1e87108a5a5a1f5f1d43254c10d5f88e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyofiles-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyofiles-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6d5057003a63e6b3d79d5dfcac55c37e44d3e583dd290f74afb6b35905796119
MD5 0aa35b3ec38fa15f3a544b41e64c2187
BLAKE2b-256 ca24b0122b863f54a8c2aef81fe00db9f8484b0b5bcefef31de757e544b8e90e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyofiles-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on lperezmo/pyofiles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page