circleparse, a .osr and lzma parser
This fork is designed specifically for Circlecore, and extends the functionality of the upstream repo by allowing parsing of a pure lzma bytestring, instead of the bytestring contents of an entire .osr file. Usage:
from circleparse import parse_replay
# returns instance of Replay from an lzma bytestring with only the play_data field nonnull.
parse_replay(lzma_byte_string, pure_lzma=True)
Note that only information stored in the lzma bytestring is stored in the Replay instance. When pure_lzma is true, replay_data is the only populated field because lzma only contains cursor positioning and key presses. For more information, see the wiki.
Installation
To install, simply
pip install circleparse
Documentation
To parse a replay from a filepath:
from circleparse import parse_replay_file
#returns instance of Replay
parse_replay_file("path/to/osr.osr")
To parse a replay from a bytestring:
from circleparse import parse_replay
#returns instance of Replay given the replay data encoded as a bytestring
parse_replay(byte_string)
Replay instances provide these fields
self.game_mode #GameMode enum
self.game_version #Integer
self.beatmap_hash #String
self.player_name #String
self.replay_hash #String
self.number_300s #Integer
self.number_100s #Integer
self.number_50s #Integer
self.gekis #Integer
self.katus #Integer
self.misses #Integer
self.score #Integer
self.max_combo #Integer
self.is_perfect_combo #Boolean
self.mod_combination #frozenset of Mods
self.life_bar_graph #String, unparsed as of now
self.timestamp #Python Datetime object
self.play_data #List of ReplayEvent instances
ReplayEvent instances provide these fields
self.time_since_previous_action #Integer representing time in milliseconds
self.x #x axis location
self.y #y axis location
self.keys_pressed #bitwise sum of keys pressed, documented in OSR format page
Metadata
Release files for circleparse 6.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| circleparse-6.4.1.tar.gz | 4.8 kB | Without provenance | Details for circleparse-6.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| circleparse-6.4.1-py3-none-any.whl | Python 3 | none | any | Details for circleparse-6.4.1-py3-none-any.whl |
Total release size: 33.5 kB
Release files / circleparse-6.4.1.tar.gz
| Download URL | circleparse-6.4.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3448638771dcab2317e976388d9c31252bab6e497874f67746676f6ae47e05a2
|
|
BLAKE2b-256 checksum How to use checksums |
cb5e18a1d9f30b22207f85e8fc3382fb2ea4ed87903aa6fa3fb9226d9f22549d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
|
Release files / circleparse-6.4.1-py3-none-any.whl
| Download URL | circleparse-6.4.1-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cbb2fc47cd63fffdbccbb7d6307d1a46fcb723ca7b29105ac18eeabdae8bc0b
|
|
BLAKE2b-256 checksum How to use checksums |
6c4ec7ef6555960bb77697179941f9aaf1ca8b79d597d5af7e1febf68f284d96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
|
Security for circleparse 6.4.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.