Metadata-Version: 2.3
Name: chevereto-bulk-uploader
Version: 0.0.1+3eab19a
Summary: Bulk Uploader for Chevereto
Author: Firq
Author-email: Firq <python.packages@firq.dev>
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Requires-Dist: pyyaml~=6.0.1
Requires-Dist: requests~=2.33.0
Requires-Dist: python-dotenv~=1.2.4
Maintainer: Firq
Maintainer-email: Firq <python.packages@firq.dev>
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Chevereto Bulk Uploader

cli tool for uploading folders to chevereto

## Installation

```
pip install chevereto-bulk-uploader --extra-index-url https://forgejo.neshweb.net/api/packages/Firq/pypi/simple/
```
## Remotes and Credentials

```sh
bulk-upload configure images --remote https://chevereto.example --apikey REPLACE_WITH_API_KEY --default
bulk-upload upload --config upload.yaml
```

`--remote` is a URL or a name of a configuration. If not given, the `default` remote is used.

List all remotes:

```sh
bulk-upload remote list
```

`*` marks the default

Configs are stored in `chevereto-bulk-uploader/config.yaml` at `$XDG_CONFIG_HOME` (linux) / `%APPDATA%` (windows) / `~/Library/Application Support` (macos)

API keys are stored in plaintext. Make sure that no unauthorized access is posssible.

### Environment Credentials

Credentials can also come from `CHEVERETO_BASE_URL` and `CHEVERETO_API_KEY`, either via the environment or a specific `.env` file:

```sh
bulk-upload upload --config upload.yaml --env .env
```

## Upload Configuration

```yaml
- folder: ./images
  nsfw: false
  tags: [ example, upload ]
  album: { id: abc }
```

| key      | functionality                                      |
| -------- | -------------------------------------------------- |
| `folder` | path to upload dir (absolute or relative to shell) |
| `nsfw`   | boolean, default `false`.                          |
| `tags`   | list of strings to apply to each uploaded image    |
| `album`  | settings for album mapping / creation              |

- Using an existing album: `album: {id: YOUR_ALBUM_ID}`
- Creating a new album: `album: {name: "New album", state: public}`
- Accepted files in `folder`: `.jpg`, `.jpeg`, `.png`, `.gif`, and `.webp`, scan is not recursive

## History migration

Duplicate detection uses SHA-256 of files. Identical content is skipped within a remote. Each named remote has a separate database in `/history`.

Existing json/sqlite3 histories can be migrated

```sh
bulk-upload import-history history.json --remote production
bulk-upload import-history previous.sqlite3 --remote production
```

### Checking file hashes

Check if certain files have already been uploaded (are present in history)

```sh
bulk-upload check ./images/photo.jpg --remote production
bulk-upload check ./images --remote production
```

`check` prints `[FOUND]` or `[MISSING]` for each regular file, including non-image files. Folder checks are nonrecursive.

### View history

```sh
bulk-upload history status --remote production
```

The default limit is 100; use `--offset` to inspect later pages.

## Development

```sh
uv sync --frozen
```

Usisng `mypy`, `pylint` and `ruff`
