Metadata-Version: 2.4
Name: gp_wrapper
Version: 0.9.13
Summary: A Google Photos API wrapper library
Author-email: danielnachumdev <danielnachumdev@gmail.com>
License: MIT License
        
        Copyright (c) 2022 danielnachumdev
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/danielnachumdev/gp_wrapper
Project-URL: Bug Tracker, https://github.com/danielnachumdev/gp_wrapper/issues
Keywords: functions,methods,classes,API
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: google-api-python-client
Requires-Dist: google-auth-httplib2
Requires-Dist: google-auth-oauthlib
Requires-Dist: moviepy<3,>=1.0.3
Requires-Dist: requests>=2.33.0
Requires-Dist: tqdm
Provides-Extra: dev
Requires-Dist: pytest>=9.0.3; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"

# gp_wrapper

**Typed Python wrapper for the Google Photos Library API** — albums, media, uploads, and search with a clean object model instead of raw HTTP.

[![CI](https://github.com/danielnachumdev/gp_wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/danielnachumdev/gp_wrapper/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/gp_wrapper.svg)](https://pypi.org/project/gp_wrapper/)
[![Python](https://img.shields.io/pypi/pyversions/gp_wrapper.svg)](https://pypi.org/project/gp_wrapper/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LISENCE)

Requires **Python 3.11+**.

## Why gp_wrapper?

Google Photos is powerful; its API is verbose. **gp_wrapper** turns authenticated sessions into first-class objects so you can script backups, migrations, and album workflows without hand-rolling OAuth, paging, or payload shapes.

- **Full Library API coverage** plus convenience helpers for real upload/migration flows
- **`GooglePhotos`**, **`Album`**, and **`MediaItem`** as the main entry points
- **Enums and dataclasses** that mirror the API (`MimeType`, `MediaItemMaskTypes`, `NewMediaItem`, …)
- **Video-aware uploads** — non-mp4 sources can be transcoded with preserved timing metadata
- **MIT licensed**, CI-tested on Python **3.11–3.13**

## Install

```bash
pip install gp_wrapper
# or
uv add gp_wrapper
```

## Quick start

```python
from gp_wrapper import GooglePhotos, Album, MediaItem, NewMediaItem, SimpleMediaItem

gp = GooglePhotos("path/to/client_secrets.json")
album = Album.exists(gp, name="Vacation") or Album.create(gp, "Vacation")
token = MediaItem.upload_media(gp, "photo.jpg")
MediaItem.batchCreate(
    gp,
    [NewMediaItem("from gp_wrapper", SimpleMediaItem(token, "photo.jpg"))],
    albumId=album.id,
)
```

Google Cloud OAuth setup and a longer walkthrough: [`READMES/example.md`](./READMES/example.md) · credentials shape: [`READMES/client_secrets_example.json`](./READMES/client_secrets_example.json)

## What you get

| Surface | Role |
| -------- | ---- |
| `GooglePhotos` | Authenticated session over the Photos Library API |
| `Album` | Create, list, share, enrich, and manage album membership |
| `MediaItem` | Upload, batch-create, search, and update media |
| Filters & enums | Content, date, feature, and media-type search filters |
| Structures | `SimpleMediaItem`, `NewMediaItem`, `AlbumPosition`, `MediaMetadata`, … |

## Contributing & development

Agent/developer workflow (uv, tests, CI/CD labels, secrets): see [`AGENTS.md`](./AGENTS.md).

Report security issues privately via [GitHub advisories](https://github.com/danielnachumdev/gp_wrapper/security/advisories/new) — please do not open a public issue for vulnerabilities.

## License

MIT — see [`LISENCE`](./LISENCE).
