Skip to main content

PureSkill.gg CS:GO Data Science Development Kit

PyPI GitHub Actions

Counter-Strike helpers for CSDS match data (a manifest plus one pandas DataFrame per channel). scrub_csds_pii anonymizes a match before it leaves the platform, pop_overtime removes overtime rounds from a channel, and add_player_vector_derived_columns computes player_vector’s velocities and movement angles. It works on data you have already loaded, usually with pureskillgg-dsdk.

Installation

Requires Python 3.11 or later.

$ uv add pureskillgg-csgo-dsdk

It does not install pureskillgg-dsdk. The example below loads the match with it, so add it too:

$ uv add pureskillgg-dsdk

Usage

Scrub a match, then pop overtime:

from pureskillgg_dsdk import DsReaderS3, GameDsLoader
from pureskillgg_csgo_dsdk import (
    csds_pii_channel_instructions,
    pop_overtime,
    scrub_csds_pii,
)

loader = GameDsLoader(
    reader=DsReaderS3(bucket="my-csds-bucket", manifest_key="path/to/match/csds")
)

# Load only the PII channels this CSDS has, then scrub them.
data = loader.get_channels(csds_pii_channel_instructions(loader.manifest))
manifest = scrub_csds_pii(loader.manifest, data)  # data is scrubbed in place

# CS2 regulation is 24 rounds (MR12). The default, 30, is CS:GO MR15.
deaths = loader.get_channel({"channel": "player_death"})
overtime = pop_overtime(deaths, max_rounds_csgo=24)  # deaths keeps rounds 1-24

scrub_csds_pii returns the new manifest. It replaces the job id with the anonymous id, redacts names, clan tags, chat, share codes and demo ids, maps each Steam id to a letter, zeroes pings, caps inflated win and commend counts, and marks every changed column in the manifest. docs/scrub-csds-pii.md lists every field.

pop_overtime returns the removed rows with their original index labels. Rows with a missing round stay. A channel without a round column raises MissingColumns.

Derived player_vector columns

Ten player_vector columns are computed from the columns read from the demo: second, x_vel, y_vel, z_vel, speed_2d, movement_angle, movement_angle_diff, phi_vel, theta_vel and ang_vel. Compute them after loading:

from pureskillgg_csgo_dsdk import (
    add_player_vector_derived_columns,
    player_vector_source_columns,
)

# Everything, on a whole player_vector.
player_vector = loader.get_channel({"channel": "player_vector"})
add_player_vector_derived_columns(player_vector)  # added in place

# Or load only what two of them need.
wanted = ["speed_2d", "z_vel"]
player_vector = loader.get_channel(
    {"channel": "player_vector", "columns": player_vector_source_columns(wanted)}
)
add_player_vector_derived_columns(player_vector, columns=wanted)

The values are the ones csgo-ppp writes:

  • Velocities are differenced per player per round, so each player’s first sample in a round reads 0. A sample where any axis moved faster than 3,500 units a second (the engine’s cap) is a teleport and reads 0 too.

  • movement_angle is the direction of movement, 0 to 360. movement_angle_diff is where the player looks minus where they move, -180 to 180. Both are missing when the player stands still.

  • second is tick over the tick rate: 64 in CS2. Pass tick_rate for a CS:GO match; it is in the match’s header.

A derived column the frame already has is replaced, never read, so a file that stores them comes out the same as one that doesn’t. Rows must be in tick order within each player and round, as csgo-ppp writes them. For a frame holding more than one match, such as a tome, pass group_by=["match_key", "player_id", "round"]. A frame that lacks a column they are computed from raises MissingColumns.

Exports

Export

Used by

scrub_csds_pii, SCRUB_CSDS_PII_CHANNEL_INSTRUCTIONS

csgo-ppp’s scrubber

csds_pii_channel_instructions

no consumer yet; prefer it to the constant, which names channels an older CSDS may not have

pop_overtime

csgo-coach’s economy course

add_player_vector_derived_columns, player_vector_source_columns, PLAYER_VECTOR_DERIVED_COLUMNS

readers of player_vector that need its velocities, movement angles or second

pureskillgg_csgo_dsdk.player_vector’s calc_* functions

csgo-ppp’s converter, which computes the same columns step by step

MissingColumns, UnsupportedChannelStructure

raised when a DataFrame lacks a required column

Development

You need Python 3, uv and Git LFS (the test fixtures are in LFS).

$ git clone https://github.com/pureskillgg/csgo-dsdk.git
$ cd csgo-dsdk
$ git lfs install
$ git lfs pull
$ uv sync

The tasks are in the Makefile: make lint, make test, make watch (tests on every change) and make format.

Publishing

Set the new version with uv version <version> (or uv version --bump patch), then run make version. It commits pyproject.toml and uv.lock and pushes a signed v* tag, which triggers the publish workflow. Or run the version workflow by hand with a version number or a bump (patch, minor, major); it does both steps.

Publishing needs the PYPI_API_TOKEN repository secret. The version and format workflows also need GH_USER, GH_TOKEN, GIT_USER_NAME, GIT_USER_EMAIL, GPG_PRIVATE_KEY and GPG_PASSPHRASE.

License

MIT. See LICENSE.txt.

Metadata

Release files for pureskillgg-csgo-dsdk 3.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pureskillgg-csgo-dsdk 3.5.1
File Size Uploaded Provenance Actions
pureskillgg_csgo_dsdk-3.5.1.tar.gz 16.5 kB Without provenance Details for pureskillgg_csgo_dsdk-3.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pureskillgg-csgo-dsdk 3.5.1
File Interpreter ABI Platform Actions
pureskillgg_csgo_dsdk-3.5.1-py3-none-any.whl Python 3 none any Details for pureskillgg_csgo_dsdk-3.5.1-py3-none-any.whl

Total release size: 37.7 kB

Release files / pureskillgg_csgo_dsdk-3.5.1.tar.gz

Download URL pureskillgg_csgo_dsdk-3.5.1.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a9cbeab9302c867e061915a900b8a77236b6d7dc9dabb675372a6519f2f22438
BLAKE2b-256 checksum
How to use checksums
31c261ec17e734c38d160813b9c2c426aa7bc876d6387e9e8f9968f16e7610db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pureskillgg_csgo_dsdk-3.5.1-py3-none-any.whl

Download URL pureskillgg_csgo_dsdk-3.5.1-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b753160f108866911a4ab085cedc2f0f104bfd78b678cf656cfd07a62b71fa61
BLAKE2b-256 checksum
How to use checksums
bd46f9fbd1351c5e7dd596afd03936d4ab55d7b512c9f0ab06f79f20ebb8114e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pureskillgg-csgo-dsdk 3.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page