Skip to content

API Reference

All public symbols are importable directly from the top-level q2google package:

from q2google import (
    GoProToPhotosSync,
    GooglePhotosClient,
    GooglePhotosOAuth,
    JsonFileBackend,
    SessionState,
    SyncStateBackend,
    Q2GoogleSettings,
    get_settings,
)

Public symbol map

Symbol Module Description
GoProToPhotosSync q2google.sync Main orchestrator; runs discovery → transfer → create.
GooglePhotosClient q2google.photos Resumable upload facade (upload_file_path, create_media_items).
GooglePhotosOAuth q2google.gphotos.auth Load, refresh, or obtain Google OAuth credentials.
JsonFileBackend q2google.state.local File-based SyncStateBackend; stores each session as a directory of JSON files (meta.json, items/, batches/).
SessionState q2google.state.base Full persisted session document (to_dict / from_dict).
SyncStateBackend q2google.state.base Protocol — implement load / save to plug in any storage layer.
Q2GoogleSettings q2google.config Pydantic settings; batch sizes, timeouts, and paths with env-var overrides.
get_settings q2google.config Return a singleton Q2GoogleSettings from environment / .env.

Lower-level symbols

Symbol Module Description
GooglePhotosAPI q2google.gphotos.api Thin aiohttp wrapper for Library v1.
GooglePhotoLibraryPort q2google.gphotos.api Protocol matching GooglePhotosAPI; implement for testing.
PhotosScopes q2google.gphotos.models Enum of OAuth scopes (READ_AND_APPEND, READ_ONLY, APPEND_ONLY).