A naming convention that lets AI agents understand your data without being told what it means.
Project description
Agent-First Data for Python
pip install agent-first-data
from agent_first_data import output_json, output_plain
value = {
"code": "ok",
"result": {
"api_key_secret": "sk-123",
"latency_ms": 1280,
"db_url": "postgres://user:p@ss@db/app?token_secret=abc",
},
}
print(output_json(value))
print(output_plain(value))
Useful names use Python casing: output_json, output_yaml, output_plain, output_json_with_options, redacted_value, redact_secrets_in_place, redact_url_secrets, parse_size, normalize_utc_offset, is_valid_rfc3339_date, is_valid_rfc3339_time, cli_parse_output, cli_output, build_cli_error, build_cli_version, and cli_handle_version_or_continue.
Logging is available through init_logging_json, init_logging_plain, init_logging_yaml, span, and get_logger.
from agent_first_data import init_logging_json
init_logging_json("INFO", secret_names=("authorization",))
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/plain quote and escape keys as well as values, sort by UTF-16 code unit order, and render nested objects in arrays as canonical JSON.
- Logging records use
code: "log"plus a separatelevelfield, so error-level logs are not terminal protocol errors. build_cli_error(message, hint?)returns{code:"error", error: message, hint?}only.- Use
cli_handle_version_or_continue()before argument parsing so bare--versionstays conventional and--version --output json|yaml|plainstays structured.
Reference
- Full convention and API groups: docs/overview.md
- Formal cross-language contract: spec/agent-first-data.md
- Conformance fixtures: spec/fixtures
- Agent skill: skills/agent-first-data.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.14.2.tar.gz.
File metadata
- Download URL: agent_first_data-0.14.2.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e815d239925583e847bc4a35b6f0abb8dcea07c844ecdfe2ba8f7b213df59b21
|
|
| MD5 |
a42c9f19aa155e004ba6ddf4ab62b76e
|
|
| BLAKE2b-256 |
f0b767933e016d9997e279ab86fca35544397e7053b1bc6c7f9162485030427a
|
File details
Details for the file agent_first_data-0.14.2-py3-none-any.whl.
File metadata
- Download URL: agent_first_data-0.14.2-py3-none-any.whl
- Upload date:
- Size: 21.8 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 |
d3fd4603947ea6035d3ed096bc36b80f5a2c2c7731bf0d142eca56d64fb6d4dd
|
|
| MD5 |
7fdaaaf55c90d5cfe11ed6aec594f910
|
|
| BLAKE2b-256 |
1561352c6669e02eb08a06a27b59ffdfd2e143229be982d31c4184bae56a9664
|