# josephcanzana/filesort architecture

> Architecture diagram of the GitHub repository josephcanzana/filesort, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josephcanzana/filesort
- Repository: https://github.com/josephcanzana/filesort

## Overview

filesort is a one-shot command-line utility that organizes top-level files in the current user’s Downloads folder. Its intended workflow scans files, skips partial or changing downloads, chooses a category by extension, avoids name collisions, and renames files into category folders; it also offers an interactive uninstall option. The source shows that `sort_files` does not return a value, although `main` uses its result to count successful moves, so the displayed summary may incorrectly report that nothing was sorted. The graph is based on the README and the two excerpted source files.

Main entry points: [`filesort.py`](https://github.com/josephcanzana/filesort/blob/main/filesort.py) (Command entry), [`pyproject.toml`](https://github.com/josephcanzana/filesort/blob/main/pyproject.toml) (filesort command)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_command["filesort command<br/>[pyproject.toml]"]
node_main["Command entry<br/>[filesort.py]"]
node_downloads["Downloads folder"]
node_stability["Download check<br/>[filesort.py]"]
node_sorting["File sorting<br/>[filesort.py]"]
node_categories["Extension categories<br/>[filesort.py]"]
node_collision["Name collision check<br/>[filesort.py]"]
node_moving["File move<br/>[filesort.py]"]
node_uninstall["Uninstall option<br/>[filesort.py]"]
node_uv["uv tool"]

node_user -->|"runs"| node_command
node_command -->|"dispatches to"| node_main
node_main -->|"lists files"| node_downloads
node_main -->|"checks stability"| node_stability
node_main -->|"sorts files"| node_sorting
node_sorting -->|"matches extensions"| node_categories
node_sorting -->|"checks destination"| node_collision
node_sorting -->|"moves file"| node_moving
node_moving -->|"renames into"| node_downloads
node_main -->|"dispatches option"| node_uninstall
node_uninstall -->|"runs uninstall"| node_uv

click node_command "https://github.com/josephcanzana/filesort/blob/main/pyproject.toml"
click node_main "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_stability "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_sorting "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_categories "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_collision "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_moving "https://github.com/josephcanzana/filesort/blob/main/filesort.py"
click node_uninstall "https://github.com/josephcanzana/filesort/blob/main/filesort.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_command,node_main,node_stability,node_sorting,node_categories,node_collision,node_moving,node_uninstall toneTeal
class node_downloads,node_uv toneIndigo
```

## Components

### Other components

- **User**
- [filesort command](https://github.com/josephcanzana/filesort/blob/main/pyproject.toml): `pyproject.toml`
- [Command entry](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- **Downloads folder**
- [Download check](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- [File sorting](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- [Extension categories](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- [Name collision check](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- [File move](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- [Uninstall option](https://github.com/josephcanzana/filesort/blob/main/filesort.py): `filesort.py`
- **uv tool**

## Connections

- User → filesort command: runs (evidence: `README.md`)
- filesort command → Command entry: dispatches to (evidence: `pyproject.toml`)
- Command entry → Downloads folder: lists files (evidence: `filesort.py`)
- Command entry → Download check: checks stability (evidence: `filesort.py`)
- Command entry → File sorting: sorts files (evidence: `filesort.py`)
- File sorting → Extension categories: matches extensions (evidence: `filesort.py`)
- File sorting → Name collision check: checks destination (evidence: `filesort.py`)
- File sorting → File move: moves file (evidence: `filesort.py`)
- File move → Downloads folder: renames into (evidence: `filesort.py`)
- Command entry → Uninstall option: dispatches option (evidence: `filesort.py`)
- Uninstall option → uv tool: runs uninstall (evidence: `filesort.py`)
