focus-data-toolkit: Generate provider-realistic FOCUS 1.2/1.3 sample data (AWS, Azure, GCP) and convert it to the four FOCUS 1.4 datasets — strictly from source facts, completed by client supplements including native AWS/Azure/GCP exports — with schema detection, gap analysis, a cross-dataset validation gate and atomic writes. · Pythie
Generate provider-realistic FOCUS 1.2/1.3 sample data (AWS, Azure, GCP) and convert it to the four FOCUS 1.4 datasets — strictly from source facts, completed by client supplements including native AWS/Azure/GCP exports — with schema detection, gap analysis, a cross-dataset validation gate and atomic writes.
Actively maintained.Last release 7 weeks ago, commits in 10 of the last 26 weeks. A safe choice.
Generate realistic FOCUS 1.2 / 1.3 cost and usage data (AWS, Azure, GCP), convert it to
FOCUS 1.4, and validate the result. One dependency-free Python core, usable three ways.
FOCUS is the open standard for cloud cost and usage data. FOCUS 1.4 defines four datasets: Cost and Usage, Contract Commitment, Billing Period, and Invoice Detail. The toolkit is honest by design: any value it cannot derive from your source is left empty (strict mode) or filled with clearly labelled assumptions (synthetic mode).
The source prepares 0.14.1, a patch of 0.14.0, which converts FOCUS 1.2/1.3
sources toward 1.4 more faithfully:
values are migrated to the 1.4 rules, and a stricter 1.4 lint checks the output;
commitment terms can be supplied explicitly;
Azure reservation and savings plan orders have adapters;
a 1.2 source can declare who issued it, to name its Service Provider, in the CLI
and, since 0.14.1, in Studio.
0.14.1 also reads the Contract Commitment dataset of a generated sample from the
sample itself, so it lists every commitment the sample applies. See the
conversion rules and the changelog.
The generator corrections and validation evidence
describe the generated samples, unchanged since 0.13.0. The Docker examples below
continue to pin the previously released 0.12.0 image.
Three ways to use it
Interface
Best for
Get started
Studio
FinOps users who prefer a UI
pip install "focus-data-toolkit[studio]" then focus-toolkit ui
Runner
Automation and large volumes
docker run --rm ghcr.io/guymano/focus-data-toolkit:0.12.0 version
CLI & SDK
Engineers and scripts
pip install focus-data-toolkit then focus-toolkit --help
All three run the same core, so their outputs are byte-for-byte identical. Studio is a local web app (binds 127.0.0.1, token-guarded, no data leaves your machine, see docs/studio.md). Runner is a non-root OCI image whose entrypoint is the CLI (see docs/runner.md).
Install
pip install focus-data-toolkit
The core needs only the standard library (Python 3.11+). Optional extras:
the official FinOps validator (--official, needs Python 3.12+)
all
everything above
Also available via pipx install, uv tool install, or docker pull ghcr.io/guymano/focus-data-toolkit:0.12.0.
Quickstart
# 1. Generate sample data (aws|azure|gcp, FOCUS 1.2|1.3)
focus-toolkit generate --provider aws --focus-version 1.3 --rows 1000 --out ./out
# 2. Convert a 1.2/1.3 Cost and Usage file to FOCUS 1.4 (source version auto-detected)
focus-toolkit convert --cost-and-usage out/focus_1_3_cost_and_usage_aws.csv --out ./focus-1.4
# 3. Open the Studio web app (needs the studio extra)
focus-toolkit ui
Or use it as a Python library, the same engine behind all three interfaces:
from focus_data_toolkit import convert_files
convert_files("cost_and_usage.csv", "focus-1.4", mode="strict")
Everything a library caller needs is importable from the package root, including
supplements and the failures to handle:
from pathlib import Path
from focus_data_toolkit import (
AtomicWriteError, ConversionError, Mode, SupplementBundle, SupplementError,
SupplementFileSpec, convert_files,
)
try:
bundle = SupplementBundle.load([SupplementFileSpec(path=Path("invoices.json"))])
convert_files("cost_and_usage.csv", "focus-1.4", mode=Mode.STRICT, supplements=bundle)
except (ConversionError, SupplementError):
... # invalid source or unusable supplement: nothing was written
except AtomicWriteError:
... # the lint or cross-dataset gate refused publication: nothing was written
What it does, and what it doesn't
Converts FOCUS 1.2/1.3 Cost and Usage into the four FOCUS 1.4 datasets. Values a 1.4 rule
fixes deterministically are migrated and reported (FDT-MIG-*). Values it cannot fix without
inventing a fact are refused. See docs/conversion-rules.md.
The three other datasets come only from supplements or synthetic mode.
There is no FOCUS 1.4 generator and no invalid-data generator.
Built for real data: bounded-memory streaming (--stream), atomic writes, a deterministic
manifest with per-column lineage, structured FDT-* diagnostics, cross-dataset validation.