Package: osrs-highscores
osrs_highscoresProject PurposeThis is a simple wrapper library to make the OSRS Highscores usable from a python perspective. This wrapper provides straight information from the OSRS Highscores with no post processing, with lookups via snake_case naming.Installing and UsageInstallationpython -m pip install osrs_highscoresUpgradingpython -m pip install osrs_highscores --upgradeBasic UsageHighscores>>> from osrs_highsores import Highscores

# Instantiates a new user object from username=zezima from default highscores.
>>> user = Highscores('Zezima')
>>> user.overall
{'rank': '5238', 'level': '1889', 'experience': '175809308'}

# Target A specific game mode
# Avilable targets are based on the runescape URI (ironman, ultamite, hardcore_ironman, seasonal, deadman, tournament)
>>> user = Highscores('dids', target='ironman')
>>> user.attack.level
99

# Update existing data of object
user.update()RankingsThe OSRS API does not have a specific endpoint, so queries using ranks is done with bs4 and scraping the UI result.Implementation of this Function may not work on all systems if you have issues with bs4.>>> from osrs_highscores import Rankings

>>> ranks = Rankings()
>>> attack_top = ranks.get_rank_in_skill('attack', 1)
>>> print(attack_top.username)
Heur

>>>print(attack_top.level)
99TargetsTable of all available OSRS Highscore boards and the associatedtargetvalue used when instantiating aHighscoresobject to query them.TargetValueOSRS HighscoresdefaultIronmanironmanUltimate IronmanultimateHardcore Ironmanhardcore_ironmanSeasonalseasonalDeadman ModedeadmanTournamenttournamentFresh Start Worldsfresh_startSkillerskiller1 Defenceskiller_defenceHighscores AttributesTable of all available attributes for highscores objectAdvanced UseIn the list below, the following are exposed as top level attributes for the return for processing/use.user.*skill (e.g. attack, runecraft, herblore)ranklevelxpxp_to_leveluser.*minigame (e.g. clue_scrolls_easy, lms_rank, bounty_hunter_hunter)rankscoreuser.*boss (e.g. chaos_elemental, hespori, the_gauntlet)rankkillsExampleuser = Highscores('Lynx Titan')
print("Lynx Titan:\n"
      "Attack %s overall: %s\n"
      "Dag Rex Kills: %s\n"
      "All Clues Completed: %s\n"
      "All Clues Rank: %s" % (
           user.attack.level,
           user.overall,
           user.dagannoth_rex.kills,
           user.clue_scrolls_all.score,
           user.clue_scrolls_all.rank))OutputLynx Titan:
Attack 99 overall: {'rank': '1', 'level': '2277', 'xp': '4600000000'}
Dag Rex Kills: -1
All Clues Completed: 22
All Clues Rank: 433023Reference TablePLEASE NOTEThis table may not be up-to-date. It was last updated on
26 July 2023.Ref # is the associated osrs_highscores dict index numberTable # is the associated OSRS highscores URL reference lookup query paramCategory=0 assumed for skill refs.Category=1 for all nonskills.Attribute NameRef #Table # (relative to category)overall00attack11defence22strength33hitpoints44ranged55prayer66magic77cooking88woodcutting99fletching1010fishing1111firemaking1212crafting1313smithing1414mining1515herblore1616agility1717thieving1818slayer1919farming2020runecraft2121hunter2222construction2323league_points240bounty_hunter_hunter251bounty_hunter_rogue262bounty_hunter_legacy_hunter273bounty_hunter_legacy_rogue284clue_scrolls_all295clue_scrolls_beginner306clue_scrolls_easy317clue_scrolls_medium328clue_scrolls_hard339clue_scrolls_elite3410clue_scrolls_master3511lms_rank3612pvp_arena_rank3713soul_wars_zeal3814rifts_closed3915abyssal_sire4016alchemical_hydra4117artio4218barrows_chests4319bryophyta4420callisto4521calvar_ion4622cerberus4723chambers_of_xeric4824chambers_of_xeric_challenge_mode4925chaos_elemental5026chaos_fanatic5127commander_zilyana5228corporeal_beast5329crazy_archaeologist5430dagannoth_prime5531dagannoth_rex5632dagannoth_supreme5733deranged_archaeologist5834duke_sucellus5935general_graardor6036giant_mole6137grotesque_guardians6238hespori6339kalphite_queen6440king_black_dragon6541kraken6642kree_arra6743kril_tsutsaroth6844mimic6945nightmare7046phosanis_nightmare7147obor7248phantom_muspah7349sarachnis7450scorpia7551skotizo7652spindel7753tempoross7854the_gauntlet7955the_corrupted_gauntlet8056the_leviathan8157the_whisperer8258theatre_of_blood8359thermonuclear_smoke_devil8460tzkal_zuk8561tztok_jad8662vardorvis8763venenatis8864vet_ion8965vorkath9066wintertodt9167zalcano9268zulrah9369