Skip to main content

c3db

Query the C3DB competition-climbing warehouse from your terminal — as raw SQL or from your own AI coding tool. It's a thin client over C3DB's hosted, read-only MCP server: every query is a single SELECT/WITH, cost-capped, row-capped, and timed out server-side. Nothing about the vetted query core is reimplemented here.

pip install c3db
c3db login                                   # sign in via your browser (one time)
c3db query "SELECT * FROM event_standings WHERE final_rank = 1 LIMIT 5"
c3db connect claude                          # wire the warehouse into Claude Code
c3db connect codex                           # or Codex (signs in through your browser)

pip install "c3db[ask]"                      # natural-language querying (bring your own model)
export ANTHROPIC_API_KEY=sk-ant-…            # your own model key — c3db never sees it
c3db ask "who has won the most World Cup golds in lead?"
from c3db import Client

df = Client().query("SELECT athlete_name, count(*) wins "
                    "FROM event_standings WHERE final_rank = 1 GROUP BY 1 ORDER BY 2 DESC")

Commands

Command What it does
c3db login Sign in through your browser to mint + store a c3db_… key (~/.config/c3db/config.json, 0600). --paste to paste a key instead (headless/SSH).
c3db query "<sql>" Run a read-only query. -f file.sql or stdin for the SQL. At a terminal, small results (≤50 rows) print and you're offered a download; big ones show a summary and suggest saving. -o out.csv (or .parquet / .json) saves straight to a file; --format table|csv|json writes to stdout for pipes.
c3db ask "<question>" Plain-English → SQL → rows, using your own model. --provider, --model, --base-url, --show-sql. Needs pip install "c3db[ask]".
c3db connect claude|cursor|codex Register the hosted MCP into your AI tool so its model can query the warehouse. --scope user|local|project (Codex: user only). Codex signs in through your browser (OAuth) instead of using the stored key; codex mcp login c3db signs in again.
c3db schema Print the query conventions + authoritative BigQuery DDL.

Natural language — bring your own model

c3db ask and Client().ask() are bring-your-own-model: your own LLM reads the warehouse schema and writes the SQL; c3db validates and runs it. c3db never sees or pays for your model key — it's separate from the c3db_… data key. Install a provider and set its key:

pip install "c3db[anthropic]"    # or "c3db[openai]", or "c3db[ask]" for both
export ANTHROPIC_API_KEY=…       # Anthropic (default: claude-sonnet-5 — plenty for NL→SQL)
export OPENAI_API_KEY=…          # OpenAI-compatible; add C3DB base url / --base-url for DeepSeek/GLM/local
c3db ask "top 3 nations by lead World Cup wins since 2020"

Already use Claude Code? Then Claude needs no key at all — if you've run ant auth login (or Claude Code is set up), c3db ask picks up that OAuth login automatically. Just pip install "c3db[anthropic]" and ask.

Provider auto-detects (Anthropic by default — including via that OAuth login; override with --provider); --model picks the model. Client().ask(q) returns a DataFrame with the generated SQL on df.attrs["sql"].

The two kinds of access

  • Raw SQL (c3db query, Client().query()) — you write the SQL; c3db runs it and hands back rows.
  • Your own AI (c3db connect) — your AI tool's model reads the schema and writes the SQL itself, then runs it through the same server. This is bring-your-own-model: c3db never sees or pays for your AI subscription; it only issues the c3db_… data key that identifies you to the warehouse.

Results, limits & bulk data

A query returns up to 50,000 rows to the client (add a LIMIT for more than the default 1,000; the scan is capped at 2 GB and 60 s regardless). Save results locally as csv / parquet / json. The AI path (c3db connect) only sees a ~50-row preview plus the true row count — your model answers from that and points you here for the full data. For the whole raw dataset (bulk), self-serve download is coming; for now email yvonnelau.work@gmail.com.

Config

Resolved in order: environment → ~/.config/c3db/config.json → built-in default.

Variable Meaning
C3DB_API_KEY Your c3db_… data key (overrides the stored one).
C3DB_SERVER_URL MCP endpoint (defaults to the hosted service).
C3DB_CONFIG_DIR Override the config directory (default ~/.config/c3db).

c3db login mints your key self-serve (sign in on the C3DB site → the key is created and stored locally). No key is typed at the terminal. Manage or revoke keys any time at the site's login page.

Metadata

Release files for c3db 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for c3db 0.2.2
File Size Uploaded Provenance Actions
c3db-0.2.2.tar.gz 14.9 kB With provenance Details for c3db-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for c3db 0.2.2
File Interpreter ABI Platform Actions
c3db-0.2.2-py3-none-any.whl Python 3 none any Details for c3db-0.2.2-py3-none-any.whl

Total release size: 33.7 kB

Release files / c3db-0.2.2.tar.gz

Download URL c3db-0.2.2.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
566e9e3ae7a90a7127613f8a0eb1476c2446ab7be57b6cb3f4f0dd923b7c446b
BLAKE2b-256 checksum
How to use checksums
4e6e7c9ec1139f34e68d16d84136703347f396f4f8571ee96e7c155dbcc96b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / c3db-0.2.2-py3-none-any.whl

Download URL c3db-0.2.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be87ee921c5400eec4e00310ab936796e3988c6c96e5b35d24b882bc6f133320
BLAKE2b-256 checksum
How to use checksums
7291de3691237334a1e16c898b8977a0fb382b11c2815e4e561e2e112692de01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for c3db 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for c3db-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page