OGMA
Enhanced logging and messaging framework with rich console support and distributed message bus capabilities.
## Overview
OGMA provides:
- **Advanced logging capabilities** with optional rich terminal output
- **Distributed message bus** using ZMQ for inter-process communication
- **Subagent management** for spawning and managing background workers
- **Channel-based messaging** for publish/subscribe patterns
- **RPC support** for request/response communication
- **Service discovery** for finding and connecting to agents
## Current Status
- **State**: Active
- **Version**: 0.0.1.0.1.2
- **License**: MIT
## Key Features
### Logging (`kahndor.logma`)
- Extended `logging.Logger` class with convenience methods
- Rich console output (colorized, tables, markup)
- JSON/YAML output helpers
- Process timing and tracking
- Diff utilities for dicts and strings
### Message Bus (`ogma.channels`, `ogma.protocols`)
- ZMQ-based publish/subscribe channels
- Request/response messaging
- Dealer/router patterns for subagent communication
- Peer-to-peer messaging support
### Subagent System (`ogma.subagent`)
- Spawn and manage background workers
- Subagent bus for task distribution
- Worker pool management
- Task timeout and retry handling
### RPC (`ogma.rpc`)
- Remote procedure call support
- Timeout and retry mechanisms
- Automatic serialization
### Discovery (`ogma.discovery`)
- Agent discovery across the network
- Broadcast-based discovery
- Automatic service registration
### Monitoring (`ogma.monitor`)
- Health monitoring
- Heartbeat system
- Performance metrics
## Installation
```bash
pip install ogma
```
## Usage
### Basic Logging
```python
from kahndor.logma import Logma
log = Logma("myapp")
log.info("Hello world")
# Rich console
log.rich_enable()
log.rich_print("Colored message", style="info")
log.rich_table("Title", ["Col1", "Col2"], [["a", "b"]])
```
### Message Bus
```python
from ogma.comms.channels import Channel
import time
# Create and use channels
pub = Channel.create_publisher("test_channel")
sub = Channel.create_subscriber("test_channel")
# Publisher sends messages
pub.publish("Hello, world!")
# Subscriber receives messages
message = sub.receive(timeout=1.0)
print(f"Received: {message}")
```
### Subagent Management
```python
from ogma.comms.subagent import SubagentBus
# Create subagent bus
bus = SubagentBus()
# Spawn a subagent
subagent_id = bus.spawn_subagent(
task="Analyze this data",
timeout=300
)
# Wait for completion
result = bus.wait_for_completion(subagent_id)
print(f"Result: {result}")
```
### RPC
```python
from ogma.protocols.rpc import RPCClient
client = RPCClient("localhost", port=5556)
result = client.call("method_name", {"param": "value"})
```
### Discovery
```python
from ogma.discovery import DiscoveryService
discovery = DiscoveryService()
agents = discovery.discover_agents()
print(f"Found {len(agents)} agents")
```
## Configuration
Create an `ogma_config.yaml` file in your project root:
```yaml
logging:
level: INFO
channels:
max_message_size: 10485760
message_ttl: 60
subagent:
max_workers: 10
worker_timeout: 300
```
## CLI
```bash
# List channels
ogma channel list
# Start subagent
ogma subagent start "Task description"
# Discover agents
ogma discover
# Monitor channel
ogma monitor --channel my_channel
```
## Architecture
```
┌─────────────────────────────────────┐
│ Application │
└──────────────┬──────────────────────┘
│
┌───────┴───────┐
│ OGMA │
│ (Framework) │
└───────┬───────┘
│
┌───────────┼───────────┐
│ │ │
┌──┴──┐ ┌───┴───┐ ┌───┴───┐
│ RPC │ │ Bus │ │Logger │
└─────┘ └───────┘ └───────┘
```
## Dependencies
### Core
- `zmq` - ZeroMQ for messaging
- `backoff` - Retry logic
- `click` - CLI framework
- `uuid7` - UUID generation
### Optional
- `rich` - Rich console output
- `memory_profiler` - Memory profiling
## Development
### Running Tests
```bash
pytest tests/
```
### Code Quality
```bash
# Linting
pylint ogma/
ruff check ogma/
# Type checking
pyright ogma/
# Formatting
black ogma/
isort ogma/
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run tests and linting
5. Submit a pull request
## License
MIT License - see [LICENSE](LICENSE.md) file for details.
## Support
- GitHub Issues: https://github.com/solutionsbrewer/ogma/issues
- Documentation: [CLI.md](CLI.md)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eaglis-0.0.1.post0-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: eaglis-0.0.1.post0-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 123.2 kB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
660d1a42b0dae4e8fb4fc42e2f7b8b0cfdf2d48debd972e53613bc65df43e758
|
|
| MD5 |
90cf5aae64701f01a2f5c382e6c30772
|
|
| BLAKE2b-256 |
679a33e81a8b14556390c42dba4254b9551dd72db966709c30e7f2ad1e935050
|