Metadata-Version: 2.4
Name: simpledownloadmanager-sfar
Version: 0.1.0
Summary: Simple desktop download manager with segmented downloads
Author-email: Oussama Sfar <oussama.sfar@medtech.tn>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/SfarOussama9/SimpleDownloadManager
Project-URL: Issues, https://github.com/SfarOussama9/SimpleDownloadManager/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: customtkinter<6,>=5.2
Requires-Dist: requests<3,>=2.32
Requires-Dist: tkcalendar<2,>=1.6
Provides-Extra: dev
Requires-Dist: pytest<9,>=8.3; extra == "dev"
Dynamic: license-file

# Simple Download Manager

Simple Download Manager is a complete desktop application built with Python and CustomTkinter. It downloads files from direct URLs, accelerates transfers with segmented multi-threading, supports pause and resume, and keeps a persistent download history across application restarts.

[![SDM](./img/sdm-main-ui.png)](https://www.youtube.com/watch?v=w07nzH5FNCg)

## Features

The project includes:

- a src-based package layout
- a runnable CustomTkinter desktop shell
- domain models for downloads and status tracking
- an HTTP probe service that inspects remote files before download
- a simple download manager with worker threads, pause, resume, cancel, partial resume, and file assembly
- SQLite-backed task history loaded automatically on startup
- SQLite-backed per-segment metadata for richer recovery and diagnostics
- configurable default save location, thread count, retry count, and max concurrent downloads
- queueing when the concurrent download limit is reached
- optional scheduled start times per download
- shared bandwidth limiting across active downloads
- queue actions for removing tasks and opening download folders
- direct open-file actions for completed downloads
- advanced progress with live speed and ETA
- a recent activity panel and in-app completion/failure notifications
- a live task details dialog for segment-level diagnostics
- unit and integration tests for speed tracking, persistence, segment resume, and end-to-end downloads

## Functional Coverage

This implementation satisfies the project requirements for:

- file downloading from URLs
- multi-threaded segmented downloads
- HTTP Range request handling
- error handling with automatic retry
- pause and resume
- progress monitoring with percentage, speed, and ETA
- download history persistence
- download scheduling
- bandwidth limiting
- resume after application restart
- queue management

## Architecture

```mermaid
graph TD
    UI[UI Layer] --> APP[Application Controller]
    APP --> DM[Download Manager]
    DM --> HTTP[HTTP Probe Service]
    DM --> CTRL[Thread Controller]
    CTRL --> WORKERS[Segment Workers]
    CTRL --> ASSEMBLER[File Assembler]
    DM --> CORE[Download Domain Model]
    DM --> PERSIST[SQLite History Store]
```

The application follows a layered desktop architecture with a clear split between UI, orchestration, download execution, and persistence. Communication between components is handled through Python objects, threads, and HTTP requests.

## Project Layout

```text
Simple Download Manager/
├── main.py
├── pyproject.toml
├── requirements.txt
├── src/
│   └── sdm/
│       ├── app.py
│       ├── core/
│       ├── models/
│       └── ui/
└── tests/
```

## Testing

Run the full automated suite:

```powershell
python -m pytest
```

Current result: `19 passed`.

## Run

Create a virtual environment and install dependencies:

```
# Optional, but highly recommended
python3 -m venv venv
```

```powershell
python -m pip install -r requirements.txt
```

If you are using Debian/Ubuntu:
```
sudo apt update
sudo apt install python3-tk
```

Finally, run the application:

```
python main.py
```

After publishing to PyPI, you will also be able to install it with:

```powershell
python -m pip install simpledownloadmanager-sfar
sdm
```

## License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full text.
