Quick Start¶
Get up and running with AXL Protocol in under five minutes.
Installation¶
Requires Python 3.10+. Zero dependencies.
Parse an AXL Packet¶
from axl import parser
raw = "S:OPS.3|cpu_high|node-7|threshold=90|!ALERT|!ROUTE"
packet = parser.parse(raw)
print(packet.header.domain) # "OPS"
print(packet.header.tier) # 3
print(packet.fields) # ["cpu_high", "node-7", "threshold=90"]
Emit a New Packet¶
from axl import emitter
packet = emitter.emit(
domain="SIG",
tier=3,
fields=["intrusion_detected", "sector-4", "confidence=0.97"],
flags=["ALERT", "ESCALATE"],
timestamp=True,
nonce=True,
)
print(packet)
# T:1711234567|S:SIG.3|intrusion_detected|sector-4|confidence=0.97|!ALERT|!ESCALATE
Validate a Packet¶
from axl import validator
result = validator.validate("S:OPS.3|cpu_high|node-7|!ALERT")
print(result.valid) # True
print(result.errors) # []
print(result.tier) # 3
Translate Between Formats¶
from axl import translator
english = translator.to_english("S:OPS.3|cpu_high|node-7|!ALERT")
print(english)
# "Operations alert (priority 3): CPU high on node-7. Flags: ALERT."
json_out = translator.to_json("S:OPS.3|cpu_high|node-7|!ALERT")
print(json_out)
# {"domain": "OPS", "tier": 3, "fields": ["cpu_high", "node-7"], "flags": ["ALERT"]}
CLI Usage¶
# Parse a packet and display structured output
axl parse "S:OPS.3|cpu_high|node-7|!ALERT"
# Validate packet syntax and semantics
axl validate "S:OPS.3|cpu_high|node-7|!ALERT"
# Translate to human-readable English
axl translate --to english "S:OPS.3|cpu_high|node-7|!ALERT"
# Translate to JSON
axl translate --to json "S:OPS.3|cpu_high|node-7|!ALERT"
Links¶
- PyPI: pypi.org/project/axl-core
- GitHub: github.com/axl-protocol/axl-core
- Next: Python Library Reference | CLI Reference