Metadata-Version: 2.4
Name: jyphoto_transfer
Version: 0.0.2
Summary: Copy photos from Google Photos to Dropbox without saving to your local machine
Home-page: https://github.com/funkstop/jyphoto_transfer
Author: Funkstop
Author-email: funkstop@internetplus.com
License: Apache-2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-fasthtml
Requires-Dist: fhdaisy
Requires-Dist: google-auth-oauthlib
Requires-Dist: dropbox
Requires-Dist: httpx
Requires-Dist: python-dotenv
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# jyphoto_transfer


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Disclosure

1.  Setup required - Users need to create their own Google/Dropbox OAuth
    apps
2.  Personal use focus - It’s designed for individual use, not
    multi-tenant production
3.  Prerequisites - Technical comfort with OAuth setup

## Installation

``` bash
pip install jyphoto_transfer
```

## Setup

Before using, you need to set up credentials for both Google and
Dropbox.

### 1. Google Cloud Setup

1.  Go to [Google Cloud Console](https://console.cloud.google.com)
2.  Create a new project (or select existing)
3.  Go to **APIs & Services → Library**
4.  Search for “Photos Library API” and click **Enable**
5.  Go to **APIs & Services → Credentials**
6.  Click **Create Credentials → OAuth client ID**
7.  If prompted, configure the OAuth consent screen (choose External,
    fill in app name)
8.  For application type, choose **Web Application** and enter your
    Redirect URL (Should be BASE_URL/callback)
9.  Click **Create**, then download the JSON file
10. Save it somewhere safe (e.g.,
    `~/.config/jyphoto_transfer/google_photos_creds.json`)
11. If keeping project in Testing mode, add your test users in Audience.

### Google Cloud Console Setup

Add these scopes in the Data Access tab \*
https://www.googleapis.com/auth/photospicker.mediaitems.readonly \*
openid \* https://www.googleapis.com/auth/userinfo.email

### 2. Dropbox App Setup

1.  Go to [Dropbox App Console](https://www.dropbox.com/developers/apps)
2.  Click **Create app**
3.  Choose **Scoped access** and **Full Dropbox**
4.  Give it a name and click **Create app**
5.  On the app settings page, note your **App key** and **App secret**
6.  Make to give the following permissions

- files.content.write - to upload files
- files.metadata.read - to check if files exist (for your
  get_unique_filename function)

7.  enter your callback URI

### 3. Environment Config

Create a file called `~/.config/jyphoto_transfer/.env` with these
values:

    BASE_URL=http://localhost:8000/
    GOOGLE_CREDS_FILE=google_photos_creds.json
    DROPBOX_APP_KEY=your_dropbox_app_key
    DROPBOX_APP_SECRET=your_dropbox_app_secret
    GOOGLE_TOKEN_FILE=google_token.json 
    DROPBOX_TOKEN_FILE=dropbox_token.json 
    DROPBOX_FOLDER=/CopiedPhotosLocation

| Variable             | Description                                 |
|----------------------|---------------------------------------------|
| `BASE_URL`           | Where the app runs (include trailing slash) |
| `GOOGLE_CREDS_FILE`  | Path to your downloaded Google OAuth JSON   |
| `DROPBOX_APP_KEY`    | From Dropbox app settings                   |
| `DROPBOX_APP_SECRET` | From Dropbox app settings                   |
| `GOOGLE_TOKEN_FILE`  | Location of google_token.json               |
| `DROPBOX_TOKEN_FILE` | Location of dropbox_token.json              |
| `DROPBOX_FOLDER`     | Dropbox folder to copy photos into          |

### 4. Protect Your Secrets

Add these to your `.gitignore`:

    *.env
    *_creds.json
    google_token.json
    dropbox_token.json

**Never commit credentials to git!**

## Usage

``` python
from jyphoto_transfer.core import app, serve
serve()
```

Open your browser to `http://localhost:8000`, log in with Google,
connect Dropbox, select photos, and sync!

------------------------------------------------------------------------
