Skip to main content

Portable, AI-native data sheets.

Project description

folio-kit

Portable, AI-native data sheets. The Python distribution ships three console scripts and a Python SDK for reading and writing typed data sheets that humans and AI agents can both edit.

my-sheet/
├── contract.yaml         # required — ODCS subset
├── records.jsonl         # required — one JSON object per line
├── derivations/          # optional — derivation files (ai / python / sql / cross_sheet / import / http)
├── scripts/              # optional — reusable Python scripts
├── provenance.jsonl      # append-only audit log
└── README.md             # optional, with typed frontmatter

What you get

Surface Command Purpose
CLI folio validate, query, list, upsert, delete, materialize, status, provenance, serve, script, export
MCP server folio-mcp FastMCP server exposing the SDK over stdio or HTTP — drop into Claude Desktop / Cursor / any MCP client
Viewer backend folio-viewer Local-only FastAPI server that powers the Folio Viewer desktop app and web UI
Python SDK from folio import open_sheet Programmatic access to the same operations as the CLI

Install

pipx install folio-kit
# or
uv tool install folio-kit

The distribution name is folio-kit; the on-disk command is folio.

Quickstart

folio validate ./my-sheet
folio materialize ./my-sheet --actor agent:demo
folio query ./my-sheet "SELECT id, status FROM records LIMIT 5"

Programmatic:

from folio import open_sheet

sheet = open_sheet("./my-sheet", actor="agent:demo")
sheet.upsert({"id": "cust_001", "company_name": "Acme", "country": "Japan"})
result = sheet.materialize()
print(result)   # {"materialized": 1, "skipped": 0, "failures": [], "total_cost": 0.0}

Derivations

A derivations/<field>.yaml declares how a derived column is filled. Folio ships six kinds:

  • ai — call an LLM (Anthropic by default; injectable AIClient)
  • python — run a reusable script from scripts/
  • sql — DuckDB query against the sheet's records view
  • cross_sheet — pull a value from a sibling Folio sheet (1:1 by PK)
  • import — copy from a CSV / JSON file
  • http — fetch from a URL

Every value comes with a provenance entry (actor, timestamp, input hash, model + cost for ai). Re-runs are content-hashed and cached.

Requirements

  • Python 3.13+
  • Optional: ANTHROPIC_API_KEY in the environment if you use kind: ai derivations against the default adapter. Bring-your-own AIClient for any other provider.

Links

License

MIT.

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

folio_kit-0.1.7.tar.gz (303.6 kB view details)

Uploaded Source

Built Distribution

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

folio_kit-0.1.7-py3-none-any.whl (64.9 kB view details)

Uploaded Python 3

File details

Details for the file folio_kit-0.1.7.tar.gz.

File metadata

  • Download URL: folio_kit-0.1.7.tar.gz
  • Upload date:
  • Size: 303.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for folio_kit-0.1.7.tar.gz
Algorithm Hash digest
SHA256 bfa42dd3c0f4f9d75e76b9c8003555e3784e19d526c27a4523e0d38e464ce6bb
MD5 7a4d0ba4c2196951b5983f3e5867efbb
BLAKE2b-256 4fabe33a584b7023f3daa56cf9edb41d8cd905d27ab1e1b2c9c2af4b78642a61

See more details on using hashes here.

Provenance

The following attestation bundles were made for folio_kit-0.1.7.tar.gz:

Publisher: release-python.yml on nyuta01/folio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file folio_kit-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: folio_kit-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 64.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for folio_kit-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 eb78ac991011293169a8781157c55e66b1ee8111d516fec141adc428e2a3ea0e
MD5 cdc44910a70f6f742a34515558d38ff7
BLAKE2b-256 b7e157ceb2bcc39be6b3ac6e6ccd734df798a3810693d24c039afff846496a77

See more details on using hashes here.

Provenance

The following attestation bundles were made for folio_kit-0.1.7-py3-none-any.whl:

Publisher: release-python.yml on nyuta01/folio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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