Skip to main content

A simple CLI to handle your files

Project description

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 the filenames to a file.

Argument Description
path Path to scan for filenames
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.
--column -c The column to export (defaults to file_name).

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

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

filesnap-1.0.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

filesnap-1.0.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file filesnap-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for filesnap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fc40714fc4c2fa0a242f4fed9517bd979fd0b36181de3a1b2c930c428f7a064c
MD5 db7f5f0a051e48bd5cd3d44a43a93f6e
BLAKE2b-256 4f66e21aaa1daa37ade6e0fba80d6e63d3cb2e0dc458d5ab39699c5203a26e44

See more details on using hashes here.

Provenance

The following attestation bundles were made for filesnap-1.0.0.tar.gz:

Publisher: python-publish.yml on jesusjsg/filesnap

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

File details

Details for the file filesnap-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: filesnap-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for filesnap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c20f933ec63f5c2f7201379c1fd71a26ce75110c860c7ec73617adccdb6f0397
MD5 af05b5f126f89753e0ca1d6e837f9864
BLAKE2b-256 e8590982763e063d1f21e1abaedb38720b0249c43e2b797c2eaf1875fdb067cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for filesnap-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on jesusjsg/filesnap

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