A robust Python wrapper for AO Connect using Node.js bridges. This guide will help you clone, set up, and use the repository.
git clone https://github.com/imortaltatsu/aopy-connect.git
cd aopy-connect# Install Python package
pip install -e .
# Install npm dependencies (required)
npm install -g @permaweb/aoconnectfrom aopy_connect import AOConnectWrapper
print("✅ Package imported successfully!")git clone https://github.com/imortaltatsu/aopy-connect.git
pip install aopy-connectgit clone https://github.com/imortaltatsu/aopy-connect.git
cd aopy-connect
pip install -e .
npm install -g @permaweb/aoconnect- Python 3.7+
- Node.js (for AO Connect bridge)
- npm package
@permaweb/aoconnect
from aopy_connect import AOConnectWrapper
# Initialize the wrapper
ao = AOConnectWrapper()
# Generate a wallet
wallet = ao.generate_wallet()
print("Wallet:", wallet)
# Spawn a process (replace with your process source)
process_id = ao.spawn_process(source="your_process_hash", tags=["MyApp"], scheduler="", data="")
print("Process ID:", process_id)
# Send a message
result = ao.send_message(process_id, "Hello AO!")
print("Message result:", result)
# Evaluate code
eval_result = ao.send_eval(process_id, "print('Hello from backend!')")
print("Eval result:", eval_result)
# Read results
results = ao.read_results(process_id)
print("Results:", results)
# Dry run
dry_run_result = ao.dry_run(process_id, "print('Test!')")
print("Dry run:", dry_run_result)aopy-connect/
├── setup.py # Package configuration
├── pyproject.toml # Build configuration
├── README.md # This file
├── LICENSE # MIT License
├── aopy_connect/ # Main package
│ ├── __init__.py # Package initialization
│ ├── ao_connect_wrapper.py # Main wrapper class
│ └── node_scripts/ # Node.js bridge scripts
├── examples/ # Usage examples
├── tests/ # Test files
└── node_scripts/ # Node.js scripts
git clone https://github.com/imortaltatsu/aopy-connect.git
cd aopy-connectpip install -e .npm install -g @permaweb/aoconnectpython -m pytest tests/python examples/basic_usage.py-
ModuleNotFoundError: No module named 'aopy_connect'
- Make sure you're in the correct directory
- Try:
pip install -e .
-
npm not found
- Install Node.js from https://nodejs.org/
- Then run:
npm install -g @permaweb/aoconnect
-
@permaweb/aoconnect not found
- Run:
npm install -g @permaweb/aoconnect
- Run:
# Check Python package
python -c "import aopy_connect; print('✅ Python package OK')"
# Check npm
npm --version
# Check AO Connect
npm list -g @permaweb/aoconnect- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test:
python -m pytest tests/ - Commit:
git commit -m "Add feature" - Push:
git push origin feature-name - Create a Pull Request
MIT License - Use it however you want!