Skip to main content

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

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

eaglis-0.0.1-cp312-cp312-manylinux_2_39_x86_64.whl (123.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

File details

Details for the file eaglis-0.0.1-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for eaglis-0.0.1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 441135e1621aa8be5f98972ee71f01f30af056cf4bc31aa3ba2f1935223423fe
MD5 037b3409e99993f51a4506f67726a290
BLAKE2b-256 bf55ff7b7a8b24ff68f8325b7c8516ea59f9620e8940cb657c7d432c9306c2fa

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.1.post0

1 file

This release

0.0.1 This release

1 file

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page