Sweep up your files into organized folders by date and/or extension.
tidyup helps organize messy directories by moving eligible files into a predictable
folder structure.
pip install tidyup
tidyup [-h] [-e] [-d] [-r] [-L DEPTH] directory
-e: organize by extension-d: organize by file modified date (year/month)-r, --rearrange: traverse subdirectories recursively-L, --depth: recursion depth (valid only with-r)
Order is preserved:
-de=>year/month/extension/file-ed=>extension/year/month/file
-rwithout-Ldefaults to depth2-Lwithout-ris invalid
By default, tidyup excludes:
- hidden files (dotfiles)
- files under hidden directories during recursive traversal
- names/suffixes in the internal exclusion list (for example
requirements.txt,config.json) - files without an extension
- multi-extension files are grouped by their final suffix (for example
archive.tar.gzgoes togz/)
- tidyup never overwrites an existing destination file
- if a destination filename already exists, that move is skipped and a message is printed
- when multiple source files would target the same destination in one run, tidyup processes them in a stable path order so the outcome stays deterministic
# Organize top-level files by extension tidyup -e /path/to/dir # Organize top-level files by date tidyup -d /path/to/dir # Organize by extension then date tidyup -ed /path/to/dir # Organize by date then extension tidyup -de /path/to/dir # Recursive organize by date, default depth=2 tidyup -r -d /path/to/dir # Recursive organize by extension, default depth=2 tidyup -r -e /path/to/dir # Recursive organize by extension at depth 3 tidyup -r -L 3 -e /path/to/dir # Recursive organize by date at depth 3 tidyup -r -L 3 -d /path/to/dir
Run the same baseline checks locally that CI uses before release or publishing:
python3 -m pip install -e .[test] || python3 -m pip install -e . pytest python3 -m pytest -q python3 -m tidyup -h
tidyup/tidyup.py: CLI entrypoint and top-level directory validationtidyup/utils.py: argument parsing, file discovery, exclusion rules, destination planning, and move behaviortidyup/__init__.py: package version resolution andpython -m tidyupruntime entry wiring
tests/test_cli_docs.py: keeps README and parser help output in synctests/test_filesystem_behavior.py: covers file selection, recursion, collisions, and ordering behaviortests/test_packaging.py: covers version fallback and installed-module entrypoint behaviortests/test_parser_contract.py: locks supported CLI flag combinations and validation rules
.github/workflows/pr-to-prod.yml: opens or updates the automation PR fromdev*branches intomaster.github/workflows/publish-to-pypi.yml: builds distributions on push, publishes to TestPyPI fromdev, and publishes to PyPI only for tags
python3 -m pytest -q python3 -m tidyup -h