# Google Drive setup for 📦 Client Delivery (one time, ~5 minutes)

WIVEXX can create a Drive folder, upload a shoot, make it public, and hand you the
share link — but Google requires a one-time sign-in setup first. You only do this
**once**. After it's done, the first delivery opens a browser to grant access and
everything is automatic from then on.

> Converting `.ARW → JPG` and renaming work **without** any of this. The steps below
> are only needed for the automatic upload-to-Drive step.

## 1. Install the libraries (one command)
```
pip install rawpy piexif google-api-python-client google-auth-oauthlib google-auth-httplib2
```

## 2. Create a free Google Cloud project
- Go to https://console.cloud.google.com/
- Top bar → project dropdown → **New Project** → name it e.g. `Wivexx Drive` → **Create**.
- Make sure the new project is selected.

## 3. Enable the Drive API
- Search bar → "**Google Drive API**" → open it → **Enable**.

## 4. Configure the consent screen
- Left menu → **APIs & Services → OAuth consent screen**.
- User type: **External** → **Create**.
- App name: `Wivexx`; pick your email for support + developer contact → **Save and continue**.
- Scopes: just **Save and continue** (nothing to add).
- **Test users → Add users →** add your own Google email (the Drive account you deliver
  from) → **Save and continue**. (Leaving the app in "Testing" is fine — only you use it.)

## 5. Create the credentials
- Left menu → **APIs & Services → Credentials**.
- **Create Credentials → OAuth client ID**.
- Application type: **Desktop app** → name it `Wivexx` → **Create**.
- Click **Download JSON** on the popup.

## 6. Drop it next to WIVEXX
- Rename the downloaded file to **`credentials.json`**.
- Put it in your Wivexx folder — the same folder as `wivexx_api.py`.

## Done
Open **📦 Deliver**, fill in a gallery name, and run a delivery. The first time, a
browser window opens asking you to choose your Google account and click **Allow**
(you may see an "unverified app" notice — that's expected for your own private app;
choose your account → **Continue**). After that, WIVEXX caches the sign-in in
`wivexx_drive_token.json` and never asks again.

**Privacy / scope:** WIVEXX requests the `drive.file` scope only — it can see and manage
**only the folders and files it creates** for you. It cannot read the rest of your Drive.

**Re-doing it:** delete `wivexx_drive_token.json` to force a fresh sign-in. Galleries are
created under a top-level folder named in `wivexx_config.py` (`DRIVE_PARENT_FOLDER`,
default "Wivexx Client Galleries").
