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 everything 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 (with or without coding) work best when situated in an actual folder of files. They like reading text files, searching Excel, and exploring folder structures. They have the best tools for exploring and understanding knowledge and context when it's organized in a file system.

Google Drive Folders, while extremely useful for collaboration, are not actually 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 files 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 workspace where AI agents can actually work and into formats they can actually use. cato currently converts Google Docs to Markdown, Sheets to Excel, and Slides to 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.1.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.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: catoptromancy-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e1f4ba2a730f878d030983d79b6b00030393e4bb33299c09e80d6fe7ac486536
MD5 b5ed50eb8a18231ca8e04a3d18627307
BLAKE2b-256 b99dcc4e4056ba00c8602cfa4bd20adceada83d34cf378d7416bd8734e24d38f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catoptromancy-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13d05ff5baba276739ac3ecfd10d5243a5a93fa6929318d751fd7fabc2b3032e
MD5 43ba3d1e27627580c406c6e23c0be5fa
BLAKE2b-256 41350975692e155a9cf5f60be4ccbf91bbbc618e9fabbf088e2dfe326c853dd5

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