Skip to main content

Modular Python tool for profiling files, analyzing directory structures, and inspecting image data

Project description

filoma

PyPI version Code style: ruff Contributions welcome Tests

Fast, multi-backend Python tool for directory analysis and file profiling.

Analyze directory structures, profile files, and inspect image data with automatic performance optimization through Rust, fd, or Python backends.


Documentation: InstallationBackendsAdvanced UsageBenchmarks

Source Code: https://github.com/kalfasyan/filoma


Quick Start

# Install
uv add filoma  # or: pip install filoma
from filoma.directories import DirectoryProfiler

# Analyze any directory (automatically uses fastest backend)
profiler = DirectoryProfiler()
result = profiler.analyze("/path/to/directory")

# Beautiful terminal output
profiler.print_summary(result)
# Directory Analysis: /path (🦀 Rust) - 2.3s, 15,249 files, 1,847 folders

# Access data programmatically  
print(f"Files: {result['summary']['total_files']}")
print(f"Extensions: {result['file_extensions']}")

Key Features

  • 🚀 3 Performance Backends - Automatic selection: Rust (2.5x faster), fd (competitive), Python (universal)
  • 📊 Directory Analysis - File counts, extensions, empty folders, depth distribution, size statistics
  • 🔍 Smart File Search - Advanced patterns with regex/glob support via FdSearcher
  • 📈 DataFrame Support - Build Polars DataFrames for advanced analysis and filtering
  • 🖼️ Image Analysis - Profile .tif, .png, .npy, .zarr files with metadata and statistics
  • 📁 File Profiling - System metadata, permissions, timestamps, symlink analysis
  • 🎨 Rich Terminal Output - Beautiful progress bars and formatted reports

Examples

Directory Analysis

from filoma.directories import DirectoryProfiler

# Basic analysis
profiler = DirectoryProfiler()
result = profiler.analyze("/path/to/directory", max_depth=3)
profiler.print_summary(result)

# Access specific data
print(f"📁 Files: {result['summary']['total_files']}")
print(f"📂 Folders: {result['summary']['total_folders']}")
print(f"🗂️ Empty folders: {result['summary']['empty_folder_count']}")
print(f"📄 Extensions: {result['file_extensions']}")

Smart File Search

from filoma.directories import FdSearcher

searcher = FdSearcher()

# Find Python files
python_files = searcher.find_files(pattern=r"\.py$", max_depth=2)

# Find by multiple extensions
code_files = searcher.find_by_extension(['py', 'rs', 'js'], directory=".")

# Glob patterns
config_files = searcher.find_files(pattern="*.{json,yaml}", use_glob=True)

DataFrame Analysis

# Build DataFrame for advanced analysis
profiler = DirectoryProfiler(build_dataframe=True)
result = profiler.analyze(".")
df = profiler.get_dataframe(result)

# Add path components and analyze
df = df.add_path_components().add_file_stats()
python_files = df.filter_by_extension('.py')
df.save_csv("analysis.csv")

File & Image Profiling

from filoma.files import FileProfiler
from filoma.images import PngProfiler

# File metadata
file_profiler = FileProfiler()
report = file_profiler.profile("/path/to/file.txt")
file_profiler.print_report(report)

# Image analysis
img_profiler = PngProfiler()
img_report = img_profiler.analyze("/path/to/image.png")
print(img_report)  # Shape, dtype, stats, etc.

Performance

Automatic backend selection for optimal speed:

Backend Speed Use Case
🦀 Rust ~70K files/sec Large directories, DataFrame building
🔍 fd ~46K files/sec Pattern matching, network filesystems
🐍 Python ~30K files/sec Universal compatibility, reliable fallback

Cold cache benchmarks on NVMe SSD. See benchmarks for detailed methodology.

System directories: filoma automatically handles permission errors and falls back to Python implementation when needed for directories like /proc, /sys.

Installation & Setup

See installation guide for:

  • Quick setup with uv/pip
  • Optional performance optimization (Rust/fd)
  • Verification and troubleshooting

Documentation

Project Structure

src/filoma/
├── core/          # Backend integrations (fd, Rust)
├── directories/   # Directory analysis with 3 backends
├── files/         # File profiling and metadata
└── images/        # Image analysis (.tif, .png, .npy, .zarr)

License

This project is licensed under the MIT License.

Contributing

Contributions welcome! Please check the issues for planned features and bug reports.


filoma - Fast, multi-backend file and directory analysis for Python.

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

filoma-1.3.3.tar.gz (107.3 kB view details)

Uploaded Source

Built Distributions

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

filoma-1.3.3-cp311-cp311-win_amd64.whl (237.2 kB view details)

Uploaded CPython 3.11Windows x86-64

filoma-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (400.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

filoma-1.3.3-cp311-cp311-macosx_11_0_arm64.whl (348.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file filoma-1.3.3.tar.gz.

File metadata

  • Download URL: filoma-1.3.3.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for filoma-1.3.3.tar.gz
Algorithm Hash digest
SHA256 1ea4f4ce977a93706ad1180b61e3503d78da293b03ef1c613422642a318a37e3
MD5 45618631720453dce70b20293d1c9b69
BLAKE2b-256 5a4e53877205fd7b2bdb91c4c235880aff723b6658c9b6935f88810b8fe0c51b

See more details on using hashes here.

Provenance

The following attestation bundles were made for filoma-1.3.3.tar.gz:

Publisher: publish.yml on kalfasyan/filoma

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

File details

Details for the file filoma-1.3.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: filoma-1.3.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 237.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for filoma-1.3.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7139ffd5c3fc338794b7bf2cbbbce4855753927b8fb18cef5a0ae4b8e03f2f1c
MD5 2ab101be6ad7f52ed589e1913391e8d3
BLAKE2b-256 7a961ccfe99ac4cbeedbaf69ad839a2792e915511dcd72bbbe424730ac72ea8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for filoma-1.3.3-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on kalfasyan/filoma

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

File details

Details for the file filoma-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for filoma-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e27135349b1f0adba7a0c3f525668b9a21e8e791bee200393265890b3cd1cf1e
MD5 a14434fe40003b17271f64fc6c22699f
BLAKE2b-256 48ee6924b915905ba578297793586bb748367cbdb61fc647ea76d2a257bf7b08

See more details on using hashes here.

Provenance

The following attestation bundles were made for filoma-1.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on kalfasyan/filoma

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

File details

Details for the file filoma-1.3.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for filoma-1.3.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b60a3c4670a0f74b41e6a8c810f4c9eb21ed3ca0ba67dec51f5738c3d9de507
MD5 07379b697aa2febccb38c340137b206c
BLAKE2b-256 89c457fd4f474276adeeaf8c9dd6165983ae61776c50af92862caa2ff20e99f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for filoma-1.3.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on kalfasyan/filoma

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