Skip to main content

Read-only Python wrapper around blaseball game API

Project description

blaseball-mike

Totally not a microphone to the blaseball API

This is a python wrapper over blaseball's public APIs, including player/team/game fetches, as well as deserialization of the event stream.

Installation

pip install blaseball-mike

Usage

>>> from blaseball_mike.models import Team
>>> fridays = Team.load_by_name('fridays')
>>> [player.name for player in fridays.lineup]
['Elijah Valenzuela', 'Juice Collins', 'York Silk', 'Baldwin Breadwinner', 'Terrell Bradley', 'Sixpack Dogwalker', 'Fletcher Yamamoto', 'Bevan Underbuck', 'Christian Combs']

Nested objects will autoload when iterated over. Attributes match the names found in the official Blaseball API, just in snake case. Derived spec can be found here: https://github.com/Society-for-Internet-Blaseball-Research/blaseball-api-spec

Supported objects are:

  • Team
  • GlobalEvent
  • Player
  • Division
  • Subleague
  • League
  • Game

Simulated stlats

If you want to see how a decree/blessing may shake out, you can make a simulated copy of a player with modified stats.

>>> york = Player.load_one('86d4e22b-f107-4bcf-9625-32d387fcb521')
>>> yorks = [york.simulated_copy(multipliers={'overall_rating': n/100.0}) for n in range(1, 10)]
>>> [y.batting_rating for y in yorks]
[0.9823391734764451, 0.991192294100704, 1.000038548392815, 1.0088780122143204, 1.0177107598404203, 1.026536864008585, 1.0353563959652192, 1.0441694255104683, 1.0529760210412604]

Development

python3 -m venv env
source env/bin/activate

Project details


Release history Release notifications | RSS feed

This version

1.1.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blaseball-mike-1.1.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

blaseball_mike-1.1.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file blaseball-mike-1.1.3.tar.gz.

File metadata

  • Download URL: blaseball-mike-1.1.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for blaseball-mike-1.1.3.tar.gz
Algorithm Hash digest
SHA256 f8af8a4ae7263f0fd286f86ee35d95eca4213869b4a4f25bd62ea832e10c5c10
MD5 4ba089833c7c63aa98a6d09269f05a9f
BLAKE2b-256 0c66d014e182d3e915dcb7645af2b0d69820336047e9834cca333c214d169036

See more details on using hashes here.

File details

Details for the file blaseball_mike-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: blaseball_mike-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for blaseball_mike-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 739b0880cd757c3063df3e34e034c8a0997bf0da333dae217d4ea608f9025c4e
MD5 b5bc0f0e6006066785a85e1bdbced50f
BLAKE2b-256 02510a2c85e6193b899f1156a5316bfba1a6b52a2d22a11ac3a45abbb272453c

See more details on using hashes here.

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