Skip to main content

Python bindings for teehistorian with event processing

Project description

teehistorian-py

License: AGPL v3 PyPI version Python 3.8+

High-performance Python bindings for parsing Teeworlds/DDNet teehistorian files. Built with Rust for speed and memory safety.

Features

  • 🚀 Fast: Rust-powered parsing with minimal Python overhead
  • 🔒 Memory Safe: No buffer overflows or memory leaks
  • 📦 Simple API: Clean Python interface for easy integration
  • 🧩 Extensible: Support for custom UUID handlers for mods
  • 🎯 Complete: Covers all standard teehistorian chunk types

Installation

pip install teehistorian-py

Quick Start

import teehistorian_py as th

# Parse a teehistorian file
with open("server.teehistorian", "rb") as f:
    data = f.read()

parser = th.Teehistorian(data)

# Iterate through all chunks
for chunk in parser:
    if isinstance(chunk, th.Join):
        print(f"Player {chunk.client_id} joined")
    elif isinstance(chunk, th.Drop):
        print(f"Player {chunk.client_id} left: {chunk.reason}")
    elif isinstance(chunk, th.PlayerName):
        print(f"Player {chunk.client_id} is now called '{chunk.name}'")

Development

Building from Source

# Install development dependencies
pip install maturin

# Build extension module
maturin develop --release

# Run tests
pytest tests/

Requirements

  • Python 3.8+
  • Rust 1.70+ (for building from source)

License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

Credits

Related Projects

  • teehistorian - Original Rust implementation
  • Teeworlds - The game that generates these files
  • DDNet - Popular Teeworlds modification

Need help? Open an issue or check our documentation.

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

teehistorian_py-2025.1.2.tar.gz (118.4 kB view details)

Uploaded Source

Built Distributions

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

teehistorian_py-2025.1.2-cp38-abi3-win_amd64.whl (195.7 kB view details)

Uploaded CPython 3.8+Windows x86-64

teehistorian_py-2025.1.2-cp38-abi3-manylinux_2_34_x86_64.whl (305.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

teehistorian_py-2025.1.2-cp38-abi3-macosx_11_0_arm64.whl (266.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file teehistorian_py-2025.1.2.tar.gz.

File metadata

  • Download URL: teehistorian_py-2025.1.2.tar.gz
  • Upload date:
  • Size: 118.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for teehistorian_py-2025.1.2.tar.gz
Algorithm Hash digest
SHA256 32506721435637c52c2986fe804a9cc555c85c84b63af38ccb35fe3f6d864249
MD5 fb6c1ab6f7d12d4bdc3cac61b14ff93a
BLAKE2b-256 747afa35758e23eade9ae7c467d1f6ac94cee240941a39ef8534a0b234c497c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.2.tar.gz:

Publisher: build.yml on KoG-teeworlds/teehistorian-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teehistorian_py-2025.1.2-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 313a9979e56de697656ca0fa65adf4424c7b75be6aa2d30d8b1bf502d9ca16ef
MD5 4d7723f852b06a43cfff8ec802791e7f
BLAKE2b-256 7283dba6b2502ce5a12668c395d3617999e19ce7daee1728f8c093d82079885f

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.2-cp38-abi3-win_amd64.whl:

Publisher: build.yml on KoG-teeworlds/teehistorian-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teehistorian_py-2025.1.2-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.2-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1fe3d1f3968e0a0452522c3c2d0cafa93641b794a9d4004da941a22d071e56c9
MD5 72ec7c4f417b233a6d0e4e641f545118
BLAKE2b-256 e83cbcbcbab2f3a1322b6711c9f2aec5d26ae5a72286d2411f0a434d50bb9241

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.2-cp38-abi3-manylinux_2_34_x86_64.whl:

Publisher: build.yml on KoG-teeworlds/teehistorian-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teehistorian_py-2025.1.2-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1596a4778d9c1319b692b20f3bfea8268c17d72585db99069227bf3495f3dc6a
MD5 c95cd4d433c4b49451fb9c9b12cfe6c7
BLAKE2b-256 e9dd045369a3bd30e3ac1bf44fa480d72fd61e56ffc9beed1924ce87fa85aa2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.2-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: build.yml on KoG-teeworlds/teehistorian-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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