Skip to main content

Python wrapper around blaseball-reference API

Project description

DEPRECATED blaseball-reference-py

DEPRECATED: This package is no longer being maintained. Datablase wrappers are being further developed in blaseball-mike. https://github.com/jmaliksi/blaseball-mike

Python wrapper around the Blaseball stats API

Installation

pip install blaseball-reference

Usage

https://api.blaseball-reference.com/docs#/

Development

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Release

  1. Update version in setup.py. Please use semver.
  2. Merge changes
  3. Create a new release in github with matching version ID. Project will be uploaded to PyPi automatically.

Examples

To start,

from blaseball_reference import api

When no arguments are specified, a dict object is returned, with a key for each player ID that could fit the query. For example, running

print(api.batting_average())

will print a dictionary of every Blaseball batter and their batting averages, and will not return pitchers.

{'batter_id': value'}

Some queries, event_type for example, will return every player.

You can specify the ID of the player to filter by. Multiple pitchers can also be specified, by passing a list or a string delimited by commas

pitcherera = api.era("pitcher_id")
pitcherera = api.era(["pitcher_id", "pitcher_id", "pitcher_id"])
pitcherera = api.era("pitcher_id, pitcher_id, pitcher_id")

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

blaseball-reference-2.1.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

blaseball_reference-2.1.1-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

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