semvec/pypi-packages huggingface dataset:
svapihelper-lc 1.0.0
ERLC API Wrapper for Discord Bots
License: MIT
Requires Python: >=3.9

SVAPIHELPER:LC

SVAPIHELPER:LC is the ultimate ERLC API wrapper designed for Discord bot developers.
It provides clean async methods, a full session manager, event dispatcher, typed responses, and easy integration with discord.py.

🚀 Features

• Simple ERLC API integration
• Async ERLC client using aiohttp
• Built-in Session Manager (perfect for patrol/shift systems)
• Event Dispatcher for custom automation
• Type-hinted for great editor support
• Full error handling for all API states
• Works with discord.py, nextcord, pycord, interactions.py
• Lightweight and fast
• Production-ready wrapper for ERLC servers, CAD/MDT systems, and dispatch tools

📦 Installation

pip install svapihelper-lc

🔧 Quick Example

from svapihelper_lc import ERLCClient, ERLCSessionManager
client = ERLCClient(api_key="YOUR_KEY")
sessions = ERLCSessionManager(client)
player = await sessions.get_player("PLAYER_ID")
print(player)

🤖 Discord Bot Example (discord.py)

from discord.ext import commands
from svapihelper_lc import ERLCClient, ERLCSessionManager

bot = commands.Bot(command_prefix="!")
client = ERLCClient(api_key="YOUR_KEY")
sessions = ERLCSessionManager(client)

@bot.command()
async def player(ctx, pid):
info = await sessions.get_player(pid)
await ctx.send("Player: " + info["username"])

📚 What’s Included
ERLCClient

• get_player(id)
• get_calls()
• get_servers()
• clock_in(player_id)
• clock_out(player_id)
• Automatic error handling
• Automatic JSON parsing
• Built using aiohttp

Session Manager

• start_session(name)
• end_session(name)
• active_sessions
• get_player(id)
• Designed for patrol systems and runtime memory

Event Dispatcher

• Register event listeners
• Dispatch async events
• Useful for live monitoring or auto-response bots

🛠️ Contributing

Pull requests welcome!
If you want a feature added, open an issue.

📛 Badges

Version: v1.0.0
Made for: ERLC API
Supports: discord.py, nextcord, pycord

📚 Extra Documentation

Coming soon:
• Full docs site
• Autogenerated API reference
• Example bots
• Tutorials

If you'd like me to generate ALL of this automatically, tell me: “generate docs site” or “generate examples”.

📜 License

MIT License
© 2025 CT Devs
ai-firewall 0.1.0
Python SDK for AI Agent Safety Filter - validate AI agent actions against policies
License: MIT
Requires Python: >=3.10
Keywords: ai, agents, security, firewall, safety, llm, guardrails

# AI Firewall Python SDK

Validate AI agent actions against policies before execution.

## Installation

```bash
pip install ai-firewall
```

Or install from source:

```bash
cd sdk/python
pip install -e .
```

## Quick Start

```python
from ai_firewall import AIFirewall

# Initialize the client
fw = AIFirewall(
    api_key="af_your_api_key",
    project_id="your-project-id",
    base_url="http://localhost:8000"  # Your firewall server URL
)

# Validate an action before executing
result = fw.execute(
    agent_name="invoice_agent",
    action_type="pay_invoice",
    params={
        "vendor": "VendorA",
        "amount": 5000,
        "currency": "USD"
    }
)

if result.allowed:
    # Safe to proceed with the action
    pay_invoice(result.action_id)
else:
    # Action was blocked
    print(f"Blocked: {result.reason}")
    log_blocked_action(result.action_id, result.reason)
```

## Strict Mode

Use strict mode to automatically raise an exception when actions are blocked:

```python
fw = AIFirewall(
    api_key="af_xxx",
    project_id="my-project",
    strict=True  # Raises ActionBlockedError when blocked
)

try:
    result = fw.execute("agent", "risky_action", {"amount": 1000000})
    # This only runs if action is allowed
    do_risky_action()
except ActionBlockedError as e:
    print(f"Action {e.action_id} was blocked: {e.reason}")
```

## Policy Management

```python
# Get current policy
policy = fw.get_policy()
print(f"Policy version: {policy.version}")
print(f"Rules: {policy.rules}")

# Update policy
new_policy = fw.update_policy(
    rules=[
        {
            "action_type": "pay_invoice",
            "constraints": {
                "params.amount": {"max": 10000}
            }
        }
    ],
    version="2.0"
)
```

## Audit Logs

```python
# Get recent logs
logs = fw.get_logs(page=1, page_size=50)
for entry in logs.items:
    status = "✓" if entry.allowed else "✗"
    print(f"{status} {entry.agent_name}: {entry.action_type}")

# Filter blocked actions
blocked = fw.get_logs(allowed=False)

# Get statistics
stats = fw.get_stats()
print(f"Block rate: {stats['block_rate']}%")
```

## Context Manager

```python
with AIFirewall(api_key="...", project_id="...") as fw:
    result = fw.execute("agent", "action", {})
# Connection automatically closed
```

## Exceptions

```python
from ai_firewall import (
    AIFirewallError,       # Base exception
    AuthenticationError,   # Invalid API key
    ProjectNotFoundError,  # Project doesn't exist
    PolicyNotFoundError,   # No active policy
    ActionBlockedError,    # Action blocked (strict mode)
    NetworkError,          # Connection failed
)
```

## License

MIT