Skip to main content

Modern Networking for Python Games

Build multiplayer games with ease using asyncio and msgpack. Drop pump() into your game loop and let repod handle the rest.

Quick Start

Get a multiplayer game running in minutes

1

Install repod

Install via pip or uv:
pip install repodnet
2

Create a server

Subclass Server and Channel to handle client connections:
from repod import Server, Channel

class ClientChannel(Channel):
    def Network_hello(self, data: dict) -> None:
        print(f"Client says: {data['message']}")
        self.send({"action": "response", "text": "Hello from server!"})

class GameServer(Server):
    channel_class = ClientChannel

GameServer(host="0.0.0.0", port=5071).launch()
3

Create a client

Subclass ConnectionListener and call pump() in your game loop:
import time
from repod import ConnectionListener

class GameClient(ConnectionListener):
    def Network_connected(self, data: dict) -> None:
        self.send({"action": "hello", "message": "Hello server!"})

    def Network_response(self, data: dict) -> None:
        print(f"Server says: {data['text']}")

client = GameClient()
client.connect("localhost", 5071)

while True:
    client.pump()
    time.sleep(0.01)

Key Features

Everything you need for real-time multiplayer networking

Asyncio-based

Built on Python’s asyncio with msgpack serialization for efficient binary messaging

Action-based dispatch

Simple Network_* callback methods automatically route messages based on action keys

Background threads

Run networking in a background thread so your game loop stays synchronous

Type-safe

Full type annotations with Python 3.12+ generics for excellent IDE support

Drop-in replacement

Modern replacement for PodSixNet with the same simple API philosophy

Game framework ready

Works with pygame, raylib, arcade, pyglet, and any framework with a main loop

Explore Examples

Learn from real-world multiplayer game examples

Chat Server

Build a simple text chat application with multiple clients

Collaborative Whiteboard

Shared drawing canvas with pygame-ce

Tag Game

Real-time multiplayer tag game built with raylib

Latency Measurement

Measure round-trip latency and network performance

Ready to build multiplayer games?

Start with our quickstart guide and have a working client-server game in minutes.

Get Started Now

Build docs developers (and LLMs) love