get-wow-data-async


Nameget-wow-data-async JSON
Version 0.2.2.1 PyPI version JSON
download
home_pagehttps://github.com/JackBorah/get-wow-data-async
SummaryProvides async methods to make requests to specific World of Warcraft API's
upload_time2023-01-24 20:52:20
maintainer
docs_urlNone
authorJack Borah
requires_python
licenseMIT
keywords world of warcraft
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # THIS README IS NOT UPDATED TO 0.2.0.0

# get-wow-data-async

**get-wow-data-async** implements asynchronous requests to the World of Warcraft (WoW) APIs so you don't have to.

Example: Get the value of all auctions from the Winterhoof server.
```python
import getwowdataasync
import asyncio

async def main():
    us_api = await getwowdataasync.WowApi.create('us') #region
    winterhoof_auctions = await us_api.get_auctions(4) #4 = Winterhoof's connected realm id
    await us_api.close() #close aiohttp session after queries are done

    total_value = 0
    for item in winterhoof_auctions['auctions']:
        if item.get('unit_price'):
            total_value += item.get('unit_price')
        elif item.get('buyout'):
            total_value += item.get('buyout')
        elif item.get('bid'):
            total_value += item.get('bid')

    print(getwowdataasync.as_gold(total_value))
    #prints 430,846,968g 67s 00c

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())

```
## Features
Much faster then my other synchronous get-wow-data package.
Supported APIs. (see [this](https://develop.battle.net/documentation/world-of-warcraft/game-data-apis) for a complete list of APIs provided by blizzard. Not all are consumeable, currently, by get-wow-data-async)
- Connected Realms
- Items
    - Icons
- Auctions
- Professions
    - Recipes
    - Icons
- Wow Token

## Installing
get-wow-data-async is avilable on PyPi:
```console
$ python -m pip install getwowdataasync
```
## Setup
To access any blizzard API you need a Client Id and Client Secret.
1. Go to [https://develop.battle.net/](https://develop.battle.net/)
2. Click on Get started and login. 
3. Now click create client and fill out the form.
4. You now have a Client Id and Client Secret to query Blizzards APIs

*Remember not to commit your wow_api_secret!* Set wow_api_id and wow_api_secret as environment variables and **get-wow-data-async** will read these credentials from there.

#### Setting the client id and secret as an environment variable
dotenv is used inside WowApi.create() to get your client id and secret.

1. Create a file called .env
2. Set wow_api_id andwow_api_secret
```
wow_api_id = x
wow_api_secret = y
```
Now WowApi.create() will use those variabels to get an access token for future requests.

## API
See [documentation site](https://get-wow-data-async.readthedocs.io/en/latest/) for the API.
## Notes on the data
Visit [https://develop.battle.net/documentation/world-of-warcraft](https://develop.battle.net/documentation/world-of-warcraft) for blizzard official documentation.

Below are notes that i've gathered from the documentation, reading the returned data, and
from forum posts/reddit. 

#### Reading json
Using a normal print() on response.json() outputs gibberish.
I recommend either the pprint module or viewing the json from [this list](https://develop.battle.net/documentation/world-of-warcraft/game-data-apis) of all the available APIs. 


#### Href's
The href's in the json are links to related elements. One of the links will be to the url that produced that data. 
#### Prices
The prices or value of an item is in the following format g*sscc, where g = gold, s = silver, c = copper. 
Silver and copper are fixed in the last 4 decimal spaces whlie gold can be as any number of spaces before silver. So 25289400 is 2528g 94s 00c.

#### buyout vs unit_price
Stackable items have a single unit_price while unique items like weapons have a bid/buyout price.

#### Item bonus list
The item bonus list are the modifiers applied to an item, such as the level its scaled to. Blizzard does not make the bonus values and their corresponding effects available through an API. (Boo)

Versions of an item with different bonuses can be found on [wowhead](https://www.wowhead.com/). Mouse over select version and pick your desired version from the drop down menu. 

#### Item context
Where the item was created. Incomplete list
| Context 	| Value          	|
|---------	|----------------	|
| 1       	| Normal Dungeon 	|
| 5       	| Heroic Raid    	|
| 11      	| Quest Reward   	|
| 14      	| Vendor         	|
| 15      	| Black Market   	|
#### Item modifiers
No idea
####
## Parameter Cheatsheet
Incomplete list
| Region 	| Namespace        	| locale (language) 	|
|--------	|------------------	|-------------------	|
| us     	| static-{region}  	| en_US             	|
| eu     	| dynamic-{region} 	| es_MX             	|
| kr     	| profile-{region} 	| pt_BR             	|
| tw     	|                  	| de_DE             	|
| cn     	|                  	| en_GB             	|
|        	|                  	| es_ES             	|
|        	|                  	| fr_FR             	|
|        	|                  	| it_IT             	|
|        	|                  	| ru_RU             	|
|        	|                  	| ko_KR             	|
|        	|                  	| zh_TW             	|
|        	|                  	| zh_CN             	|


## Feedback
Feel free to [file an issue](https://github.com/JackBorah/getwowdata/issues/new). 

I'm currently teaching myself how to code, so, if you have any suggestions or corrections I would really appriciate it!


## License
MIT

## Related project
I was writing this for [my WoW profession profit calculator](https://github.com/JackBorah/wow-profit-calculator) site.

Hopefully you'll find this useful!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JackBorah/get-wow-data-async",
    "name": "get-wow-data-async",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "World of Warcraft",
    "author": "Jack Borah",
    "author_email": "borahjack@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/79/c3/ca27b00f57fbe52496f082cd62947a0b2b882825594eeb29a37f6d865af9/get-wow-data-async-0.2.2.1.tar.gz",
    "platform": "any",
    "description": "# THIS README IS NOT UPDATED TO 0.2.0.0\r\n\r\n# get-wow-data-async\r\n\r\n**get-wow-data-async** implements asynchronous requests to the World of Warcraft (WoW) APIs so you don't have to.\r\n\r\nExample: Get the value of all auctions from the Winterhoof server.\r\n```python\r\nimport getwowdataasync\r\nimport asyncio\r\n\r\nasync def main():\r\n    us_api = await getwowdataasync.WowApi.create('us') #region\r\n    winterhoof_auctions = await us_api.get_auctions(4) #4 = Winterhoof's connected realm id\r\n    await us_api.close() #close aiohttp session after queries are done\r\n\r\n    total_value = 0\r\n    for item in winterhoof_auctions['auctions']:\r\n        if item.get('unit_price'):\r\n            total_value += item.get('unit_price')\r\n        elif item.get('buyout'):\r\n            total_value += item.get('buyout')\r\n        elif item.get('bid'):\r\n            total_value += item.get('bid')\r\n\r\n    print(getwowdataasync.as_gold(total_value))\r\n    #prints 430,846,968g 67s 00c\r\n\r\nasyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\r\nasyncio.run(main())\r\n\r\n```\r\n## Features\r\nMuch faster then my other synchronous get-wow-data package.\r\nSupported APIs. (see [this](https://develop.battle.net/documentation/world-of-warcraft/game-data-apis) for a complete list of APIs provided by blizzard. Not all are consumeable, currently, by get-wow-data-async)\r\n- Connected Realms\r\n- Items\r\n    - Icons\r\n- Auctions\r\n- Professions\r\n    - Recipes\r\n    - Icons\r\n- Wow Token\r\n\r\n## Installing\r\nget-wow-data-async is avilable on PyPi:\r\n```console\r\n$ python -m pip install getwowdataasync\r\n```\r\n## Setup\r\nTo access any blizzard API you need a Client Id and Client Secret.\r\n1. Go to [https://develop.battle.net/](https://develop.battle.net/)\r\n2. Click on Get started and login. \r\n3. Now click create client and fill out the form.\r\n4. You now have a Client Id and Client Secret to query Blizzards APIs\r\n\r\n*Remember not to commit your wow_api_secret!* Set wow_api_id and wow_api_secret as environment variables and **get-wow-data-async** will read these credentials from there.\r\n\r\n#### Setting the client id and secret as an environment variable\r\ndotenv is used inside WowApi.create() to get your client id and secret.\r\n\r\n1. Create a file called .env\r\n2. Set wow_api_id andwow_api_secret\r\n```\r\nwow_api_id = x\r\nwow_api_secret = y\r\n```\r\nNow WowApi.create() will use those variabels to get an access token for future requests.\r\n\r\n## API\r\nSee [documentation site](https://get-wow-data-async.readthedocs.io/en/latest/) for the API.\r\n## Notes on the data\r\nVisit [https://develop.battle.net/documentation/world-of-warcraft](https://develop.battle.net/documentation/world-of-warcraft) for blizzard official documentation.\r\n\r\nBelow are notes that i've gathered from the documentation, reading the returned data, and\r\nfrom forum posts/reddit. \r\n\r\n#### Reading json\r\nUsing a normal print() on response.json() outputs gibberish.\r\nI recommend either the pprint module or viewing the json from [this list](https://develop.battle.net/documentation/world-of-warcraft/game-data-apis) of all the available APIs. \r\n\r\n\r\n#### Href's\r\nThe href's in the json are links to related elements. One of the links will be to the url that produced that data. \r\n#### Prices\r\nThe prices or value of an item is in the following format g*sscc, where g = gold, s = silver, c = copper. \r\nSilver and copper are fixed in the last 4 decimal spaces whlie gold can be as any number of spaces before silver. So 25289400 is 2528g 94s 00c.\r\n\r\n#### buyout vs unit_price\r\nStackable items have a single unit_price while unique items like weapons have a bid/buyout price.\r\n\r\n#### Item bonus list\r\nThe item bonus list are the modifiers applied to an item, such as the level its scaled to. Blizzard does not make the bonus values and their corresponding effects available through an API. (Boo)\r\n\r\nVersions of an item with different bonuses can be found on [wowhead](https://www.wowhead.com/). Mouse over select version and pick your desired version from the drop down menu. \r\n\r\n#### Item context\r\nWhere the item was created. Incomplete list\r\n| Context \t| Value          \t|\r\n|---------\t|----------------\t|\r\n| 1       \t| Normal Dungeon \t|\r\n| 5       \t| Heroic Raid    \t|\r\n| 11      \t| Quest Reward   \t|\r\n| 14      \t| Vendor         \t|\r\n| 15      \t| Black Market   \t|\r\n#### Item modifiers\r\nNo idea\r\n####\r\n## Parameter Cheatsheet\r\nIncomplete list\r\n| Region \t| Namespace        \t| locale (language) \t|\r\n|--------\t|------------------\t|-------------------\t|\r\n| us     \t| static-{region}  \t| en_US             \t|\r\n| eu     \t| dynamic-{region} \t| es_MX             \t|\r\n| kr     \t| profile-{region} \t| pt_BR             \t|\r\n| tw     \t|                  \t| de_DE             \t|\r\n| cn     \t|                  \t| en_GB             \t|\r\n|        \t|                  \t| es_ES             \t|\r\n|        \t|                  \t| fr_FR             \t|\r\n|        \t|                  \t| it_IT             \t|\r\n|        \t|                  \t| ru_RU             \t|\r\n|        \t|                  \t| ko_KR             \t|\r\n|        \t|                  \t| zh_TW             \t|\r\n|        \t|                  \t| zh_CN             \t|\r\n\r\n\r\n## Feedback\r\nFeel free to [file an issue](https://github.com/JackBorah/getwowdata/issues/new). \r\n\r\nI'm currently teaching myself how to code, so, if you have any suggestions or corrections I would really appriciate it!\r\n\r\n\r\n## License\r\nMIT\r\n\r\n## Related project\r\nI was writing this for [my WoW profession profit calculator](https://github.com/JackBorah/wow-profit-calculator) site.\r\n\r\nHopefully you'll find this useful!\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Provides async methods to make requests to specific World of Warcraft API's",
    "version": "0.2.2.1",
    "split_keywords": [
        "world",
        "of",
        "warcraft"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "440016a184ebde53924cfd274c89398295cefe9fc8e3cf02012901749c7b4528",
                "md5": "2c7e67f7f34c6a9eef3c4090b048f94c",
                "sha256": "302224c194e545f31d304f89435e12ebc1ef3fd72e61d866fd2965606c4df74d"
            },
            "downloads": -1,
            "filename": "get_wow_data_async-0.2.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2c7e67f7f34c6a9eef3c4090b048f94c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11956,
            "upload_time": "2023-01-24T20:52:19",
            "upload_time_iso_8601": "2023-01-24T20:52:19.179587Z",
            "url": "https://files.pythonhosted.org/packages/44/00/16a184ebde53924cfd274c89398295cefe9fc8e3cf02012901749c7b4528/get_wow_data_async-0.2.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79c3ca27b00f57fbe52496f082cd62947a0b2b882825594eeb29a37f6d865af9",
                "md5": "bae3427801b62d48ec40949ab3a55783",
                "sha256": "9ac858db3cc167cab0df1de9d66ab2d0bc29c992b5e5604d658d3ba231f70d51"
            },
            "downloads": -1,
            "filename": "get-wow-data-async-0.2.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bae3427801b62d48ec40949ab3a55783",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10944,
            "upload_time": "2023-01-24T20:52:20",
            "upload_time_iso_8601": "2023-01-24T20:52:20.734266Z",
            "url": "https://files.pythonhosted.org/packages/79/c3/ca27b00f57fbe52496f082cd62947a0b2b882825594eeb29a37f6d865af9/get-wow-data-async-0.2.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-24 20:52:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "JackBorah",
    "github_project": "get-wow-data-async",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "get-wow-data-async"
}
        
Elapsed time: 0.03434s