Skip to main content

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 _secret or configured secret-name subtree with ***, including objects and arrays.
  • _url fields scrub userinfo passwords and secret-named query parameters; surrounding whitespace is trimmed and internal whitespace redacts the whole field.
  • OutputOptions.url_names applies URL treatment to exact legacy field names and recurses through collections. redact_urls_in_text is 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.
  • Logging records use kind:"log" with a nested log payload and a separate level field, so error-level logs are not terminal protocol errors.
  • build_cli_error(message, hint?) returns a strict-ready CLI error with error.retryable:false and trace:{}.
  • Do not add a raw version/help pre-parser. Until the Python CliSpec compiler lands, applications should keep lifecycle parsing in their own parser rather than claim AFDATA closed-world help compatibility.

Reference

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_first_data-0.33.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_first_data-0.33.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file agent_first_data-0.33.0.tar.gz.

File metadata

  • Download URL: agent_first_data-0.33.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for agent_first_data-0.33.0.tar.gz
Algorithm Hash digest
SHA256 20b9a4287533820e586453082c6ebf007b1107d714ee0127bce422dbe39b5e19
MD5 ed14fb229aa54c35e891ae9f902d2ef8
BLAKE2b-256 528f31c4a8f1fd0218fccec463d7cd15c3a68418d995da6fc1854a2ffc49cd8d

See more details on using hashes here.

File details

Details for the file agent_first_data-0.33.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_first_data-0.33.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02a068411307e17aea6d47f20396af3ab9f650ebe72ffbf771d8f6a250afcabc
MD5 eb2ceb72a9b65d00f1e6758cc3ab893f
BLAKE2b-256 d85ce217bd818026e7f8231272a9c94ea7a3df72a6a7757e29aed765b1347609

See more details on using hashes here.

Release history Release notifications | RSS feed

0.34.0

2 files

This release

0.33.0 This release

2 files

0.32.1

2 files

0.32.0

2 files

0.31.0

2 files

0.30.0

2 files

0.29.2

2 files

0.29.1

2 files

0.29.0

2 files

0.28.1

2 files

0.28.0

2 files

0.27.0

2 files

0.26.2

2 files

0.26.1

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.1

2 files

0.19.0

2 files

0.18.0

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.1

2 files

0.16.0

2 files

0.15.0

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page