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, redact_urls_in_text, redact_argv, 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, 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 or a://that is not the start of a clean URL redacts the whole field, where whitespace is the explicit UnicodeWhite_Spaceset the spec enumerates, not the language's native predicate.OutputOptions.url_namesapplies URL treatment to exact legacy field names and recurses through collections.redact_urls_in_textis explicit and scans only complete scheme URLs, never arbitrary prose secrets.- 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; it quotes a value only when it contains ASCII space, tab, newline, carriage return, form feed, vertical tab, NBSP,
=,", or\, and escapes\,", newline, carriage return, tab, form feed, and vertical tab inside the quotes. - 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:{}.- Do not add a raw version/help pre-parser. Until the Python
CliSpeccompiler lands, applications should keep lifecycle parsing in their own parser rather than claim AFDATA closed-world help compatibility.
Reference
- Formal cross-language contract: spec/agent-first-data.md
- Conformance fixtures: spec/fixtures
- Agent skill: skills/agent-first-data/SKILL.md
Metadata
Release files for agent-first-data 0.35.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_first_data-0.35.1.tar.gz | 49.7 kB | Without provenance | Details for agent_first_data-0.35.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_first_data-0.35.1-py3-none-any.whl | Python 3 | none | any | Details for agent_first_data-0.35.1-py3-none-any.whl |
Total release size: 84.5 kB
Release files / agent_first_data-0.35.1.tar.gz
| Download URL | agent_first_data-0.35.1.tar.gz |
|---|---|
| Size | 49.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e9bf0a082a4746ecc58ca9816b6a2a1095f5ce445a00b334ed5c725da2dd4f1
|
|
BLAKE2b-256 checksum How to use checksums |
64cf3d45fab87785246667d08792ce834070617bbc99eadac81dc8ce037dc873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.10
|
Release files / agent_first_data-0.35.1-py3-none-any.whl
| Download URL | agent_first_data-0.35.1-py3-none-any.whl |
|---|---|
| Size | 34.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
294b74d387b83092d8258a1298a3b6b1bb07aa90c9742a0a352a70268d1b4db0
|
|
BLAKE2b-256 checksum How to use checksums |
9918e655444a87767ea9403a1f32f5889edd7e3d310b53ca45e61bdcb58d3f66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.10
|
Security for agent-first-data 0.35.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.