An open API service indexing awesome lists of open source software.

https://github.com/encryptex/archiver

Python script to organize your folders
https://github.com/encryptex/archiver

archive downloads organizer script tool

Last synced: 9 days ago
JSON representation

Python script to organize your folders

Awesome Lists containing this project

README

          


IMBd


Archiver


A script to organize all your files from your Downloads folder.




## Pre-requisites

[Python 3.x Installed](https://www.python.org/downloads/)

[Node.js 18+ Installed](https://nodejs.org/)

Install backend dependencies:

```sh
pip install -r requirements.txt
```

Install web UI dependencies:

```sh
cd web-ui
npm install
```

## Tutorial
1. Start backend API.

```sh
python3 oneclick.py
```

2. In another terminal, start the web UI.

```sh
cd web-ui
npm run dev
```

3. Open `http://127.0.0.1:5173`.

4. In the web UI:
- Set the folder path (for example your Downloads path).
- Add or edit rules to map extensions to folders.
- Click `Save Settings`.
- Click `Archive Now`.

## Rule Configuration
Rules are stored in [archiver_settings.json](archiver_settings.json).

Each rule looks like:

```json
{
"folder": "scripts",
"extensions": [".ps1", ".bat", ".sh"]
}
```

Unknown extensions can still be auto-grouped into `_ext_` folders when enabled.

## Build Frontend

To build a production bundle:

```sh
cd web-ui
npm run build
```

The output is created in `web-ui/dist` and is automatically served by FastAPI when present.

## Standalone Binaries (No Python/Node needed on target machine)

Native binaries must be built on each target OS:
- Build Linux binary on Linux.
- Build Windows binary on Windows.

### Linux build

```sh
chmod +x scripts/package_linux.sh
./scripts/package_linux.sh
```

Output:

```sh
dist/archiver
```

Run:

```sh
./dist/archiver
```

### Windows build (PowerShell)

```powershell
./scripts/package_windows.ps1
```

Output:

```powershell
dist/archiver.exe
```

Run:

```powershell
./dist/archiver.exe
```

### Build both automatically (CI)

This repo includes GitHub Actions workflow at `.github/workflows/build-binaries.yml`.
Trigger it from GitHub Actions and download:
- `archiver-ubuntu-latest`
- `archiver-windows-latest`

### Runtime behavior

- Binary starts local server at `http://127.0.0.1:8000`.
- Browser opens automatically.
- Use env vars if needed:
- `ARCHIVER_HOST`
- `ARCHIVER_PORT`
- `ARCHIVER_NO_BROWSER=1`

Animated footer bars