Skip to main content

Python SDK for Axon browser automation

Project description

Axon Python SDK

A Python client library for Axon browser automation.

Installation

pip install axon-browser

Quick Start (On-Demand Engine)

Axon can now automatically manage the browser engine for you. No need to start the .exe manually.

import asyncio
from axon import Axon

async def main():
    # start_engine=True tells the SDK to launch axon.exe automatically
    async with Axon(start_engine=True) as axon:
        # Create a session
        session = await axon.create_session("mysession")
        
        # Navigate
        await axon.navigate("mysession", "https://github.com")
        
        # use the SMART tool (Intent-based)
        result = await axon.smart_interact("mysession", "the search input", "fill", "Axon")
        print(f"Action result: {result.success}")

asyncio.run(main())

Agent Framework Integration (Toolkit)

Axon provides a pre-packaged "Sensory Kit" for agents (like Vamora or LangChain).

from axon import Axon, AxonToolkit

async with Axon(start_engine=True) as axon:
    # 1. Initialize the toolkit
    kit = AxonToolkit(axon, session_id="agent_01")
    
    # 2. Get LLM-ready tools
    tools = await kit.get_tools()
    
    # 3. Run a tool from agent's choice
    output = await kit.run_tool("snapshot", {})
    print(output)

Configuration

The Axon client can be configured via:

  1. Constructor parameter:

    axon = Axon("http://localhost:8020/api/v1")
    
  2. Environment variable:

    export AXON_API_URL=http://localhost:8020/api/v1
    
    axon = Axon()  # Uses AXON_API_URL env var
    

API Reference

Session Management

# Create a session
session = await axon.create_session("mysession")

# Get session info
info = await axon.get_session("mysession")

# List all sessions
sessions = await axon.list_sessions()

# Delete a session
await axon.delete_session("mysession")

Navigation

# Navigate to a URL
await axon.navigate("mysession", "https://github.com")

Snapshots

# Get page snapshot
snapshot = await axon.snapshot("mysession")

# Print page elements
for element in snapshot.elements:
    print(f"{element.role}: {element.name}")

Actions

# Click
await axon.click("mysession", "e1")

# Fill input
await axon.fill("mysession", "e2", "Hello World")

# Hover
await axon.hover("mysession", "e3")

# Select option
await axon.select("mysession", "e4", "option1")

# Generic action
await axon.act("mysession", "click", "e1")

Find and Act

# Find element by semantic description and perform action
result = await axon.find_and_act(
    "mysession", 
    "click", 
    "search button"
)

Development

# Clone the repository
git clone https://github.com/rennissance-jomt/axon
cd axon/python

# Install in development mode
pip install -e .

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check .

Project details


Download files

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

Source Distribution

axon_browser-1.0.6.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

axon_browser-1.0.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file axon_browser-1.0.6.tar.gz.

File metadata

  • Download URL: axon_browser-1.0.6.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axon_browser-1.0.6.tar.gz
Algorithm Hash digest
SHA256 5afae59d544b7350ec35f840a45f745da49312c5ed4248d29382ab18fc87ef38
MD5 0b243273cc9a44818f53d551c961c37e
BLAKE2b-256 76aaac2c8c5dd8fa6c8e635c5e1a750d906de22bb61828e3bf0cb1a23bf9c607

See more details on using hashes here.

Provenance

The following attestation bundles were made for axon_browser-1.0.6.tar.gz:

Publisher: publish-python.yml on rennaisance-jomt/Axon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axon_browser-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: axon_browser-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axon_browser-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c34105e6348ba59bb7290918bd128ca7c8529cb2d0ea334354cd97b354be7b1d
MD5 ff32ee70dfcc59d91a4f2d1604937132
BLAKE2b-256 d0c8c5e6eddaa8f589879c544a1e1f1f5115bd35f26a05d976f5c330de5fbd6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for axon_browser-1.0.6-py3-none-any.whl:

Publisher: publish-python.yml on rennaisance-jomt/Axon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page