Metadata-Version: 2.4
Name: apicord
Version: 0.1.0
Summary: Discord API Emulator for bot testing
Author-email: Eaven Kimura <kimura.eaven@gmail.com>
License: GPL-3.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: websockets>=12.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.1.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: pydantic-settings>=2.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Provides-Extra: tui
Requires-Dist: textual>=0.52.0; extra == "tui"
Requires-Dist: textual-dev>=0.52.0; extra == "tui"
Dynamic: license-file

# APIcord

Discord API Emulator for bot testing.

A standalone Python CLI program that emulates the Discord API (REST + WebSocket Gateway), enabling self-contained testing of Discord bots without requiring a real Discord connection.

## Features

- **REST API Server** - Implements Discord REST API endpoints needed for bot operations
- **WebSocket Gateway** - Emulates Discord's Gateway for real-time events (READY, INTERACTION_CREATE, etc.)
- **State Management** - In-memory state with guilds, channels, users, messages, and interactions
- **Test Scenarios** - YAML-based test scenarios for automated bot testing
- **CLI Interface** - Easy-to-use commands for starting, testing, and managing the emulator

## Installation

```bash
pip install -e .
# Or for development
pip install -e ".[dev]"
```

## Quick Start

```bash
# Start emulator with a test scenario
apicord start --scenario scenarios/basic_test.yaml

# Run automated test against a bot
apicord test --scenario scenarios/full_test.yaml --bot-path /path/to/bot

# Start with custom configuration
apicord start --port 8080 --guilds 2 --channels 5
```

## Project Structure

```
apicord/
├── src/apicord/
│   ├── main.py              # CLI entry point
│   ├── config.py            # Configuration management
│   ├── rest/                # REST API server (aiohttp)
│   ├── gateways/            # WebSocket gateway (websockets)
│   ├── state/               # State management
│   ├── models/              # Pydantic models for Discord objects
│   └── cli/                 # CLI commands
├── tests/                   # Unit tests
├── scenarios/               # YAML test scenarios
└── pyproject.toml
```

## License

GPL-3.0 - See LICENSE file for details.
