Metadata-Version: 2.4
Name: ballchasing_scrape
Version: 1.1.4
Summary: A Python Package for scraping information and stats from Rocket League replays hosted on ballchasing.com.
Author-email: Owen Singh <owenbksingh@gmail.com>
Project-URL: Homepage, https://github.com/owensingh38/ballchasing_scrape/
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Ballchasing_Scrape

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

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install Ballchasing_Scrape.

```bash
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.

```python
import pandas as pd
import ballchasing_scrape as bc
import json
import os

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

#Store ballchasing API key in a private file, such as a JSON
#Can also store the key as a global variable
with open('keys/keys.json', 'r') as f:
        keys = json.load(f)

AUTH = keys['ballchasing']
head = {
    'Authorization':  AUTH
    }

#Scraping stats from returned replays
#Empty argument for 'groupurl' may be used when searching for replays not in a specific group
df = bc.scrape_group("",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.
