A CLI tool to scan directories and generate file reports
Project description
filescan-report-cli
English
A practical Python project to start AI studies.
A CLI tool to scan directories, generate file reports in text, JSON, or CSV format, and dynamically manipulate files using Regex.
Installation
pip install -e ".[dev]"
Usage
filescan <command> [options]
positional arguments:
{report,action}
report Generate a file extensions report.
action Copy, delete, or move files using Regex.
1. Generating Reports (report)
Scan a directory and generate an extension report.
# Scan current directory and print a text report
filescan report .
# Generate a JSON report for all Python files
filescan report ./src --format json --ext .py
# Generate a CSV report, top-level only, saved to a file
filescan report ./data --format csv --no-recursive --output report.csv
2. Manipulating Files (action)
Search for files matching a regex pattern and copy, move, or delete them. Optionally rename them using regex capture groups.
# Move and rename specific ROMs using regex capture groups
filescan action ./isos ./clean_isos --match "^(.*?)(?:\s*-\s*)?(?:\s*(?:[\(\[][^\]\)]*[\)\]]))+\.(.+)$" --replace "\1.\2" --action move
# Copy all PDF files to a backup folder
filescan action ./docs ./backup --match ".*\.pdf$" --action copy
# Delete all temporary log files
filescan action ./logs . --match ".*\.log$" --action delete
Development
Run the test suite:
pytest -v
Português
Projeto prático em Python para iniciar estudos em IA.
Uma ferramenta CLI para escanear diretórios, gerar relatórios de arquivos no formato texto, JSON ou CSV e manipular arquivos dinamicamente usando Regex.
Instalação
pip install -e ".[dev]"
Uso
filescan <command> [options]
argumentos posicionais:
{report,action}
report Gera um relatório de extensões de arquivos.
action Copia, exclui ou move arquivos usando Regex.
1. Gerando Relatórios (report)
Escaneia uma pasta e cria estatísticas de extensões.
# Escaneia o diretório atual e imprime texto
filescan report .
# Gera um JSON de todos os arquivos .py
filescan report ./src --format json --ext .py
# Arquivo CSV que não lê subpastas
filescan report ./data --format csv --no-recursive --output report.csv
2. Manipulando Arquivos (action)
Busca por arquivos através de expressões regulares (regex) para copiá-los, movê-los ou excluí-los, renomeando-os em tempo real.
# Isola e limpa os nomes de ROMs
filescan action ./isos ./clean_isos --match "^(.*?)(?:\s*-\s*)?(?:\s*(?:[\(\[][^\]\)]*[\)\]]))+\.(.+)$" --replace "\1.\2" --action move
# Copia de segurança para PDFs
filescan action ./docs ./backup --match ".*\.pdf$" --action copy
# Deleta todos os logs temporários
filescan action ./logs . --match ".*\.log$" --action delete
Desenvolvimento
Rode os testes com o comando:
pytest -v
Español
Proyecto práctico en Python para iniciar estudios de IA.
Una herramienta CLI para escanear directorios, generar informes de archivos en formato de texto, JSON o CSV, y manipular archivos dinámicamente usando Regex.
Instalación
pip install -e ".[dev]"
Uso
filescan <command> [options]
argumentos posicionales:
{report,action}
report Genera un informe con extensiones de archivos.
action Copia, elimina o mueve archivos usando Regex.
1. Generando Informes (report)
Escanea una carpeta y crea un informe.
# Escanea el directorio actual
filescan report .
# Genera un archivo JSON para los módulos .py
filescan report ./src --format json --ext .py
# Archivo CSV sin buscar subdirectorios recursivamente
filescan report ./data --format csv --no-recursive --output report.csv
2. Manipulando Archivos (action)
Busca archivos o extensiones con expresiones regulares para copiarlos, moverlos o eliminarlos y renombrarlos opcionalmente.
# Aísla las ROMs limpiando los nombres innecesarios
filescan action ./isos ./clean_isos --match "^(.*?)(?:\s*-\s*)?(?:\s*(?:[\(\[][^\]\)]*[\)\]]))+\.(.+)$" --replace "\1.\2" --action move
# Copia todos los archivos PDF para seguridad
filescan action ./docs ./backup --match ".*\.pdf$" --action copy
# Elimina todos los logs
filescan action ./logs . --match ".*\.log$" --action delete
Desarrollo
Correr pruebas locales:
pytest -v
Project details
Release history Release notifications | RSS feed
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 filescan_report_cli-0.1.0.tar.gz.
File metadata
- Download URL: filescan_report_cli-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca84fd46f75f19481f43b80ad095586d4d457cf7b79ef25cd9a84f4637e489b5
|
|
| MD5 |
92f853d0864d5f93d73d1b9f1d60d7f3
|
|
| BLAKE2b-256 |
83beeb397870100fccb18830d17d0d81691ebf7c13ad25bf73861039476669bc
|
File details
Details for the file filescan_report_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: filescan_report_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40af940dfed764ffae672fdee453f6fe91c648e5e6bb48e693f131c6207f5872
|
|
| MD5 |
ab199fbfd777f28518a31d53804861dd
|
|
| BLAKE2b-256 |
112116cc820b8758fd97b0bc13f2379571a52bc5a87b4d01125e38003feae52b
|