Skip to main content

fastdelete ⚡

PyPI version Python versions CI Status License: MIT

FastDelete is a high-performance, safety-focused filesystem toolkit for ultra-fast directory deletion, workspace cache cleaning, secure data shredding, safe trash bin management, and disk inspection.


⚡ Highlights

  • $O(\text{depth})$ Memory Footprint: Deletes millions of files in mere megabytes of RAM without recursion limits.
  • Direct System Calls: Uses native os.unlink() and os.rmdir() — never shells out to rm -rf.
  • Optional Native C Accelerator: High-throughput POSIX C engine compiled for maximum I/O performance.
  • Developer Cleaner Presets: Instant cleaning for Python, Node.js, Rust, C/C++, Java, temp files, and logs.
  • DoD & Gutmann Shredder: Cryptographic multi-pass sanitization with filename obfuscation and hardware fsync.
  • Safe Trash & Restore: FreeDesktop.org Trash specification compliance with instant restoration.
  • Disk Usage & Duplicate Finder: High-speed recursive directory tree sizing and 3-stage duplicate detection.
  • Zero Runtime Dependencies: Built entirely on standard Python 3.8+ primitives.

📦 Installation

From PyPI

pip install fastdelete

From Source (Local Development)

git clone https://github.com/Baba01hacker666/fastdelete.git
cd fastdelete
pip install -e .

Standalone (Zero Install)

python3 -m fastdelete.cli /path/to/folder --yes

🚀 Quick Start

1. Ultra-Fast Deletion

# Delete with confirmation prompt
fastdelete /path/to/large_folder

# Delete immediately without prompt
fastdelete /path/to/large_folder --yes

# Parallel deletion with 8 worker threads
fastdelete /path/to/large_folder --workers 8 --yes

# Dry run preview (simulate without deleting)
fastdelete /path/to/large_folder --dry-run

2. Workspace Cleaner Presets

# Clean Python bytecode & caches (__pycache__, *.pyc, .pytest_cache, dist)
fastdelete clean python

# Clean Node.js build bloat (node_modules, .next, .nuxt, dist, *.log)
fastdelete clean node

# Clean all dev build caches in current directory
fastdelete clean all-dev

3. Secure File Shredding

# Overwrite with DoD 5220.22-M standard (zeros -> ones -> random)
fastdelete shred secret_keys.pem

# 35-pass Gutmann sanitization
fastdelete shred confidential.db --shred-method gutmann

4. Safe Trash & Restore

# Move to system Trash bin
fastdelete trash /path/to/old_project

# List items in Trash
fastdelete trash --list

# Restore item from Trash
fastdelete restore old_project

5. Disk Space & Duplicate Analysis

# Inspect recursive disk usage and top hogs
fastdelete du /var/log --top 10

# Find duplicate files and delete redundant copies
fastdelete dupes /data --delete

🐍 Python Developer API

FastDelete provides both synchronous and asyncio non-blocking APIs:

import fastdelete

# 1. Simple deletion
stats = fastdelete.delete("/tmp/cache_folder", workers=4)
print(f"Deleted {stats.total_deleted():,} items in {stats.elapsed_seconds():.2f}s")

# 2. Async deletion (FastAPI / aiohttp / Celery)
import asyncio

async def main():
    stats = await fastdelete.delete_async("/tmp/scratch", workers=4)
    print(stats.to_dict())

asyncio.run(main())

# 3. Clean workspace preset
fastdelete.clean("python", root_path=".")

# 4. Secure shredding
fastdelete.shred("/path/to/secrets.json", method="dod")

# 5. Disk usage analysis
summary = fastdelete.analyze("/var/log", top_n=5)

📚 Complete Documentation

Explore the detailed guides in the docs/ folder:

Guide Description
CLI Reference Complete CLI syntax, all flags, filtering options, and subcommands.
Python Developer API Full API reference, classes, async functions, filters, and event callbacks.
Architecture & Safety $O(\text{depth})$ iterative traversal, symlink safety, and system protection blacklists.
Secure Shredder DoD 5220.22-M, Gutmann, filename obfuscation, and hardware flushing.
Workspace Presets Built-in cleaning rules for Python, Node, Rust, C/C++, Java, temp, and logs.
Trash Bin & Recovery FreeDesktop.org Trash specification, .trashinfo format, and restoration.
Benchmarks Performance measurements across 50,000+ files and comparisons with rm -rf.

🛡️ Safety Architecture

  • Protected System Paths: Rejects deletion of /, /boot, /etc, /usr, /var, /home, C:\Windows, or user $HOME by default.
  • Symlink Protection: Never follows directory symlinks — unlinks the symlink directly without modifying target folders.
  • Device & Inode Verification: Verifies inode identity before root removal to prevent race-condition symlink swaps.

📄 License

MIT License © 2026 Baba01hacker666

Metadata

Release files for fastdelete 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastdelete 2.0.0
File Size Uploaded
fastdelete-2.0.0.tar.gz 58.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastdelete 2.0.0
File Interpreter ABI Platform
fastdelete-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 109.3 kB

Release files / fastdelete-2.0.0.tar.gz

Download URL fastdelete-2.0.0.tar.gz
Size 58.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7f29251d4ce5f0a1a87a6e4a090c7ba1492730a8832c0887973bfbae48b5715e
BLAKE2b-256 checksum
How to use checksums
2b7b28cd4d4d9358809c6d8103239e1e232ad90068cb9607160193fa6fb722dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / fastdelete-2.0.0-py3-none-any.whl

Download URL fastdelete-2.0.0-py3-none-any.whl
Size 51.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c55d1561a559d1ccc468c00da5f151609b97c3938f491af0bd50fb22407d44c
BLAKE2b-256 checksum
How to use checksums
0673c0c268152db25a14fd41ef03099f6282996c86b8d1e093a4dfd61674218f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page