A Google Drive Container storage and synchronization manager with persistent OAuth, deduplication, and verification.
Project description
EasyStorage
A Python library and CLI tool for managing folder-based Containers in Google Drive with persistent OAuth authentication, SHA-256 deduplication, and automated offloading verification. Made with Gemini ! 🚀
Features
- Persistent Long-Term Authentication: Stores OAuth refresh tokens in
~/.easystorage_creds.txtso browser login is required only once. - Unique Container Identification: Automatically manages
.container.jsoninside each folder storing a unique container ID and the original folder name. - SHA-256 Deduplication: Computes
filename + contenthashes for file items, skipping upload/download for identical files. - Store & Offload (
store_folder): Uploads local folders to Google Drive, verifies that all file hashes match in Drive, and moves the local directory to Trash. - Container Fetching (
fetch_container): Downloads containers from Drive into local directories using original folder names. Supports interactive TUI selection! - Full
uvandpipSupport: Modernpyproject.tomlpackaging built withhatchling.
Installation
Using uv (Recommended)
uv pip install -e .
Using pip
pip install -e .
Setup & Authentication
Before running EasyStorage, you need a Google Drive OAuth client secrets JSON file.
- Step-by-Step Setup Guide: See SETUP_SECRETS.md for detailed instructions on creating and saving your Google Drive OAuth credentials.
- Default File Locations: Save your JSON file to
~/.easystorage_secrets.json(global) or./client_secrets.json(project local).
CLI Usage
Interactive Container Fetch (TUI)
If you specify only the destination path, an interactive TUI menu will open displaying all available containers from Google Drive for selection:
easystorage fetch /path/to/destination
You can also explicitly pass the container_id:
easystorage fetch <container_id> /path/to/destination
Other Commands
# List all active containers in Drive
easystorage list
# Upload & update a local folder (without deleting local files)
easystorage update /path/to/my_folder
# Upload, verify integrity, and move local folder to Trash
easystorage store /path/to/my_folder
Python API Usage
from easystorage import (
get_drive,
get_containers_folder,
get_list_of_containers,
update_container,
store_folder,
fetch_container
)
# 1. Authorize Drive session
drive = get_drive()
# 2. List containers in Google Drive
containers = get_list_of_containers(drive)
for c in containers:
print(f"Container: {c.name} | ID: {c.id}")
# 3. Synchronize a local folder to Drive (keeps local files)
update_container("/path/to/my_folder", drive=drive)
# 4. Offload a folder to Drive (verifies upload integrity, then trashes local folder)
store_folder("/path/to/my_folder", drive=drive)
# 5. Fetch a container from Drive back to local disk
fetch_container("<container_id>", "/path/to/destination", drive=drive)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easystorage-0.2.0.tar.gz.
File metadata
- Download URL: easystorage-0.2.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8596ecdffd96fcdca94181ff5d37494068531273738dd130f850d6f0487af407
|
|
| MD5 |
32df7a8b588f6e5abb0e85e0161b8fad
|
|
| BLAKE2b-256 |
7b8321e4dde4d4537e876db33ab545527fe0c0133d8168f9403948a893d0396f
|
File details
Details for the file easystorage-0.2.0-py3-none-any.whl.
File metadata
- Download URL: easystorage-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
774a574619b1d555a7404de32b476a324bdfbd70a5bc7b9be647cb442f808f05
|
|
| MD5 |
7f72d091b2f97e871da4796849720a0d
|
|
| BLAKE2b-256 |
b3c3a6035500984f12d55ec90824a36597de1dc378ef1b698448b977c4968371
|