pystartgg 0.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pystartgg-0.0.7.dist-info/METADATA +16 -0
- pystartgg-0.0.7.dist-info/RECORD +4 -0
- pystartgg-0.0.7.dist-info/WHEEL +4 -0
- pystartgg.py +50 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: pystartgg
|
|
3
|
+
Version: 0.0.7
|
|
4
|
+
Summary: Python wrapper for startgg API calls.
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Steven
|
|
7
|
+
Author-email: shepsteven42@gmail.com
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
Wrapper for start.gg API calls.
|
|
16
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
pystartgg.py,sha256=RlIhKV9mMapQI1vygbymUTtB5EILtGb8L10vwNpySXc,1546
|
|
2
|
+
pystartgg-0.0.7.dist-info/METADATA,sha256=MmwFErfnejcYxVfnmSZjHtXH8jd-aOwdBNuSGPswxBc,464
|
|
3
|
+
pystartgg-0.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
4
|
+
pystartgg-0.0.7.dist-info/RECORD,,
|
pystartgg.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import tournaments, players, events
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class StartGG(object):
|
|
5
|
+
def __init__(self, key, auto_retry=5):
|
|
6
|
+
self.key = key
|
|
7
|
+
self.header = {"Authorization": "Bearer " + key}
|
|
8
|
+
self.auto_retry = auto_retry
|
|
9
|
+
|
|
10
|
+
def set_key_and_header(self, new_key):
|
|
11
|
+
self.key = new_key
|
|
12
|
+
self.header = {"Authorization": "Bearer " + new_key}
|
|
13
|
+
|
|
14
|
+
# Sets automatic retry, a variable that says if run_query retries if too many requests
|
|
15
|
+
def set_auto_retry(self, t):
|
|
16
|
+
self.auto_retry = t
|
|
17
|
+
|
|
18
|
+
def print_key(self):
|
|
19
|
+
print(self.key)
|
|
20
|
+
|
|
21
|
+
def print_header(self):
|
|
22
|
+
print(self.header)
|
|
23
|
+
|
|
24
|
+
def print_auto_retry(self):
|
|
25
|
+
print(self.header)
|
|
26
|
+
|
|
27
|
+
@property
|
|
28
|
+
def tournament(self):
|
|
29
|
+
return tournaments.Tournament(self.key, self.header, self.auto_retry)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def player(self):
|
|
33
|
+
return players.Player(self.key, self.header, self.auto_retry)
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def event(self):
|
|
37
|
+
return events.Event(self.key, self.header, self.auto_retry)
|
|
38
|
+
|
|
39
|
+
# TODO: implement bracket. Could be relevant for majors with multiple waves
|
|
40
|
+
# or with unique formats (think Socal Star League). However, all the
|
|
41
|
+
# available endpoints appear to be covered by event and tournament for
|
|
42
|
+
# the purposes of this app.
|
|
43
|
+
# @property
|
|
44
|
+
# def bracket(self):
|
|
45
|
+
# return brackets.Bracket(self.key, self.header, self.auto_retry)
|
|
46
|
+
|
|
47
|
+
# TODO: implement league. Not a priority
|
|
48
|
+
# @property
|
|
49
|
+
# def league(self):
|
|
50
|
+
# return leagues.League(self.key, self.header, self.auto_retry)
|