Skip to main content

PUBG JSON API wrapper and playback visualizer.

Project description

rtd pypi pyversions

Python PUBG JSON API Wrapper and (optional) playback visualizer.

Samples

Installation

To install chicken-dinner, use pip. This will install the core dependencies (requests library) which provide functionality to the API wrapper classes.

pip install chicken-dinner

To use the playback visualizations you will need to install the library with extra dependencies for plotting (matplotlib and pillow). For this you can also use pip:

pip install chicken-dinner[visual]

To generate the animations you will also need ffmpeg installed on your machine. On Max OSX you can install ffmpeg using brew.

brew install ffmpeg

You can install ffmpeg on other systems from here.

Usage

Working with the low-level API class.

from chicken_dinner.pubgapi import PUBGCore

api_key = "your_api_key"
pubgcore = PUBGCore(api_key, "pc-na")
shroud = pubgcore.players("player_names", "shroud")
print(shroud)

# {'data': [{'type': 'player', 'id': 'account.d50f...

Working with the high-level API class.

from chicken_dinner.pubgapi import PUBG

api_key = "your_api_key"
pubg = PUBG(api_key, "pc-na")
shroud = pubg.players_from_names("shroud")[0]
shroud_season = shroud.get_current_season()
squad_fpp_stats = shroud_season.game_mode_stats("squad", "fpp")
print(squad_fpp_stats)

# {'assists': 136, 'boosts': 313, 'dbnos': 550, 'daily_kills':...

Visualizing telemetry data

from chicken_dinner.pubgapi import PUBG

api_key = "your_api_key"
pubg = PUBG(api_key, "pc-na")
shroud = pubg.players_from_names("shroud")[0]
recent_match_id = shroud.match_ids[0]
recent_match = pubg.match(recent_match_id)
recent_match_telemetry = recent_match.get_telemetry()
recent_match_telemetry.playback_animation("recent_match.html")

Recommended playback settings:

telemetry.playback_animation(
    "match.html",
    zoom=True,
    labels=True,
    label_players=[],
    highlight_winner=True,
    label_highlights=True,
    size=6,
    end_frames=60,
    use_hi_res=False,
    color_teams=True,
    interpolate=True,
    damage=True,
    interval=2,
    fps=30,
)

See the documentation for more details.

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

chicken_dinner-0.2.4.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

chicken_dinner-0.2.4-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file chicken_dinner-0.2.4.tar.gz.

File metadata

File hashes

Hashes for chicken_dinner-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d82ff15362c40b2c12657a0116c6f5e020fe1fc7fa6984cafa4d3c838a22eac2
MD5 9545ca1a79bf957b4be90ff667864213
BLAKE2b-256 fd2e98951dd613574b5eaecdcb00580d7e580568188ee7720bdbc38015065666

See more details on using hashes here.

File details

Details for the file chicken_dinner-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for chicken_dinner-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b724787a0a9095178e8645ede98d1113b6284c8cb080ecb4dac70df0c122d83a
MD5 7ac56fb411327a1abc736ee5ddc46e7d
BLAKE2b-256 3abe0965b409539b25eaad78cf453be74e7accd6bf05cc2c7173de54131a5f5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page