Skip to content

Commit 504f62f

Browse files
authored
New profile, game data and community endpoints (#14)
1 parent b6db1a0 commit 504f62f

35 files changed

+12183
-1542
lines changed

.drone.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
11
---
22
kind: pipeline
3-
name: python27
4-
5-
steps:
6-
- name: test
7-
image: python:2.7-alpine3.8
8-
commands:
9-
- ./drone.sh
10-
- pytest -c pytest_legacy.ini
11-
12-
---
13-
kind: pipeline
3+
type: docker
144
name: python35
155

166
steps:
177
- name: test
188
image: python:3.5-alpine3.8
199
commands:
2010
- ./drone.sh
21-
- pytest -c pytest_legacy.ini
2211

2312
---
2413
kind: pipeline
14+
type: docker
2515
name: python36
2616

2717
steps:
2818
- name: test
2919
image: python:3.6-alpine3.8
3020
commands:
3121
- ./drone.sh
32-
- pytest
3322

3423
---
3524
kind: pipeline
25+
type: docker
3626
name: python37
3727

3828
steps:
3929
- name: test
4030
image: python:3.7-alpine3.8
4131
commands:
4232
- ./drone.sh
43-
- pytest

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ MANIFEST
88
docs/_build/
99
.coverage
1010
env/
11-
.cache
11+
.cache
12+
.vscode
13+
cov_html/
14+
.pytest_cache

.isort.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
line_length=99
3+
multi_line_output=6
4+
lines_after_imports=2

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,47 @@
3434
## 2.3.1 (20-05-2019)
3535

3636
* Added some leeway protection against expired tokens
37+
38+
## 3.0.0
39+
40+
* Split community, game data and profile API's into separate mixins
41+
* Add flake8 and isort to test requirements
42+
* Drop support for python 2.7
43+
* Changes in game data endpoints:
44+
* `get_races` became `get_playable_race_index`
45+
* `get_race` became `get_playable_race`
46+
* `get_connected_realms` became `get_connected_realm_index`
47+
* `get_mythic_keystone_dungeon` became `get_mythic_keystone_dungeon_index`
48+
* `get_mythic_keystones` became `get_mythic_keystone_index`
49+
* `get_mythic_keystone_periods` became `get_mythic_keystone_period_index`
50+
* `get_mythic_keystone_seasons` became `get_mythic_keystone_season_index`
51+
* `get_mythic_keystone_leaderboards` became `get_mythic_keystone_leaderboard_index`
52+
* `get_playable_specializations` became `get_playable_specialization_index`
53+
* `get_power_types` became `get_power_type_index`
54+
* `get_realms` became `get_realm_index`
55+
* `get_regions` became `get_region_index`
56+
* `get_token` became `get_token_index`
57+
* new achievments endpoints
58+
* new creatures endpoints
59+
* new guild endpoints
60+
* new guild crest endpoints
61+
* new item endpoints
62+
* new mount endpoints
63+
* new pets endpoints
64+
* new pvp endpoints
65+
* new quest endpoints
66+
* new pvp season endpoints
67+
* new pvp tier endpoints
68+
* new titles endpoints
69+
* Changes in profile endpoints:
70+
* new character achievements endpoint
71+
* new character appearance endpoint
72+
* new character equipment endpoint
73+
* new character media endpoint
74+
* new character profile endpoint
75+
* new character pvp endpoints
76+
* new character specialization endpoint
77+
* new character statistics endpoint
78+
* new character titles endpoint
79+
* Changes in community endpoints:
80+
* new `get_oauth_profile` endpoint

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ include pytest.ini
99
recursive-include docs *
1010
recursive-exclude * *.py[co]
1111
recursive-exclude * *.DS_Store
12-
recursive-exclude * __pycache__
12+
recursive-exclude * *,cover
13+
recursive-exclude * __pycache__

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
.PHONY: tests devinstall docs clean clean_build build test_publish publish
22

33

4-
tests:
5-
pytest -s -v tests
6-
74
devinstall:
85
pip install -e .
96
pip install -e .[tests]
107
pip install -e .[docs]
118

12-
docs: clean
13-
sphinx-apidoc --force -o docs/modules/ wowapi
14-
$(MAKE) -C docs clean
15-
$(MAKE) -C docs html
9+
docs:
10+
rm -rf docs
11+
mkdir docs
12+
pydocmd simple wowapi++ wowapi.api++ wowapi.mixins.community++ wowapi.mixins.game_data++ wowapi.mixins.profile++ > docs/api.md
1613

17-
build:
14+
clean:
1815
rm -rf dist
1916
rm -rf build
17+
rm -rf cov_html
18+
rm -rf python_wowapi.egg-info
19+
rm -rf .coverage
20+
rm -rf docs
21+
22+
build:
23+
make clean
2024
python setup.py sdist bdist_wheel
2125

2226
test_publish:

README.md

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,54 @@
77

88

99

10-
Python-wowapi is a client library for interacting with the World of Warcraft
11-
Community and Game Data API.
10+
Python-wowapi is a client library for interacting with the World of Warcraft endpoins of the [Blizzard API](https://develop.battle.net/documentation/guides/getting-started)
1211

13-
To interact with this library, you need to first get a client-id and client secret by registering [here](https://develop.battle.net/access)
12+
Python-wowapi includes support for the following WoW API's:
13+
* Community API
14+
* Game data API
15+
* Character Profile API
16+
17+
To interact with this library, you need to first get a client-id and client secret by [registering](https://develop.battle.net/access) your application.
1418

1519
For more information about official World of Warcraft API's visit:
16-
[Official API documentation](https://develop.battle.net/documentation)
17-
[Official API Forum](https://us.battle.net/forums/en/bnet/15051532/)
20+
* [Official API documentation](https://develop.battle.net/documentation)
21+
* [Official API Forum](https://us.forums.blizzard.com/en/blizzard/c/api-discussion)
22+
23+
## API Docs
1824

19-
API documentation can be found at [python-wowapi.readthedocs.org](https://python-wowapi.readthedocs.org). Examples and installation instructions are documented here.
25+
For examples and all available endpoints, visit the [API Documentation](docs/api.md)
2026

2127
## Installing
2228

2329
```bash
2430
pip install python-wowapi
2531
```
2632

27-
## API instance
28-
29-
```python
30-
import os
31-
32-
from wowapi import WowApi
33-
34-
api = WowApi(os.environ['WOW_CLIENT_ID'], os.environ['WOW_CLIENT_SECRET'])
35-
```
36-
37-
## Community API example
38-
39-
```python
40-
api.get_auctions('eu', 'silvermoon', locale='de_DE')
41-
```
42-
33+
## WoW Classic API support
4334

44-
## Game Data API examples
35+
According to this [Forum post](https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-classic-api-endpoints/346), Blizzard is adding support for some game data API's.
4536

37+
In order to use these endpoints, you need to provide the classic namespace:
4638

47-
### Get token price
4839
```python
49-
api.get_token('eu', namespace='dynamic-eu', locale='de_DE')
40+
api.get_item_class_index('us', 'static-classic-us')
5041
```
5142

52-
### Get class specializations and detail specialization resource
53-
```python
54-
data = api.get_playable_specializations('us', namespace='static-us')
43+
## Development & Testing
5544

56-
spec_id = data['character_specializations'][0]['id']
57-
specialization = api.get_playable_specialization('us', namespace='static-us', spec_id=spec_id)
45+
```bash
46+
make devinstall
47+
pytest
5848
```
5949

60-
### Get game data resource by url
61-
62-
This example shows how to fetch a game data resource by url.
63-
The `get_data_resource` method will take care of adding your access_token to the url.
50+
Alternatively you can also run the full [drone.io](https://drone.io) pipeline [locally](https://docs.drone.io/cli/install/) or [remote](https://cloud.drone.io/lockwooddev/python-wowapi/)
6451

65-
```python
66-
api.get_data_resource('https://eu.api.blizzard.com/data/wow/connected-realm/509?namespace=dynamic-eu', region='eu')
52+
```bash
53+
drone exec
6754
```
6855

69-
70-
## Development & Testing
56+
To build the docs:
7157

7258
```bash
73-
pip install -e .
74-
pip install -e .[tests]
75-
pytest
59+
make docs
7660
```

0 commit comments

Comments
 (0)