Skip to main content

A Python Package for scraping information and stats from Rocket League replays hosted on ballchasing.com.

Project description

Ballchasing Scrape

Ballchasing_Scrape is a Python package for scraping information and stats from Rocket League replays hosted on ballchasing.com.

Installation

Use the pip to install Ballchasing_Scrape.

pip install ballchasing_scrape

Usage

Sample script collecting stats from replays uploaded by RLCS Referee on ballchasing.com and exporting them to the local drive.

First, store your API key as an environment variable

$env:BALLCHASING_API_KEY = "YOUR_API_KEY"
import pandas as pd
import ballchasing_scrape as bc
import os

#Query Parameters
param = {
    "uploader": 76561199225615730
}

#Load ballchasing.com API Key

authkey = os.getenv('BALLCHASING_API_KEY')
head = {
    'Authorization':  authkey
    }

#Scraping stats from returned replays
#Empty argument for 'groupurl' may be used when searching for replays not in a specific group
df = bc.scrape_game_by_game_stats("",authkey,param=param)

res = input("What would you like to name the stats directory?")

#Creates a directory based on the above input function
try:
    os.mkdir(res)
except FileExistsError:
    ""

#Local export to a csv file
df.to_csv(res+"/"+res+"_pstats.csv",index=False)

Ballchasing.com API

For documentation on the Ballchasing API, see the following link: "https://ballchasing.com/doc/api". The documentation provides parameters which may be used with functions in this package (pass parameters through the argument with "param=" in the same way you would with a standard API call).

You must provide an authentication key from Ballchasing.com in order to use this package. You may generate one at "https://ballchasing.com/upload" after logging in.

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

ballchasing_scrape-1.1.8.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ballchasing_scrape-1.1.8-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file ballchasing_scrape-1.1.8.tar.gz.

File metadata

  • Download URL: ballchasing_scrape-1.1.8.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for ballchasing_scrape-1.1.8.tar.gz
Algorithm Hash digest
SHA256 ab528d1674bd1136712c38d609589b41a6088e688d9418db7d7767d3b045e0d4
MD5 3c850394cb715232762b0754fb3d2eb2
BLAKE2b-256 331840b272f8aebab25f1ec461eac5cd2404b1ae6e93fab53946d24fb273de6c

See more details on using hashes here.

File details

Details for the file ballchasing_scrape-1.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for ballchasing_scrape-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4feb46451b7d4d73f16c4a61f4d1d244cbfe47e1639502ae1f4a63abcc64fc7a
MD5 a9e5b72a98d7380b35924f70b42448c9
BLAKE2b-256 d2caca4994b7382485765818d085f24568ce60506b812e035bb3e00003115fbf

See more details on using hashes here.

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