Skip to main content

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

Project description

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):

pip install realm-sync-api

Or install from source:

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

Quick Start

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realm_sync_api-0.1.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

realm_sync_api-0.1.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file realm_sync_api-0.1.0.tar.gz.

File metadata

  • Download URL: realm_sync_api-0.1.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for realm_sync_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a698ca2581e95e1d549dfd59c73402d2dc3a497dce1498fa6587696bac825100
MD5 461e8cd513aec36bd83ba6d838f0272c
BLAKE2b-256 8fe26325c26264cde61d7e61031cae79c76dcd20224033645df4f69ca3049a40

See more details on using hashes here.

File details

Details for the file realm_sync_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: realm_sync_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for realm_sync_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dccd14ee4729dfaa94c38de93af724bd34a3e556877a6f194a3e28c5802d4d63
MD5 e601bde4ed07e6c734b9e6da19fffda4
BLAKE2b-256 ce625e3d8b476bd2f64875ea9fa35e7e57777735fccbb6c43b5e22c19aa0e0fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page