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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file blaseball-mike-1.0.0.tar.gz
.
File metadata
- Download URL: blaseball-mike-1.0.0.tar.gz
- Upload date:
- Size: 11.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ccd348f1c7c1e530f97e2d7a09a0d9d79bcf9b920f4116f5b3911fc0dbb1ba4 |
|
MD5 | f61f98e39ad1dd89942616c6e2b108ec |
|
BLAKE2b-256 | e391d7277273212b58a4f1b8b85ea9349de0d3c19058017c12b50ad24807b719 |
File details
Details for the file blaseball_mike-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: blaseball_mike-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46319c7d683961d4e1844291c4d773a231cd7b5bc276223cd3774fa9d7faedb9 |
|
MD5 | 20ff892023c884d4cd715acba85cac75 |
|
BLAKE2b-256 | c95e2ae1634cc7c54d3361c2682850f6811ffe5af7110d1375c76c3455f9509f |