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. |
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. |
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. |
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). |
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 |
-c |
The format of the images to compress. |
--new-format |
-n |
The format to convert the images to. |
--quality |
-q |
The quality of the compressed images (60-100). |
Roadmap
- Core functionality currently using the
osmodule will be refactored to usepathlib.Pathin the future for better cross-platform compatibility and cleaner code.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filesnap-0.2.0.tar.gz.
File metadata
- Download URL: filesnap-0.2.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fea2d094525948529c5edeeebba0d6e4fdc9e15cb200f2048389d14cce8f8a6e
|
|
| MD5 |
3ec2eaf32fd6dac60b60bc58bf5e0daf
|
|
| BLAKE2b-256 |
36aed9b4fe908eecfa0b1412d3171fee45b2063d5c4f24da9f7d1b8cc6c44172
|
Provenance
The following attestation bundles were made for filesnap-0.2.0.tar.gz:
Publisher:
python-publish.yml on jesusjsg/filesnap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
filesnap-0.2.0.tar.gz -
Subject digest:
fea2d094525948529c5edeeebba0d6e4fdc9e15cb200f2048389d14cce8f8a6e - Sigstore transparency entry: 1011520200
- Sigstore integration time:
-
Permalink:
jesusjsg/filesnap@1067aa4b226ca202477a47d65f4801cad6dab1c6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jesusjsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1067aa4b226ca202477a47d65f4801cad6dab1c6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file filesnap-0.2.0-py3-none-any.whl.
File metadata
- Download URL: filesnap-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23eeac9df5533329b8a3901fbec899d401f8aefd2274cce774f1de2729965568
|
|
| MD5 |
0c3ff2c0a803d02dfb35a05dd29a2595
|
|
| BLAKE2b-256 |
67919ab7633a904139112eb504b8dcbd90be57066bd8c2ad2bd6ca4cd0d62ee6
|
Provenance
The following attestation bundles were made for filesnap-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on jesusjsg/filesnap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
filesnap-0.2.0-py3-none-any.whl -
Subject digest:
23eeac9df5533329b8a3901fbec899d401f8aefd2274cce774f1de2729965568 - Sigstore transparency entry: 1011520264
- Sigstore integration time:
-
Permalink:
jesusjsg/filesnap@1067aa4b226ca202477a47d65f4801cad6dab1c6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jesusjsg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1067aa4b226ca202477a47d65f4801cad6dab1c6 -
Trigger Event:
release
-
Statement type: