Skip to main content

What is repod?

repod is a networking library designed to make it easy to write multiplayer games in Python. It uses asyncio and msgpack to asynchronously serialize network events and arbitrary data structures, and delivers them to your high-level classes through simple callback methods.
repod is a modernized fork of PodSixNet. Same ideas — channels, action-based message dispatch, synchronous pump loops — but rebuilt from scratch for Python 3.12+ with async I/O, binary msgpack serialization, and full type annotations.

Why use repod?

Repod simplifies multiplayer game networking by abstracting away the complexity of socket programming:

Simple API

No manual buffer handling or socket polling. Just call client.pump() once per game loop and implement Network_* callbacks.

Framework Agnostic

Works with any game framework that has a main loop: pygame, raylib, arcade, pyglet, and more.

Modern Python

Built for Python 3.12+ with full type annotations, asyncio, and modern tooling support.

Battle-Tested Pattern

Based on PodSixNet’s proven architecture, used in countless multiplayer games.

Key features

  • Asyncio-based networking with msgpack serialization — Fast, efficient binary protocol with length-prefix framing
  • Simple action-based message dispatch with Network_ callbacks* — No complex event systems, just define methods
  • Background thread support for synchronous game loops — Keep your main game loop simple and synchronous
  • Type-safe with full Python 3.12+ annotations — Get autocomplete and type checking in your IDE
  • Drop-in replacement for PodSixNet — Migrate existing projects with minimal changes

How it works

Each class within your game client which wants to receive network events subclasses ConnectionListener and implements Network_* methods to catch specific events from the server. You don’t have to wait for buffers to fill, or check sockets for waiting data or anything like that — just call client.pump() once per game loop and the library handles everything else, passing off events to your listener.
class MyClient(ConnectionListener):
    
    def Network_connected(self, data: dict) -> None:
        print("connected to the server")
    
    def Network_myaction(self, data: dict) -> None:
        print("myaction:", data)

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

while True:
    client.pump()
    time.sleep(0.01)
Sending data back to the server is just as easy with client.send(mydata). On the server side, events are propagated to Network_* callbacks on your Channel subclass, and data is sent back to clients with channel.send(mydata).

Comparison with PodSixNet

PodSixNet was great for its time, but it has some significant limitations:
PodSixNet is built on asyncore, which was removed in Python 3.12. This makes it incompatible with modern Python versions.
PodSixNet uses rencode / custom delimiter-based framing (\0---\0), which is fragile with binary data and can break with certain payload patterns.
PodSixNet has no type annotations, which means no autocomplete, no type checking, and no modern IDE support.
PodSixNet is no longer actively maintained (chr15m/PodSixNet#46), leaving users without bug fixes or improvements.
repod keeps the same simple API philosophy but replaces the internals:
FeaturePodSixNetrepod
Python version2.x - 3.113.12+
I/O layerasyncore (deprecated)asyncio
Serializationrencode + delimiter framingmsgpack + length-prefix
Type annotationsNoneFull PEP 695 generics
MaintenanceInactiveActive

When to use repod

Perfect for:
  • Turn-based multiplayer games
  • Real-time action games with moderate player counts
  • Co-op games and shared experiences
  • Game lobbies and matchmaking systems
  • Python-based game clients connecting to Python servers
Not ideal for:
  • Massive multiplayer online games (MMOs) with thousands of concurrent players
  • Ultra-low latency competitive games (consider UDP-based solutions)
  • Cross-language client/server setups (repod is Python-only)
  • Games requiring advanced networking features like NAT punchthrough

Next steps

Installation

Install repod with pip or uv and verify your setup

Quick Start

Build your first client-server game in minutes

Build docs developers (and LLMs) love