Metadata-Version: 2.4
Name: nchunk
Version: 0.4.2
Summary: Asynchronous chunked uploader for Nextcloud with Typer CLI and Rich progress bars
Project-URL: Homepage, https://github.com/Knyllahsyhn/nchunk
Project-URL: Source, https://github.com/Knyllahsyhn/nchunk
Project-URL: Tracker, https://github.com/Knyllahsyhn/nchunk/issues
Project-URL: CI, https://github.com/Knyllahsyhn/nchunk/actions
Author-email: Johannes Mueller <kex1.jml@gmail.com>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: async,cli,nextcloud,upload,webdav
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: File Transfer Protocol (FTP)
Classifier: Topic :: System :: Networking
Requires-Python: >=3.11
Requires-Dist: aiofiles>=23.2
Requires-Dist: aiohttp>=3.9
Requires-Dist: keyring>=24.3
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rich>=13.7
Requires-Dist: typer[all]>=0.12
Provides-Extra: dev
Requires-Dist: aioresponses>=0.7; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.4.3; extra == 'dev'
Description-Content-Type: text/markdown

# NChunk – Async Chunked Uploader for Nextcloud

**NChunk** uploads huge files to Nextcloud safely—no browser, no time‑outs.

* 🏎 **Fully async** (`aiohttp` + `aiofiles`) — one connection, full speed
* 🔀 **Chunk upload** (≥ 5 MiB) with automatic merge (`MOVE …/.file`)
* 🖥 **Typer CLI** — self‑documenting, with colorized Rich output
* 📊 **Live progress bars** (speed, ETA, multiple files in parallel)
* 🔐 Secure credential storage (keyring) + `.env` fallback, **login check**
* 👥 **Profiles** for multiple clouds / accounts
* Requires **Python ≥ 3.11** • GPLv3+

---

## Table of Contents

1. [Installation](#installation)
2. [First Login](#first-login)
3. [Upload Files](#upload-files)
4. [Options &amp; Examples](#options--examples)
5. [Profiles](#profiles)
6. [Development &amp; Tests](#development--tests)
7. [Roadmap](#roadmap)
8. [License](#license)

---

## Installation

```bash
# recommended: src-layout + editable install
python -m venv .venv
source .venv/bin/activate            # Windows: .venv\Scripts\Activate.ps1
pip install -e .[dev]                # incl. pytest + ruff
```

(Once on PyPI you can simply run `pip install nchunk`.)

---

## First Login

```bash
# instantly verifies URL + credentials via PROPFIND
nchunk login https://cloud.example.com alice
# password is prompted securely
```

* On success credentials are stored in the OS keyring (`nchunk_nextcloud`).
* On failure you get a clear message and **nothing** is saved.

---

## Upload Files

```bash
# single file
nchunk upload movie.iso                 \
       --url https://cloud.example.com  \
       --user alice

# several in parallel
nchunk upload *.zip docs/**/*.pdf       \
       --url cloud.example.com          \
       --user alice                     \
       --chunk-size 10485760            \
       --remote-dir Backups/$(date +%Y-%m-%d)
```

> You may omit `https://`; the tool auto‑attaches `/remote.php/dav` if needed.

---

## Options & Examples

| Flag              | Default      | Description                                    |
| ----------------- | ------------ | ---------------------------------------------- |
| `--chunk-size`  | `10485760` | bytes per chunk (≥ 5 MiB)                   |
| `--remote-dir`  | `""`       | target folder in Nextcloud (created if absent) |
| `--insecure`    | `False`    | skip TLS verification (self‑signed certs)     |
| `--concurrency` | `4`        | max concurrent file uploads                    |
| `--profile`     | `default`  | separate multiple accounts                     |
| `--resume`*     | –           | *planned* — resume aborted upload           |
| `--dry-run`*    | –           | *planned* — print requests, do nothing      |

---

## Profiles

```bash
# Work cloud
nchunk login https://cloud.work.com alice --profile work

# Private cloud
nchunk login cloud.home.net bob --profile home

# Use explicit profile
nchunk upload video.mp4 --profile work
```

Credentials are stored under `<url>::<user>::<profile>`.

---

## Development & Tests

```bash
ruff check src tests      # static analysis
pytest -q                 # unit + async tests
```

The **src‑layout** ensures imports work only after
`pip install -e .` — missing metadata show up immediately.

---

## Roadmap

- [ ] **Resume** aborted uploads (`--resume`)
- [ ] **Folder sync** (watch & upload)
- [ ] Progress export as JSON / quiet mode
- [ ] Signed wheels + PyPI release
- [ ] Windows single‑binary (pex / shiv)

PRs & issues welcome 🙂

---

## License

GPLv3+
