Python bindings for teehistorian with event processing
Project description
teehistorian-py
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
- Built on top of the excellent teehistorian Rust crate
- Part of the KoG-teeworlds ecosystem
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee0c36cf325f818c9d33ec420c2a363239f89c9b3ae6486e900f91f80c370f66
|
|
| MD5 |
5f4337ca81aa5f3e836d3dfd907049e2
|
|
| BLAKE2b-256 |
fbea0546d0d8aad21a304945b97ea7f9851e5c89cf0f43beee9235607316ac76
|
Provenance
The following attestation bundles were made for teehistorian_py-2025.1.1.tar.gz:
Publisher:
build.yml on KoG-teeworlds/teehistorian-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teehistorian_py-2025.1.1.tar.gz -
Subject digest:
ee0c36cf325f818c9d33ec420c2a363239f89c9b3ae6486e900f91f80c370f66 - Sigstore transparency entry: 702439330
- Sigstore integration time:
-
Permalink:
KoG-teeworlds/teehistorian-py@37449eb874179e1eee78de182d623e3b3c6ba25f -
Branch / Tag:
refs/tags/2025.1.1 - Owner: https://github.com/KoG-teeworlds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@37449eb874179e1eee78de182d623e3b3c6ba25f -
Trigger Event:
release
-
Statement type:
File details
Details for the file teehistorian_py-2025.1.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: teehistorian_py-2025.1.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 194.8 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e8b9f49f1f1a95d73e85aa1f3ad3cb594e045a312d05514427258402dd1d5ce
|
|
| MD5 |
803074d06506a971d1c9f5e351fb091a
|
|
| BLAKE2b-256 |
acf5702f5d9b726c792d0c0a1048b02914a617f65cdf59898f62493bb5b8cc41
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teehistorian_py-2025.1.1-cp38-abi3-win_amd64.whl -
Subject digest:
1e8b9f49f1f1a95d73e85aa1f3ad3cb594e045a312d05514427258402dd1d5ce - Sigstore transparency entry: 702439333
- Sigstore integration time:
-
Permalink:
KoG-teeworlds/teehistorian-py@37449eb874179e1eee78de182d623e3b3c6ba25f -
Branch / Tag:
refs/tags/2025.1.1 - Owner: https://github.com/KoG-teeworlds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@37449eb874179e1eee78de182d623e3b3c6ba25f -
Trigger Event:
release
-
Statement type:
File details
Details for the file teehistorian_py-2025.1.1-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: teehistorian_py-2025.1.1-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 304.0 kB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
332879e0e22dbd6d585117a1db6a29f5de1da62099c1217d59287fc9f7a3be41
|
|
| MD5 |
104a1ec6494b058c78a840683e61a196
|
|
| BLAKE2b-256 |
7d2ac240bb94622e017cfb1128c01f1bea636cd0ef5dca18b2e59a43bbedf5c8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teehistorian_py-2025.1.1-cp38-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
332879e0e22dbd6d585117a1db6a29f5de1da62099c1217d59287fc9f7a3be41 - Sigstore transparency entry: 702439332
- Sigstore integration time:
-
Permalink:
KoG-teeworlds/teehistorian-py@37449eb874179e1eee78de182d623e3b3c6ba25f -
Branch / Tag:
refs/tags/2025.1.1 - Owner: https://github.com/KoG-teeworlds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@37449eb874179e1eee78de182d623e3b3c6ba25f -
Trigger Event:
release
-
Statement type:
File details
Details for the file teehistorian_py-2025.1.1-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: teehistorian_py-2025.1.1-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 264.8 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9d45dfbce9f6ba32b43a8110a879b42e5ac994e19dd6f8fa4de4f0cb561a28a
|
|
| MD5 |
2c33e7d39423adc7f15071c7c50491bb
|
|
| BLAKE2b-256 |
ee43599bb0308246d61ba05050d5351d7120d94584970b33f2f08e2e66b31049
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
teehistorian_py-2025.1.1-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
c9d45dfbce9f6ba32b43a8110a879b42e5ac994e19dd6f8fa4de4f0cb561a28a - Sigstore transparency entry: 702439331
- Sigstore integration time:
-
Permalink:
KoG-teeworlds/teehistorian-py@37449eb874179e1eee78de182d623e3b3c6ba25f -
Branch / Tag:
refs/tags/2025.1.1 - Owner: https://github.com/KoG-teeworlds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@37449eb874179e1eee78de182d623e3b3c6ba25f -
Trigger Event:
release
-
Statement type: