agentpress-core
Zero-dependency reference parser for
agents.txt v1.0. Python.
Mirror of @agent_press/core (TypeScript). Use this from Python agent runtimes, CI scripts, and analysis tools.
Install
pip install agentpress-core
Quick start
from pathlib import Path
from agentpress_core import parse, validate, is_action_allowed, check_rate_limit, fetch_and_parse
# Parse a local file
text = Path("agents.txt").read_text(encoding="utf-8")
data = parse(text)
# Validate against the spec
result = validate(data)
if not result.ok:
for issue in result.issues:
print(issue.severity, issue.message)
# Decide what an agent may do
decision = is_action_allowed(data, "merge_to_main")
# "allow" | "deny" | "requires_approval" | "unknown"
# Respect rate limits
if not check_rate_limit(data, "pr", current_daily_pr_count):
raise RuntimeError("agents.txt rate limit reached for this repo")
# Or fetch directly
remote = fetch_and_parse("https://github.com/barneywohl/agentpress/raw/main/agents.txt")
API
| Function | Description |
|---|---|
parse(text) |
Parse a raw agents.txt string into a typed AgentsTxt object. Tolerant — never raises. |
validate(data) |
Returns ValidationResult(ok, issues). Errors fail validation; warnings don't. |
is_action_allowed(data, action) |
Returns "allow" | "deny" | "requires_approval" | "unknown". |
check_rate_limit(data, kind, count) |
kind in {"pr", "issue", "comment", "branch"}. |
fetch_and_parse(url, timeout=10.0) |
Fetch + parse. Standard library only (urllib). |
load(url, timeout=10.0) |
fetch_and_parse + validate — convenience. |
Why stdlib only
- Auditable in 30 minutes.
- Zero supply-chain risk.
- Pinnable in any Python project from 3.10 onwards.
License
MIT.
Metadata
Release files for agentpress-core 1.0.0
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 |
|---|---|---|---|---|
| agentpress_core-1.0.0.tar.gz | 8.2 kB | Without provenance | Details for agentpress_core-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentpress_core-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for agentpress_core-1.0.0-py3-none-any.whl |
Total release size: 14.3 kB
Release files / agentpress_core-1.0.0.tar.gz
| Download URL | agentpress_core-1.0.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ac74827698ce496ce0632a3dfe0e63212cb7db4de1953e584a0232ba0a0a915
|
|
BLAKE2b-256 checksum How to use checksums |
6386f62f2d1f7a9bb661bc50da985cfee5a9b476ff54d598b3dea6183ac955ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / agentpress_core-1.0.0-py3-none-any.whl
| Download URL | agentpress_core-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d62602a2f972ed02827a42a5002be3e33552805ffd2ea055f2485b9c6a4aa2c4
|
|
BLAKE2b-256 checksum How to use checksums |
2f9ad71022ce8af0aa54cf3622518e423dc8c47889c4803c552439d31a4c29b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for agentpress-core 1.0.0
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.