Skip to main content

Python bindings for teehistorian with event processing

Project description

teehistorian-py

License: AGPL v3 PyPI version Python 3.8+ Documentation codecov

CI

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

📚 Documentation | 🐛 Issue Tracker | 📦 PyPI

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 (modern Pythonic way)
with th.open("server.teehistorian") as parser:
    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}'")

Or with Python 3.10+ match statement:

import teehistorian_py as th

with th.open("server.teehistorian") as parser:
    for chunk in parser:
        match chunk:
            case th.Join(client_id=cid):
                print(f"Player {cid} joined")
            case th.Drop(client_id=cid, reason=reason):
                print(f"Player {cid} left: {reason}")
            case th.PlayerName(client_id=cid, name=name):
                print(f"Player {cid} is now called '{name}'")

See the full documentation for more examples and advanced usage.

Development

Building from Source

# Clone the repository
git clone https://github.com/KoG-teeworlds/teehistorian-py.git
cd teehistorian-py

# Install development dependencies
pip install -e ".[dev]"

# Build extension module
maturin develop --release

# Run tests with coverage
pytest tests/ --cov=src/python/teehistorian_py --cov-report=html --cov-report=term-missing

# View coverage report
open htmlcov/index.html  # On macOS
# or visit htmlcov/index.html in your browser

Code Coverage & Security

