googleapiutils2 CLAUDE.md

A Python wrapper around Google services including Drive, Sheets, Gmail, Admin, Groups, and Geocoding. It provides reusable classes for authentication, file operations, spreadsheet changes, monitoring, formatting, retries, and caching.

In plain words
What is it for?
Use it to upload, download, copy, list, and monitor Drive files; create and edit Sheets data; work with related Google APIs; and automate access with service accounts.
Why use it?
It avoids repeating low-level Google API setup and common handling for authentication, pagination, throttling, retries, and stale cached data.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/mkbabb/googleapiutils2/claude-md
Clone the repo
git clone --depth 1 https://github.com/mkbabb/googleapiutils2
Per session 2,143 This file is loaded in full into every session.
When invoked 2,143 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02143 $0.02143
Opus 5 $0.01071 $0.01071
Sonnet 5 $0.00429 $0.00429
Haiku 4.5 $0.00214 $0.00214

Measured yesterday against content hash a50fe572f5ee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

googleapiutils2 CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 282 lines

How it starts

The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.

googleapiutils2

Python wrapper for Google APIs: Drive, Sheets, Gmail, Admin, Groups, Geocoding.

Installation

pip install googleapiutils2

Requires Python ^3.12

File Tree

googleapiutils2/
├── __init__.py              # Package exports
├── monitor.py               # DriveMonitor, SheetsMonitor (change detection)
├── utils/                   # Core infrastructure
│   ├── __init__.py          # Utils exports
│   ├── drive.py             # DriveBase, auth, exceptions, MIME utils
│   ├── decorators.py        # retry, cache_with_stale_interval
│   ├── misc.py              # GoogleMimeTypes, SCOPES, constants
│   └── utils.py             # Throttler, hex_to_rgb, URL parsing
├── drive/                   # Google Drive API
│   ├── __init__.py          # Drive, Permissions exports
│   ├── drive.py             # Drive class (upload, download, copy, list, etc.)
│   └── misc.py              # Constants, pagination helpers
├── sheets/                  # Google Sheets API
│   ├── __init__.py          # Sheets, SheetsValueRange, SheetSlice exports
│   ├── sheets.py            # Sheets class (CRUD, formatting, batching)
│   ├── sheets_value_range.py  # Range wrapper with slice notation
│   ├── sheets_slice.py      # Slice indexing implementation
│   └── misc.py              # A1 notation, enums, constants
├── mail/                    # Gmail API
│   ├── __init__.py          # Mail export
│   └── mail.py              # Mail class (send, draft, labels, messages)
├── admin/                   # Google Workspace Admin API
│   ├── __init__.py          # Admin export
│   └── admin.py             # Admin class (user management)
├── groups/                  # Google Groups API
│   ├── __init__.py          # Groups export
│   ├── groups.py            # Groups class (group/member management)
│   └── misc.py              # Constants
└── geocode/                 # Google Maps Geocoding API
    ├── __init__.py          # Geocode export
    ├── geocode.py           # Geocode class (address ↔ coordinates)
    └── misc.py              # TypedDicts, LocationType enum

test/                        # Integration tests (live API)
├── conftest.py              # Shared fixtures
├── drive/                   # Drive tests
├── sheets/                  # Sheets tests
└── geocode/                 # Geocode tests

examples/                    # Usage examples
├── drive_upload.py          # Upload files/folders
├── sheets_crud.py           # Sheet operations
├── mail.py                  # Send emails
├── monitor.py               # Change detection
└── ...

Read the full file on GitHub · 282 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 282 lines · 2,143 tokens per session scan A a50fe572f5ee

Subscribe to this mod's changes

googleapiutils2 CLAUDE.md is an instructions file published in the GitHub repository mkbabb/googleapiutils2 (5 stars, last pushed 9mo ago), licensed MIT. It adds 2,143 tokens to every session, about $0.0107 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.