Skip to main content

Oldschool Runescape API wrapper

Project description

OSRS API Wrapper

Allows simple access to Oldschool Runescape's API. Currently supports the only two APIs OSRS has. (Hiscores and GE)

Install

pip install python-osrsapi

Dev Install

make dev

Hiscores

>>> from osrs_api.const import AccountType
>>> from osrs_api import Hiscores
>>> zezima = Hiscores('zezima')
>>> zezima.skills
{'attack': Skill(name=attack, rank=614026, level=76, xp=1343681), 'defence': ...}
>>> zezima.skills['attack'].level
76
>>> zezima.skills['attack'].xp_tnl()
131900
>>> zezima.max_skill().name
'firemaking'
>>> def maxed_skills(hiscore, skill):
...     return hiscore.skills[skill].level == 99
>>> zezima.filter(maxed_skills)
{'firemaking': Skill(name=firemaking, rank=108780, level=99, xp=13034646)}
>>> lynx = Hiscores('Lynx Titan')
>>> mammal = Hiscores('mr mammal')
>>> lynx > mammal
True
>>> iron_mammal = Hiscores('iron mammal', AccountType.IRONMAN)
>>> iron_mammal.rank
1052

Grand Exchange

>>> from osrs_api import GrandExchange
>>> from osrs_api import Item
>>> whip_id = Item.get_ids('abyssal whip')
>>> whip_id
4151
>>> whip = GrandExchange.item(whip_id)
>>> whip.description
'A weapon from the abyss.'
>>> whip.price(), whip.is_mem
(1648785, True)
>>> thirty_days = whip.price_info.trend_30
>>> thirty_days.trend, thirty_days.change
('negative', -18.0)
>>> dagger_ids = Item.get_ids('rune dag')
# If you enter a partial name, you will get a list of all possible matches.
>>> dagger_ids
[5696, 5678, 1229, 1213]
# Names
>>> [Item.id_to_name(id) for id in dagger_ids]
['Rune dagger(p++)', 'Rune dagger(p+)', 'Rune dagger(p)', 'Rune dagger']
>>> GrandExchange.item(dagger_ids[0]).description
'The blade is covered with a nasty poison.'

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

python_osrsapi-0.0.5.tar.gz (110.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_osrsapi-0.0.5-py3-none-any.whl (119.7 kB view details)

Uploaded Python 3

File details

Details for the file python_osrsapi-0.0.5.tar.gz.

File metadata

  • Download URL: python_osrsapi-0.0.5.tar.gz
  • Upload date:
  • Size: 110.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for python_osrsapi-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5890ecfe2a66bc7f8efd86939774a6cfd0df6a7859bf304fc70373509346f69e
MD5 4e1fdd12d38632ff64c6b46b3f47a262
BLAKE2b-256 1dac0dbdd453dc7b4586d4b3758ad0a13e8b985eae8a85a66c3409809cfe479f

See more details on using hashes here.

File details

Details for the file python_osrsapi-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: python_osrsapi-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 119.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for python_osrsapi-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 335a3761dfd6a3bd495fd9b90557a924550bf683bc45e9b1a18d159aa92b2824
MD5 04440a9b66196d4a6601063c4ba9befa
BLAKE2b-256 404e0ec75b9d96dc128240fba3c3f196c98e56ef137bc39e068372245ba2fa43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page