A full-functionality wrapper for the https://ballchasing.com API
Project description
A full-functionality wrapper for the https://ballchasing.com API.
Install
pip install pychasing
pychasing.Client
The main object used to interact with the API.
import pychasing
pychasing_client = pychasing.Client(
token = "your_token",
auto_rate_limit = True,
patreon_tier = pychasing.types.PatreonTier.Regular # regular = no patreon tier
)
The pychasing.Client
object has the below methods:
ping
- pings the ballchasing servers.upload_replay
- uploads a replay to the token-holder's account.- NOTE: this takes a
BinaryIO
object. For example:
with open("my_replay.replay", "rb") as replay_file: ...upload_replay(replay_file, ...)
- NOTE: this takes a
list_replays
- list replays (basic information only) filtered on various criteria.get_replay
- get the in-depth information of a specific replay.delete_replay
- delete a specific replay, so long as it is owned by the token-holder.- NOTE: this operation is permenant and cannot be undone.
patch_replay
- edit thetitle
,visibility
or parentgroup
of a specific replay.download_replay
- download the raw bytes of a specific replay, so long as it is not private (unless it is owned by the token-holder).- NOTE: since replays are relatively large, they should be downloaded in chunks. For example:
with ...download_replay(...) as data_stream: with open("my_replay.replay", "wb") as replay_file: for chunk in data_stream.iter_content(chunk_size=4096): replay_file.write(chunk)
create_group
- create a replay group.list_groups
- list groups (basic information only) filtered on various criteria.get_group
- get in-depth information of a specific replay group.delete_group
- delete a specific group, so long as it is owned by the token-holder.- NOTE: this operation is permenant and cannot be undone.
patch_group
- edit theplayer-identification
,team-identification
,parent
, orshared
status of a specific replay group, so long as it owned by the token-holder.maps
- list all the maps in the game.get_threejs
- get basic locational data (among other data) of a specific replay. This does not require- NOTE: this functionality is highly experimental. It accesses a back-end API used for populating site data (that notably does not require authorization headers). At any time, this API could become restricted or its functionality could change.
get_timeline
- get basic timeline data of a specific replay.- NOTE: this functionality is highly experimental. It accesses a back-end API used for populating site data (that notably does not require authorization headers). At any time, this API could become restricted or its functionality could change.
export_csv
- get group statistics formatted as semi-colon-separated values.
Helper types
pychasing.types.Rank
- represents an in-game rank (Unranked
toSSL
).pychasing.types.Playlist
- represents an in-game playlist, e.g.Hoops
,Rumble
,Ranked Duels
.pychasing.types.Platform
- represents the current playable platforms (Steam
,Epic
,XBox
,PlayStation
,Switch
).pychasing.types.Map
- represents an in-game map, e.g.Starbase Arc
,arc_p
.pychasing.types.PatreonTier
- represents a patreon tier forballchasing
's patreon. Tiers includeGrandChampion
,Champion
,Diamond
,Gold
, and ``Regular` (no patreon tier).pychasing.types.Visibility
- represents the visibility of a replay or group, i.e.public
,unlisted
, andprivate
.pychasing.types.PlayerIdentification
- represents a type of player identification for groups, i.e.by id
andby name
.pychasing.types.TeamIdentification
- represents a type of team identification for groups, i.e.by distinct players
andby player clusters
.pychasing.types.MatchResult
- represents a result of a match, i.e.win
orloss
pychasing.types.SortBy
- represents a sorting method, e.g.replay date
,group creation date
,group name
.pychasing.types.SortDir
- represents a sort direction, i.e.ascending
anddescending
.pychasing.types.GroupStats
- represents a stat group when exporting CSV, e.g.players
,teams
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pychasing-0.0.2.tar.gz
(13.4 kB
view details)
Built Distribution
pychasing-0.0.2-py3-none-any.whl
(13.0 kB
view details)
File details
Details for the file pychasing-0.0.2.tar.gz
.
File metadata
- Download URL: pychasing-0.0.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef972994211b18de2ac18f3cbe2edd4e6ec31b6f43327dd6c4466a848a41cec |
|
MD5 | b5d2505d0027531d06a55ddcc52cc6f8 |
|
BLAKE2b-256 | 03fccfbf593e700151bd76df0c1ad3e55dd5689a5fea78a533707e7e04a263db |
File details
Details for the file pychasing-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pychasing-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70096445d60d4234ac6ce6cc4b10f44a06394be23a2ebea2a6bfff23ce37fb88 |
|
MD5 | 91b9e07c49ece02220ff63cab2f8d4ba |
|
BLAKE2b-256 | be34dc62d27adfa5a899c51475bd5f7f6e1eecd4385ceb25e930ec73f57848b2 |