A naming convention that lets AI agents understand your data without being told what it means, plus a CLI and library for reading and safely editing structured JSON, TOML, YAML, dotenv, and INI documents.
Project description
Agent-First Data for Python
pip install agent-first-data
from agent_first_data import json_result, render, OutputFormat
value = json_result(
{
"api_key_secret": "sk-123",
"latency_ms": 1280,
"db_url": "postgres://user:p@ss@db/app?token_secret=abc",
}
).build()
print(render(value, OutputFormat.JSON))
print(render(value, OutputFormat.PLAIN))
Useful names use Python casing: render (the single value x format x options -> str entry point; takes an OutputFormat and an optional keyword-only options=), redacted_value, redact_url_secrets, normalize_utc_offset, is_valid_rfc3339_date, is_valid_rfc3339_time, is_valid_rfc3339, is_valid_bcp47, cli_parse_output, build_cli_error, build_cli_version, cli_handle_version_or_continue, decode_protocol_event.
Behavior Notes
- Default redaction replaces every
_secretor configured secret-name subtree with***, including objects and arrays. _urlfields scrub userinfo passwords and secret-named query parameters; surrounding whitespace is trimmed and internal whitespace redacts the whole field.- YAML keeps original keys and values (structure-preserving, like JSON), sorting keys by UTF-16 code unit order and quoting/escaping unsafe keys and string scalars. Plain strips formatting suffixes, formats values, sorts the same way, and renders nested objects/arrays as canonical JSON.
- Logging records use
kind:"log"with a nestedlogpayload and a separatelevelfield, so error-level logs are not terminal protocol errors. build_cli_error(message, hint?)returns a strict-ready CLI error witherror.retryable:falseandtrace:{}.- Use
cli_handle_version_or_continue()before argument parsing so--version/-Valways answers with a structured protocol-v1kind:"result"version event — JSON by default, or--output yaml|plain/--jsonfor another format; there is no conventional bare-text form. Pass your own value-taking global flag names so their value is not mistaken for the subcommand boundary.
Reference
- Formal cross-language contract: spec/agent-first-data.md
- Conformance fixtures: spec/fixtures
- Agent skill: skills/agent-first-data/SKILL.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_first_data-0.22.0.tar.gz.
File metadata
- Download URL: agent_first_data-0.22.0.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5ba4301cdea02fbdb846eb167753b719ecf3e91bebfce85e79cde5d49f8360
|
|
| MD5 |
9549a94943f049e11e48ebce6c4ddee8
|
|
| BLAKE2b-256 |
c83a5feab154ce7ddd7ba6c39b55433171647376c9e1228396f759f3fdf185d8
|
File details
Details for the file agent_first_data-0.22.0-py3-none-any.whl.
File metadata
- Download URL: agent_first_data-0.22.0-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38b5e42dd2361511618f359a9841d7d45216668ef99e66e0897f862a2ab2ec91
|
|
| MD5 |
3afceb07c4febf78a98fd92fb018fd7a
|
|
| BLAKE2b-256 |
ef0393c40532470bf2c0d08f7d106380223022114c24d398db1d142a10511b2e
|