Skip to main content

Description

Project description

brawlapi

See the Exemples

import matplotlib.image as img
import matplotlib.pyplot as plt

import brawlapi as api


with api.DataBase('<path-to-db>') as db:
    jm = api.Player("jm", db)
    print(jm)

    # Each day is stored in the database with a unique key
    # The key consists in the first 8 chars of the ISO-formated date string (yyyymmdd)
    print(f"{len(jm.keys)} days: {jm.keys}")

    # Get all the games of the day 0
    print(jm[0])
    # or
    print(jm.get_battles(jm.keys[0]))

    # Or with a generator
    for matchs in jm.battles:
        print(matchs)
        break

    # Infos on all battles for a player
    for m in jm.battles:
        for g in m:
            print(f"{g.battle.mode} : {g.start} + {g.duration} = {g.end}")



    print("BRAWLERS")
    brawlers = db.brawlers
    print(brawlers)

    nita = db.get_brawler(brawlers[1])
    print(nita.keys)

    # print(nita.invocs)
    print(nita.stats)

    nita.dwnl_image("test.png")

    im = img.imread("test.png")
    plt.imshow(im)
    plt.show()

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

brawlapi-0.1.13.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

brawlapi-0.1.13-py3-none-any.whl (5.1 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