Skip to main content

Mirror Google Drive folders to local directories with format conversion

Project description

ascii-art-(3).jpg

Catoptromancy — divination by mirrors.

SOTA coding agents like Claude Code and Codex turn out to be very good everthing agents. Indeed, Claude Cowork, Anthropic's all purpose agent, is a close cousin of Claude Code and is built on the same stack (the anthropic agent SDK). And so agents (coding or no) work best when situated in an actual folder of files. They like to read text files, search through excels and explore folder strucutres. They have the best tools for exploring and understanding knowledge and context when it's hosted in a file system structure.

Google Drive Folders, while exteremely useful for collaboration, are not actially filesystems. Behind the scenes you can't download a google doc into a real file. Even the Google Drive Mac Apps just syncs links to files, not the actual fiels themselves. This makes it surprisingly hard to point an agent at a google drive folder and get the results you expect.

To solve this problem, Catoptromancy mirrors Google Drive folders into a local folder workspace where AI agents can actually work and into formats they can actually use. cato currently converts Google Docs into Markdown, Sheets into Excel, and Slides into PowerPoint.

This local copy also acts as a sandbox. Agents can read, edit, and create freely without touching the original data. Nothing syncs back to Drive. This version supports pull-only mirroring, so remote changes come down locally but there is no push command yet.

Installation

Install As A Tool

Install the latest version directly from Git:

uv tool install git+ssh://git@github.com/terra-hq/catoptromancy.git

Install Into The Current Environment

Install the package into the current virtualenv:

uv pip install git+ssh://git@github.com/terra-hq/catoptromancy.git

Updating

If installed as a tool:

uv tool upgrade catoptromancy

If installed into a virtualenv:

uv pip install --upgrade git+ssh://git@github.com/terra-hq/catoptromancy.git

Development Setup

Clone the repo, then install the project and dev dependencies:

git clone git@github.com:terra-hq/catoptromancy.git
cd catoptromancy
uv sync --extra dev

That creates or updates .venv/ with the package, pytest, ruff, and the other development dependencies.

Run the test suite with:

.venv/bin/pytest -q

Run the CLI from the project environment with:

.venv/bin/cato --help

Google Cloud Setup

For OAuth, create a desktop-app credentials file:

  1. Go to https://console.cloud.google.com/apis/credentials
  2. Create a project, or use an existing one
  3. Enable the Google Drive API
  4. Create an OAuth client ID for a Desktop app
  5. Download the JSON file
  6. Save it to ~/.config/catoptromancy/credentials.json

For service-account auth, pass --service-account /path/to/service-account.json to cato init instead of using OAuth.

Usage

Initialize A Workspace

For OAuth, cato init opens a browser for consent:

cato init <FOLDER_ID_OR_URL>

The folder reference can be either:

  • A raw Google Drive folder ID
  • A full Google Drive folder URL

The folder ID is the last part of a Drive folder URL:

https://drive.google.com/drive/folders/<THIS_PART>

Pull Files

cato pull

Force A Full Re-Download

cato pull --force

Check Status

cato status

Show Command Help

cato --help

Packaging

Catoptromancy is packaged as a standard Python project. Build configuration lives in pyproject.toml and uses hatchling.

Build Distributable Artifacts

uv build

This creates:

  • dist/*.whl
  • dist/*.tar.gz

Verify A Built Wheel Locally

uv pip install dist/*.whl

Publish A Release

  1. Bump the version in pyproject.toml.
  2. Run uv build.
  3. Publish the contents of dist/ to your package index.

Console Script

cato

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catoptromancy-0.1.0.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catoptromancy-0.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file catoptromancy-0.1.0.tar.gz.

File metadata

  • Download URL: catoptromancy-0.1.0.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for catoptromancy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9259db48fbdbdde0de29951c139b13bbef3c5a68a25e9b8a3eac3bedcc9e2ea
MD5 d744f75f1673f403650e66ddb69ba29e
BLAKE2b-256 5638a982af5607c253b6c67657ab42d6ecf7169be48509d0b4fd8d2b73d7a8c5

See more details on using hashes here.

File details

Details for the file catoptromancy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: catoptromancy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for catoptromancy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daddcae4e991c529f7fc53b4e778ead38db374a21557c84eba054a62840e775d
MD5 306a37c65ea20d5307e467791c6f8440
BLAKE2b-256 bbcff3dd235da635f8d0d42a7939f9db6dabbae3c5ce5ae8dc947bbc4d7adb7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page