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.1.tar.gz (117.1 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.1-cp38-abi3-win_amd64.whl (194.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

teehistorian_py-2025.1.1-cp38-abi3-manylinux_2_34_x86_64.whl (304.0 kB view details)

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

teehistorian_py-2025.1.1-cp38-abi3-macosx_11_0_arm64.whl (264.8 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: teehistorian_py-2025.1.1.tar.gz
  • Upload date:
  • Size: 117.1 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.1.tar.gz
Algorithm Hash digest
SHA256 ee0c36cf325f818c9d33ec420c2a363239f89c9b3ae6486e900f91f80c370f66
MD5 5f4337ca81aa5f3e836d3dfd907049e2
BLAKE2b-256 fbea0546d0d8aad21a304945b97ea7f9851e5c89cf0f43beee9235607316ac76

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.1.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.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1e8b9f49f1f1a95d73e85aa1f3ad3cb594e045a312d05514427258402dd1d5ce
MD5 803074d06506a971d1c9f5e351fb091a
BLAKE2b-256 acf5702f5d9b726c792d0c0a1048b02914a617f65cdf59898f62493bb5b8cc41

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.1-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.1-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.1-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 332879e0e22dbd6d585117a1db6a29f5de1da62099c1217d59287fc9f7a3be41
MD5 104a1ec6494b058c78a840683e61a196
BLAKE2b-256 7d2ac240bb94622e017cfb1128c01f1bea636cd0ef5dca18b2e59a43bbedf5c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.1-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.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9d45dfbce9f6ba32b43a8110a879b42e5ac994e19dd6f8fa4de4f0cb561a28a
MD5 2c33e7d39423adc7f15071c7c50491bb
BLAKE2b-256 ee43599bb0308246d61ba05050d5351d7120d94584970b33f2f08e2e66b31049

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.1.1-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