We maintain 80%+ code coverage with branch coverage enabled and modern security practices:

  • Coverage: Branch coverage enabled with automatic PR reports via Codecov
  • Security: OIDC trusted publishing (no API keys required)
  • Modern CI/CD: GitHub Actions with hardened runners and security scanning
  • Automated: Rust security audits, Python vulnerability scans, and dependency checks

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.2.2.tar.gz (165.5 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.2.2-cp314-cp314-win_amd64.whl (271.4 kB view details)

Uploaded CPython 3.14Windows x86-64

teehistorian_py-2025.2.2-cp314-cp314-macosx_11_0_arm64.whl (330.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

teehistorian_py-2025.2.2-cp313-cp313-win_amd64.whl (270.3 kB view details)

Uploaded CPython 3.13Windows x86-64

teehistorian_py-2025.2.2-cp313-cp313-macosx_11_0_arm64.whl (328.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

teehistorian_py-2025.2.2-cp312-cp312-win_amd64.whl (270.2 kB view details)

Uploaded CPython 3.12Windows x86-64

teehistorian_py-2025.2.2-cp312-cp312-manylinux_2_34_x86_64.whl (378.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

teehistorian_py-2025.2.2-cp312-cp312-macosx_11_0_arm64.whl (328.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

teehistorian_py-2025.2.2-cp311-cp311-win_amd64.whl (268.9 kB view details)

Uploaded CPython 3.11Windows x86-64

teehistorian_py-2025.2.2-cp311-cp311-manylinux_2_34_x86_64.whl (377.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

teehistorian_py-2025.2.2-cp311-cp311-macosx_11_0_arm64.whl (329.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

teehistorian_py-2025.2.2-cp310-cp310-win_amd64.whl (268.8 kB view details)

Uploaded CPython 3.10Windows x86-64

teehistorian_py-2025.2.2-cp39-cp39-win_amd64.whl (269.7 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

  • Download URL: teehistorian_py-2025.2.2.tar.gz
  • Upload date:
  • Size: 165.5 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.2.2.tar.gz
Algorithm Hash digest
SHA256 b727841b3adef3fa9cb1ae7a656930ee0fcfb92f3279ef70d3deeeaa2b547c51
MD5 74179c4391fda5068e02e0ec4a96e20d
BLAKE2b-256 241a85dd26512dc08f7b78a5b46d34e01304a2790fec645c416ffb9a32a975f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.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.2.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7521cc63e8e395b6c4b4fad3a028933369fae0ccc626c4dd32a360472ebf781b
MD5 34fc92d4bca664dfef26ba9d1cb9b393
BLAKE2b-256 3172d0ab8a848aa1edce0410ab53f86f1e115aa674d7c3cb402adea46a1d3685

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp314-cp314-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.2.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8441561b8acacd00251c8feaa2380b5069fb5df8d7fad515acefa8fe416d756
MD5 a699144e0d6721fa70129b410cad0a8a
BLAKE2b-256 df69de976325313e8a55a58312c4f140ce5f45e3e6c54fe861aa934a72a48265

See more details on using hashes here.

Provenance

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

File details

Details for the file teehistorian_py-2025.2.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e1e934517a70003a2f32f60cd96b08f46a3bad4b1ebe8df2e4523c9babddac5f
MD5 8e579136228220e377b026e89fccdcd2
BLAKE2b-256 3ebe14cf429c01c6e8834568b45df9efa0e8afcece42fcdc37204c425f7df6e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp313-cp313-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.2.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39e408f44ff682a0050e27b2d96c46aae0e8d5f3800a98465ac6c90117f68cd9
MD5 291de06f342613d4e7a8a2390d6121ba
BLAKE2b-256 2bdb64973eb1855533af7739f34671b7b0d4f61ad68be05b5782240943504cda

See more details on using hashes here.

Provenance

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

File details

Details for the file teehistorian_py-2025.2.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8047b94018a3ab4fa00a7ba072fb4aafd9e0724cbe436a94ab242da6c38fd732
MD5 37e91bc97de4603b2f9a16213255de96
BLAKE2b-256 d66cc0523a89c7103499b877c695a55712c6afb4429228523f883870f87a0bcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp312-cp312-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.2.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dbdb8c6a98b7b59a24bebb1e737c79164ea05d43b07ab225148a19d281458627
MD5 dd3030cf8355e26eff6e4e849f2d6953
BLAKE2b-256 1782e2391c9b920844d2d68eac1a2f8924e70d5bc4630cfbd3a0366bec7f5d6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp312-cp312-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.2.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00bc875f187e332a05085d9954a9cb7104e85c23c600c29d8b4662272e126c21
MD5 b509e0d8ab94e3cdb35aef808a62d8ed
BLAKE2b-256 69b0ebe148adcb12de06064c8c9e197593341b7d74344f4ccd0a2ba7673bf8dd

See more details on using hashes here.

Provenance

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

File details

Details for the file teehistorian_py-2025.2.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 868fa3beec221c7d914dd9694627ac5d52774c235d406ed98bc57afcbb0d0c45
MD5 e2d02c59869b9f0fc65d7f7668d2f63f
BLAKE2b-256 8667604d60eab9a546e5224d5a874fe495dc3236e442bd65a030e20757cb4c63

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp311-cp311-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.2.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5a265cc9296c96d2cf0399133ce04c76cf11c87f0d15d4c0339721a1543a4981
MD5 31f8f3ee8273bfb4551fdda9e7c60553
BLAKE2b-256 9052472c5dec3103048018d8b18978fa32dc38a731371faa32424826f2329cc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp311-cp311-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.2.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6883bde462eb1f7c81f87e6c37acac54b41eeb36e3e561872984820c13bcb7d0
MD5 68a798eb0891facfbe392dbc8b90f3bd
BLAKE2b-256 1b3f6e5dce6fda454da86ffbafac01cc991860d55173772d15afcb4e7d90eb2a

See more details on using hashes here.

Provenance

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

File details

Details for the file teehistorian_py-2025.2.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5fb8dce48a3dad432f6e4de435b8afb27a5f6a4b2a80ff7ec44c5c8ec9d9dd8e
MD5 557923fd046bcecfc71554b743fcfbc2
BLAKE2b-256 76e119d2bdb7ac4c3c486834095b2319a8432bac85d703dae67672def5d19c4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for teehistorian_py-2025.2.2-cp310-cp310-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.2.2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for teehistorian_py-2025.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b271d9c65e2887695fe955b36b72e70398bfb92c6a912834eb0d1fe26dc06973
MD5 acfda8121bf69ba2240a329e9764a3e9
BLAKE2b-256 b92d6eb49dd3ad86fbbaa7ba1840b63bd1da64e9875fb142fc45a17e7478ba51

See more details on using hashes here.

Provenance

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

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