|
| 1 | +""" |
| 2 | +Data type wrappers for data from LPDB queries. |
| 3 | +""" |
| 4 | + |
1 | 5 | import json |
2 | 6 |
|
3 | 7 | from datetime import date, datetime, timedelta, timezone, UTC |
@@ -119,6 +123,10 @@ def wiki(self) -> str: |
119 | 123 |
|
120 | 124 |
|
121 | 125 | class Broadcasters(LpdbBaseResponseData): |
| 126 | + """ |
| 127 | + Broadcaster data from LPDB. |
| 128 | + """ |
| 129 | + |
122 | 130 | @property |
123 | 131 | def id(self) -> str: |
124 | 132 | return self._rawGet("id") |
@@ -157,6 +165,10 @@ def parent(self) -> str: |
157 | 165 |
|
158 | 166 |
|
159 | 167 | class Company(LpdbBaseResponseData): |
| 168 | + """ |
| 169 | + Company data from LPDB. |
| 170 | + """ |
| 171 | + |
160 | 172 | @property |
161 | 173 | def name(self) -> str: |
162 | 174 | return self._rawGet("name") |
@@ -211,6 +223,10 @@ def links(self) -> dict[str, Any]: |
211 | 223 |
|
212 | 224 |
|
213 | 225 | class Datapoint(LpdbBaseResponseData): |
| 226 | + """ |
| 227 | + Generic datapoint from LPDB. |
| 228 | + """ |
| 229 | + |
214 | 230 | @property |
215 | 231 | def type(self) -> str: |
216 | 232 | return self._rawGet("type") |
@@ -241,6 +257,10 @@ def date(self) -> Optional[datetime]: |
241 | 257 |
|
242 | 258 |
|
243 | 259 | class ExternalMediaLink(LpdbBaseResponseData): |
| 260 | + """ |
| 261 | + External media link from LPDB. |
| 262 | + """ |
| 263 | + |
244 | 264 | @property |
245 | 265 | def title(self) -> str: |
246 | 266 | return self._rawGet("title") |
@@ -275,6 +295,10 @@ def type(self) -> str: |
275 | 295 |
|
276 | 296 |
|
277 | 297 | class Match(LpdbBaseResponseData): |
| 298 | + """ |
| 299 | + Match data from LPDB. |
| 300 | + """ |
| 301 | + |
278 | 302 | @property |
279 | 303 | def match2id(self) -> str: |
280 | 304 | return self._rawGet("match2id") |
@@ -348,6 +372,8 @@ def dateexact(self) -> bool: |
348 | 372 | def timezone(self) -> Optional[timezone]: |
349 | 373 | """ |
350 | 374 | Timezone information stored in this match. |
| 375 | +
|
| 376 | + The `timezone` property from this property does not support IANA time zones. |
351 | 377 | """ |
352 | 378 | if not self.dateexact: |
353 | 379 | return None |
@@ -437,6 +463,10 @@ def match2opponents(self) -> list["MatchOpponent"]: |
437 | 463 |
|
438 | 464 |
|
439 | 465 | class MatchGame(LpdbBaseData): |
| 466 | + """ |
| 467 | + Game data stored in a match. |
| 468 | + """ |
| 469 | + |
440 | 470 | _parent: "Match" |
441 | 471 |
|
442 | 472 | def __init__(self, parent: "Match", raw: dict[str, Any]): |
@@ -520,6 +550,10 @@ def extradata(self) -> Optional[dict[str, Any]]: |
520 | 550 |
|
521 | 551 |
|
522 | 552 | class MatchOpponent(LpdbBaseData): |
| 553 | + """ |
| 554 | + Opponent data stored in a match. |
| 555 | + """ |
| 556 | + |
523 | 557 | @property |
524 | 558 | def id(self) -> int: |
525 | 559 | return self._rawGet("id") |
@@ -568,6 +602,10 @@ def extradata(self) -> Optional[dict[str, Any]]: |
568 | 602 |
|
569 | 603 |
|
570 | 604 | class Placement(LpdbBaseResponseData): |
| 605 | + """ |
| 606 | + Placement data from LPDB. |
| 607 | + """ |
| 608 | + |
571 | 609 | @property |
572 | 610 | def tournament(self) -> str: |
573 | 611 | return self._rawGet("tournament") |
@@ -678,6 +716,10 @@ def qualifierurl(self) -> str: |
678 | 716 |
|
679 | 717 |
|
680 | 718 | class Player(LpdbBaseResponseData): |
| 719 | + """ |
| 720 | + Player data from LPDB. |
| 721 | + """ |
| 722 | + |
681 | 723 | @property |
682 | 724 | def id(self) -> str: |
683 | 725 | return self._rawGet("id") |
@@ -748,6 +790,10 @@ def earningsbyyear(self) -> dict[str, Number]: |
748 | 790 |
|
749 | 791 |
|
750 | 792 | class Series(LpdbBaseResponseData): |
| 793 | + """ |
| 794 | + Tournament series data from LPDB. |
| 795 | + """ |
| 796 | + |
751 | 797 | @property |
752 | 798 | def name(self) -> str: |
753 | 799 | return self._rawGet("name") |
@@ -838,6 +884,10 @@ def links(self) -> dict: |
838 | 884 |
|
839 | 885 |
|
840 | 886 | class SquadPlayer(LpdbBaseResponseData): |
| 887 | + """ |
| 888 | + Squad player data from LPDB. |
| 889 | + """ |
| 890 | + |
841 | 891 | @property |
842 | 892 | def id(self) -> str: |
843 | 893 | return self._rawGet("id") |
@@ -908,6 +958,10 @@ def inactivedateref(self) -> dict: |
908 | 958 |
|
909 | 959 |
|
910 | 960 | class StandingsEntry(LpdbBaseResponseData): |
| 961 | + """ |
| 962 | + Standings entry from LPDB. |
| 963 | + """ |
| 964 | + |
911 | 965 | @property |
912 | 966 | def parent(self) -> str: |
913 | 967 | return self._rawGet("parent") |
@@ -962,6 +1016,10 @@ def slotindex(self) -> dict: |
962 | 1016 |
|
963 | 1017 |
|
964 | 1018 | class StandingsTable(LpdbBaseResponseData): |
| 1019 | + """ |
| 1020 | + Standings table from LPDB. |
| 1021 | + """ |
| 1022 | + |
965 | 1023 | @property |
966 | 1024 | def parent(self) -> str: |
967 | 1025 | return self._rawGet("parent") |
@@ -996,6 +1054,10 @@ def config(self) -> dict: |
996 | 1054 |
|
997 | 1055 |
|
998 | 1056 | class Team(LpdbBaseResponseData): |
| 1057 | + """ |
| 1058 | + Team data from LPDB. |
| 1059 | + """ |
| 1060 | + |
999 | 1061 | @property |
1000 | 1062 | def name(self) -> str: |
1001 | 1063 | return self._rawGet("name") |
@@ -1062,6 +1124,10 @@ def links(self) -> dict: |
1062 | 1124 |
|
1063 | 1125 |
|
1064 | 1126 | class Tournament(LpdbBaseResponseData): |
| 1127 | + """ |
| 1128 | + Tournament data from LPDB. |
| 1129 | + """ |
| 1130 | + |
1065 | 1131 | @property |
1066 | 1132 | def name(self) -> str: |
1067 | 1133 | return self._rawGet("name") |
@@ -1211,6 +1277,10 @@ def sponsors(self) -> dict: |
1211 | 1277 |
|
1212 | 1278 |
|
1213 | 1279 | class Transfer(LpdbBaseResponseData): |
| 1280 | + """ |
| 1281 | + Transfer data from LPDB. |
| 1282 | + """ |
| 1283 | + |
1214 | 1284 | @property |
1215 | 1285 | def player(self) -> str: |
1216 | 1286 | return self._rawGet("player") |
@@ -1257,6 +1327,10 @@ def wholeteam(self) -> bool: |
1257 | 1327 |
|
1258 | 1328 |
|
1259 | 1329 | class TeamTemplate(LpdbBaseData): |
| 1330 | + """ |
| 1331 | + Team template from LPDB. |
| 1332 | + """ |
| 1333 | + |
1260 | 1334 | @property |
1261 | 1335 | def template(self) -> str: |
1262 | 1336 | return self._rawGet("template") |
|
0 commit comments