# 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
```python
>>> 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
```python
>>> 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.'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Chasesc/OSRS-API-Wrapper",
"name": "python-osrsapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "osrs,runescape,jagex,api,grandexchange,hiscores",
"author": "Chasesc",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/1d/ac/0dbdd453dc7b4586d4b3758ad0a13e8b985eae8a85a66c3409809cfe479f/python_osrsapi-0.0.5.tar.gz",
"platform": null,
"description": "# OSRS API Wrapper\n\nAllows simple access to Oldschool Runescape's API. Currently supports the only two APIs OSRS has. (Hiscores and GE)\n\n### Install\n\n```\npip install python-osrsapi\n```\n\n### Dev Install\n\n```\nmake dev\n```\n\n### Hiscores\n\n```python\n>>> from osrs_api.const import AccountType\n>>> from osrs_api import Hiscores\n>>> zezima = Hiscores('zezima')\n>>> zezima.skills\n{'attack': Skill(name=attack, rank=614026, level=76, xp=1343681), 'defence': ...}\n>>> zezima.skills['attack'].level\n76\n>>> zezima.skills['attack'].xp_tnl()\n131900\n>>> zezima.max_skill().name\n'firemaking'\n>>> def maxed_skills(hiscore, skill):\n... return hiscore.skills[skill].level == 99\n>>> zezima.filter(maxed_skills)\n{'firemaking': Skill(name=firemaking, rank=108780, level=99, xp=13034646)}\n>>> lynx = Hiscores('Lynx Titan')\n>>> mammal = Hiscores('mr mammal')\n>>> lynx > mammal\nTrue\n>>> iron_mammal = Hiscores('iron mammal', AccountType.IRONMAN)\n>>> iron_mammal.rank\n1052\n```\n\n### Grand Exchange\n\n```python\n>>> from osrs_api import GrandExchange\n>>> from osrs_api import Item\n>>> whip_id = Item.get_ids('abyssal whip')\n>>> whip_id\n4151\n>>> whip = GrandExchange.item(whip_id)\n>>> whip.description\n'A weapon from the abyss.'\n>>> whip.price(), whip.is_mem\n(1648785, True)\n>>> thirty_days = whip.price_info.trend_30\n>>> thirty_days.trend, thirty_days.change\n('negative', -18.0)\n>>> dagger_ids = Item.get_ids('rune dag')\n# If you enter a partial name, you will get a list of all possible matches.\n>>> dagger_ids\n[5696, 5678, 1229, 1213]\n# Names\n>>> [Item.id_to_name(id) for id in dagger_ids]\n['Rune dagger(p++)', 'Rune dagger(p+)', 'Rune dagger(p)', 'Rune dagger']\n>>> GrandExchange.item(dagger_ids[0]).description\n'The blade is covered with a nasty poison.'\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Oldschool Runescape API wrapper",
"version": "0.0.5",
"split_keywords": [
"osrs",
"runescape",
"jagex",
"api",
"grandexchange",
"hiscores"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "404e0ec75b9d96dc128240fba3c3f196c98e56ef137bc39e068372245ba2fa43",
"md5": "04440a9b66196d4a6601063c4ba9befa",
"sha256": "335a3761dfd6a3bd495fd9b90557a924550bf683bc45e9b1a18d159aa92b2824"
},
"downloads": -1,
"filename": "python_osrsapi-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "04440a9b66196d4a6601063c4ba9befa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 119744,
"upload_time": "2023-01-21T13:54:01",
"upload_time_iso_8601": "2023-01-21T13:54:01.487045Z",
"url": "https://files.pythonhosted.org/packages/40/4e/0ec75b9d96dc128240fba3c3f196c98e56ef137bc39e068372245ba2fa43/python_osrsapi-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1dac0dbdd453dc7b4586d4b3758ad0a13e8b985eae8a85a66c3409809cfe479f",
"md5": "4e1fdd12d38632ff64c6b46b3f47a262",
"sha256": "5890ecfe2a66bc7f8efd86939774a6cfd0df6a7859bf304fc70373509346f69e"
},
"downloads": -1,
"filename": "python_osrsapi-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "4e1fdd12d38632ff64c6b46b3f47a262",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 110463,
"upload_time": "2023-01-21T13:54:04",
"upload_time_iso_8601": "2023-01-21T13:54:04.026484Z",
"url": "https://files.pythonhosted.org/packages/1d/ac/0dbdd453dc7b4586d4b3758ad0a13e8b985eae8a85a66c3409809cfe479f/python_osrsapi-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-21 13:54:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Chasesc",
"github_project": "OSRS-API-Wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "python-osrsapi"
}