Skip to content

Commit b438e35

Browse files
committed
Code standards
1 parent 8c566c6 commit b438e35

File tree

3 files changed

+34
-37
lines changed

3 files changed

+34
-37
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,45 @@ An asynchronous Python client for XIVAPI
66
[![Python 3.6](https://img.shields.io/badge/python-3.6-green.svg)](https://www.python.org/downloads/release/python-360/)
77

88
## Requirements
9-
```
9+
```python
1010
python>=3.6.0
1111
asyncio
1212
aiohttp
1313
```
1414

1515
## Installation
16-
```
16+
```python
1717
pip install xivapi-py
1818
```
1919

2020
## Supported API end points
2121

22-
* /character/search
23-
* /character/id
24-
* /character/verify
25-
* /character/update
26-
* /freecompany/search
27-
* /freecompany/id
28-
* /linkshell/search
29-
* /linkshell/id
30-
* /pvpteam/search
31-
* /pvpteam/id
32-
* /index/search (e.g. recipe, item, action, pvpaction, mount, e.t.c.)
33-
* /index/id
34-
* /lore/search
35-
* /market/item/id?servers=Phoenix,Odin
36-
* /market/item/id?dc=Chaos
37-
* /lodestone
38-
* /lodestone/news
39-
* /lodestone/notices
40-
* /lodestone/maintenance
41-
* /lodestone/updates
42-
* /lodestone/status
43-
* /lodestone/worldstatus
44-
* /lodestone/devblog
45-
* /lodestone/devposts
46-
* /lodestone/deepdungeon
47-
* /lodestone/feasts
22+
* /character/search
23+
* /character/id
24+
* /character/verify
25+
* /character/update
26+
* /freecompany/search
27+
* /freecompany/id
28+
* /linkshell/search
29+
* /linkshell/id
30+
* /pvpteam/search
31+
* /pvpteam/id
32+
* /index/search (e.g. recipe, item, action, pvpaction, mount, e.t.c.)
33+
* /index/id
34+
* /lore/search
35+
* /market/item/id?servers=Phoenix,Odin
36+
* /market/item/id?dc=Chaos
37+
* /lodestone
38+
* /lodestone/news
39+
* /lodestone/notices
40+
* /lodestone/maintenance
41+
* /lodestone/updates
42+
* /lodestone/status
43+
* /lodestone/worldstatus
44+
* /lodestone/devblog
45+
* /lodestone/devposts
46+
* /lodestone/deepdungeon
47+
* /lodestone/feasts
4848

4949
## Documentation
5050
https://xivapi.com/docs/

xivapi/client.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import asyncio
21
import logging
32
from typing import List
43

5-
import aiohttp
6-
7-
from .exceptions import XIVAPIBadRequest, XIVAPIForbidden, XIVAPINotFound, XIVAPIServiceUnavailable, XIVAPIInvalidLanguage, XIVAPIError, XIVAPIInvalidIndex, XIVAPIInvalidColumns, XIVAPIInvalidWorlds, XIVAPIInvalidDatacenter
4+
from .exceptions import XIVAPIBadRequest, XIVAPIForbidden, XIVAPINotFound, XIVAPIServiceUnavailable, XIVAPIInvalidLanguage, XIVAPIError, XIVAPIInvalidIndex, XIVAPIInvalidColumns, XIVAPIInvalidWorlds
85
from .decorators import timed
96
from .models import Filter, Sort
107

@@ -242,7 +239,7 @@ async def pvpteam_by_id(self, lodestone_id):
242239

243240

244241
@timed
245-
async def index_search(self, name, indexes=[], columns=[], filters: List[Filter]=list(), sort: Sort=None, page=1, language="en"):
242+
async def index_search(self, name, indexes=(), columns=(), filters: List[Filter]=(), sort: Sort=None, page=1, language="en"):
246243
"""|coro|
247244
Search for data from on specific indexes.
248245
Parameters
@@ -339,7 +336,7 @@ async def index_search(self, name, indexes=[], columns=[], filters: List[Filter]
339336
})
340337

341338
body["body"]["query"]["bool"]["filter"] = filts
342-
339+
343340
if sort:
344341
body["body"]["sort"] = [{
345342
sort.Field: "asc" if sort.Ascending else "desc"
@@ -351,7 +348,7 @@ async def index_search(self, name, indexes=[], columns=[], filters: List[Filter]
351348

352349

353350
@timed
354-
async def index_by_id(self, index, content_id: int, columns=[], language="en"):
351+
async def index_by_id(self, index, content_id: int, columns=(), language="en"):
355352
"""|coro|
356353
Request data from a given index by ID.
357354
Parameters

xivapi/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .exceptions import XIVAPIInvalidFilter
22

3-
class Filter:
3+
class Filter:
44
"""
55
Model class for DQL filters
66
"""
@@ -18,7 +18,7 @@ def __init__(self, field: str, comparison: str, value: int):
1818
self.Value = value
1919

2020

21-
class Sort:
21+
class Sort:
2222
"""
2323
Model class for sort field
2424
"""

0 commit comments

Comments
 (0)