Skip to content

Commit 6d2bc33

Browse files
committed
readme: LPDB data types
1 parent 0122e36 commit 6d2bc33

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
LPDB-python provides Python interfaces for the [Liquipedia Database API](https://liquipedia.net/api) (LPDB API).
44

5+
## LPDB Data Types
6+
7+
Data types in LPDB can be found in <https://liquipedia.net/commons/Help:LiquipediaDB>.
8+
9+
The raw data returned from LPDB may not be in the corresponding Python types. To help easily access the data,
10+
[defs.py](src/lpdb/defs.py) file provides wrappers for each available data types that offers converted data
11+
as object properties.
12+
13+
A property provided by the wrapper may be `None` if the raw data passed to the constructor of the wrapper
14+
did not contain the data, or if it contained an empty string. Thus, the user should be checking for `None`
15+
where appropriate.
16+
17+
### Example
18+
19+
```python
20+
import lpdb
21+
22+
session = lpdb.LpdbSession("your_lpdb_api_key")
23+
24+
matches = [
25+
lpdb.Match(lpdb_raw_match)
26+
for lpdb_raw_match in session.make_request(
27+
"match",
28+
"leagueoflegends",
29+
conditions="[[parent::World_Championship/2025]]",
30+
streamurls="true",
31+
)
32+
]
33+
```
34+
535
## License
636

737
This library is licensed under the [MIT License](./LICENSE), unless otherwise stated in the header of a file.

0 commit comments

Comments
 (0)