Skip to main content

Portable, AI-native data sheets.

Project description

Folio

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
├── skills/               # optional — packaged operating procedures (markdown + YAML frontmatter)
├── provenance.jsonl      # append-only audit log
└── README.md             # optional, with typed frontmatter

What you get

Surface Command Purpose
CLI folio init, validate, query, list, count, upsert, delete, materialize, status, provenance, serve, script, skill, export
MCP server folio-mcp FastMCP server exposing the SDK over stdio or HTTP — plus one MCP prompt per skill — 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.8.tar.gz (366.5 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.8-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: folio_kit-0.1.8.tar.gz
  • Upload date:
  • Size: 366.5 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.8.tar.gz
Algorithm Hash digest
SHA256 95dc37c97f7d515b535fbbc0ce77ad055fe7379c384210eaa15ef04a884e9935
MD5 6b24d71a21df2ee040ad3b4644d4ff86
BLAKE2b-256 7a9685b696c1d99ae8ef0d85e56e6f0c081282cc6b0227bb80fd380b11b31246

See more details on using hashes here.

Provenance

The following attestation bundles were made for folio_kit-0.1.8.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.8-py3-none-any.whl.

File metadata

  • Download URL: folio_kit-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 70.1 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9b01ab628a3f00183ad3256c1eb46a2bb32a6a2deb6604ea7123851729433e0d
MD5 580b9cf41f8d46f5a3bc1a329b032755
BLAKE2b-256 9e1c605b557bbb90df11ec3412ba71013a6235c1c32874b569c912a160fc7ced

See more details on using hashes here.

Provenance

The following attestation bundles were made for folio_kit-0.1.8-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