Skip to main content

filesnap

filesnap is a command-line tool for managing files and directories.

Motivation

filesnap was born out of necessity in a professional production environment. Dealing with massive directory structures and thousands of assets manually is error-prone and slow.

I built this tool to:

  • Automate Database Seeding: Quickly export entire folders of images or assets into structured formats (CSV, JSON) to sync filenames with database records.
  • Bulk Audit: Count and scan files by extension.
  • Smart Cleanup: Safely prune specific file types or filenames across nested directories using --dry-run to prevent accidental data loss.

Installation

you can install it globally using uv by astral

uv tool install filesnap

or with pip

pip3 install filesnap

Commands

filesnap scan

Scans all the files in the path.

Argument Description Default
path Path to scan Current directory
Option Alias Description
--recursive -r Recursive search.
--pretty -p Pretty print the output in a table.
--exclude Exclude files/directories from scanning.
--ext -e Scan only files with these extensions.

Example:

filesnap scan ./src --recursive --ext .py --exclude __pycache__

filesnap count

Counts all the files by extension in the path selected.

Argument Description Default
path Path to count Current directory
Option Alias Description
--recursive -r Recursive search.
--exclude Exclude files/directories from counting.

Example:

filesnap count ./assets --recursive

filesnap clean

Cleans the content of a path.

Argument Description
path Path to clean
Option Alias Description
--recursive -r Recursive cleaning.
--contain -c Clean only files containing this string.
--ext -e Clean only files with these extensions.
--exclude Exclude files/directories from cleaning.
--force -f Force deletion without confirmation.
--dry-run --dry Simulate cleaning without deleting files.

Example:

filesnap clean ./temp --ext .log --force

filesnap export

Exports file metadata (name, full name, and modified date) to a file.

Argument Description
path Path to scan for files
Option Alias Description
--type -t The type of file to export to (e.g., txt, csv, json).
--recursive -r Recursive scanning.
--output -o The output file name.
--format -f The format of the output (regex to remove).

Example:

filesnap export ./images --type json --output manifest.json --recursive

filesnap compress

Compresses all the images in the path selected with different formats.

Argument Description
source_path Path to images to compress
destination_path Path to save compressed images
Option Alias Description
--current-format -f The format of the images to compress.
--new-format -t The format to convert the images to.
--quality -q The quality of the compressed images (60-100).

Example:

filesnap compress ./raw ./optimized -f png -t jpg --quality 85

Metadata

Release files for filesnap 1.1.1

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

Source distribution (sdist)

Source distribution for filesnap 1.1.1
File Size Uploaded Provenance Actions
filesnap-1.1.1.tar.gz 18.2 kB With provenance Details for filesnap-1.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 31.5 kB

Release files / filesnap-1.1.1.tar.gz

Download URL filesnap-1.1.1.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9b83ab050af4b46720abbf7150eaece06ee4b0bb24c7adff4b38110ccb03d271
BLAKE2b-256 checksum
How to use checksums
fe80c9e0214cae90d800eb4397f10e0e197db337d663f286f882f190db056304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 19, 2026.

Transparency log

Release files / filesnap-1.1.1-py3-none-any.whl

Download URL filesnap-1.1.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b11b3fb4c6b72278eec711c13f7f907488f9f545d5e0b6c63f97a42159d916b9
BLAKE2b-256 checksum
How to use checksums
b05a4dc3182247c79c1a6efadd62823ce82db2b9f9445e99664f13f7a14058ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 19, 2026.

Transparency log

Security for filesnap 1.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for filesnap-1.1.1.tar.gz

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 May 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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