Metadata-Version: 2.4
Name: realm-sync-api
Version: 0.1.0
Summary: A FastAPI-based API framework for managing game data with Redis and PostgreSQL support
Author: RealmSync Team
License: MIT
Project-URL: Homepage, https://github.com/ghalrym/RealmSync
Project-URL: Documentation, https://github.com/ghalrym/RealmSync#readme
Project-URL: Repository, https://github.com/ghalrym/RealmSync
Project-URL: Issues, https://github.com/ghalrym/RealmSync/issues
Keywords: fastapi,api,game,redis,postgresql
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: FastAPI
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: redis>=5.0.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: fastapi-swagger-dark>=0.0.8
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.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"

# RealmSync API

A FastAPI-based API framework for managing game data with Redis and PostgreSQL support.

## Features

- 🚀 FastAPI-based REST API framework
- 🔄 Redis integration for caching and data storage
- 🗄️ PostgreSQL support for persistent data
- 🎨 Built-in web management interface
- 📝 Automatic API documentation with Swagger UI (dark mode)
- 🔌 Hook system for event-driven architecture
- 📦 Easy to install and use

## Installation

Install from PyPI (when published):

```bash
pip install realm-sync-api
```

Or install from source:

```bash
git clone https://github.com/ghalrym/RealmSync.git
cd RealmSync
pip install -e .
```

## Quick Start

```python
from realm_sync_api import RealmSyncApi
from realm_sync_api.models import Player
from realm_sync_api.hooks import RealmSyncHook
from realm_sync_api.setup.redis import RealmSyncRedis

# Create the API instance
app = RealmSyncApi(web_manager_perfix="/admin")

# Set up Redis client
app.set_redis_client(RealmSyncRedis(host="localhost", port=6379, db=0))

# Register hooks
@app.hook(RealmSyncHook.PLAYER_CREATED)
def player_created(player: Player):
    print(f"Player created: {player.name}")

# Run with uvicorn
# uvicorn main:app --reload
```

## Requirements

- Python 3.11+
- FastAPI
- Redis (optional, for caching)
- PostgreSQL (optional, for persistent storage)

## Documentation

API documentation is automatically available at `/docs` when running the application.

## License

MIT License

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

