Rabona Python client

in #rabona2 months ago

rabona-python is a simple wrapper around Rabona (rabona.io) API. It wraps the generic request-building logic into simple Python methods - over the RabonaClient instance so that applications can interact with the Rabona.

Currently only one-way is supported, so you can only fetch data, but in the future it's also planned to create corresponding Hive Blockchain CustomJson
objects to interact with the game.

installation

$ (sudo) pip install rabona_python

usage

>>> from rabona_python import RabonaClient
>>> r = RabonaClient()
>>> r.userinfo(user="emrebeyler")

{
    '352': 0,
    '4231': 0,
    '433': 0,
    '442': 0,
    '451': 0,
    'advertising1_duration': 0,
    'advertising1_income': 0,
    'advertising1_partner': None,
    'avg_visitors': 0,
    'batch_buy_player': 1,
    'batch_buy_rbn': 1,
    'batch_referral': 1,
    'batch_rename': 1,
    'batch_renew_contract': None,
    'batch_scout': 1,
    'batch_sell_player': 1,
    'batch_set_lineup': None,
    'batch_sign': 1,
    'batch_sign_advertising': None,
    'batch_train': 1,
    'batch_transfer_money': 1,
    'batch_transfer_player': None,
    'batch_upgrade': 1,
    'batch_upgrade_catering': 1,
    'batch_win10': None,
    'beer_price': 2.0,
    'bratwurst_price': 1.0,
    'catering_busy': 1,
    'catering_busy_until': 1601985435.0,
    'catering_capacity': 1000,
    'catering_lvl': 6,
    'currency': 383061.76,
    'current_season': 0,
    'hive_balance': 27.131,
    'id': 6044,
    'international_fans': 500,
    'league_id': 638,
    'league_level': 2,
    'national_fans': 1000,
    'npc': 0,
    'regional_fans': 10000,
    'scarf_price': 10.0,
    'shirt_price': 50.0,
    'shop_busy': 0,
    'shop_busy_until': 1601560440.0,
    'shop_capacity': 1,
    'shop_lvl': 1,
    'stadium_busy': 1,
    'stadium_busy_until': 1601985384.0,
    'stadium_capacity': 1000,
    'stadium_lvl': 6,
    'startdate': 1601156403,
    'teamname': 'Galatasaray FC',
    'ticket_price': 25,
    'training_busy_until': 1601730138.0,
    'training_possible': 0,
    'user': 'emrebeyler',
    'youth_academy_busy': 1,
    'youth_academy_busy_until': 1601985480.0,
    'youth_academy_capacity': 40,
    'youth_academy_level': 5
}

All other methods are supported dynamically, just build the method in the Client and pass the required parameters.

Ex: You want to get the global rankings:

>>> from rabona_python import RabonaClient
>>> r = RabonaClient()
>>> r.rankings()[0]
{
    'RBN': 0.0,
    'avg_age': 17,
    'avg_os': 27,
    'avg_salary': 419,
    'catering_lvl': 0,
    'club': 'YouTube',
    'games_draw': 0,
    'games_lost': 0,
    'games_won': 0,
    'id': 6170,
    'matches_played': 0,
    'number_of_players': 12,
    'shop_lvl': 0,
    'stadium_lvl': 0,
    'total_fans': 11500,
    'username': 'youtube123',
    'win_ratio': 0,
    'youth_academy_lvl': 0
}

Notes