numerapi 2.23.0.dev3__py3-none-any.whl → 2.23.2__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.
- numerapi/__init__.py +2 -2
- numerapi/base_api.py +2 -9
- numerapi/utils.py +4 -2
- {numerapi-2.23.0.dev3.dist-info → numerapi-2.23.2.dist-info}/METADATA +1 -1
- numerapi-2.23.2.dist-info/RECORD +14 -0
- numerapi-2.23.0.dev3.dist-info/RECORD +0 -14
- {numerapi-2.23.0.dev3.dist-info → numerapi-2.23.2.dist-info}/WHEEL +0 -0
- {numerapi-2.23.0.dev3.dist-info → numerapi-2.23.2.dist-info}/entry_points.txt +0 -0
- {numerapi-2.23.0.dev3.dist-info → numerapi-2.23.2.dist-info}/licenses/LICENSE +0 -0
- {numerapi-2.23.0.dev3.dist-info → numerapi-2.23.2.dist-info}/top_level.txt +0 -0
numerapi/__init__.py
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
from importlib.metadata import version, PackageNotFoundError
|
|
4
4
|
|
|
5
5
|
try:
|
|
6
|
-
__version__ = version("
|
|
6
|
+
__version__ = version("numerapi")
|
|
7
7
|
except PackageNotFoundError:
|
|
8
|
-
__version__ =
|
|
8
|
+
__version__ = "unknown"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
# pylint: disable=wrong-import-position
|
numerapi/base_api.py
CHANGED
|
@@ -14,7 +14,6 @@ import requests
|
|
|
14
14
|
from numerapi import utils
|
|
15
15
|
|
|
16
16
|
API_TOURNAMENT_URL = "https://api-tournament.numer.ai"
|
|
17
|
-
_DEFAULT_TOURNAMENT = object()
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
class Api:
|
|
@@ -623,7 +622,6 @@ class Api:
|
|
|
623
622
|
|
|
624
623
|
def list_rounds(
|
|
625
624
|
self,
|
|
626
|
-
tournament: int | None | object = _DEFAULT_TOURNAMENT,
|
|
627
625
|
number: int | None = None,
|
|
628
626
|
target: str | None = None,
|
|
629
627
|
status: str | None = None,
|
|
@@ -632,8 +630,6 @@ class Api:
|
|
|
632
630
|
"""List rounds with the filters supported by the round resolver.
|
|
633
631
|
|
|
634
632
|
Args:
|
|
635
|
-
tournament (int, optional): tournament filter, defaults to the API
|
|
636
|
-
instance tournament. Pass `None` to omit the tournament filter
|
|
637
633
|
number (int, optional): round number filter
|
|
638
634
|
target (str, optional): round target filter
|
|
639
635
|
status (str, optional): round status filter. One of `upcoming`,
|
|
@@ -677,10 +673,8 @@ class Api:
|
|
|
677
673
|
}
|
|
678
674
|
}
|
|
679
675
|
"""
|
|
680
|
-
if tournament is _DEFAULT_TOURNAMENT:
|
|
681
|
-
tournament = self.tournament_id if self.tournament_id else None
|
|
682
676
|
arguments = {
|
|
683
|
-
"tournament":
|
|
677
|
+
"tournament": self.tournament_id,
|
|
684
678
|
"number": number,
|
|
685
679
|
"target": target,
|
|
686
680
|
"status": None if status is None else status.upper(),
|
|
@@ -1133,7 +1127,6 @@ class Api:
|
|
|
1133
1127
|
version: str | None = None,
|
|
1134
1128
|
day: int | None = None,
|
|
1135
1129
|
resolved: bool | None = None,
|
|
1136
|
-
tournament: int | None = None,
|
|
1137
1130
|
last_n_rounds: int | None = None,
|
|
1138
1131
|
distinct_on_round: bool | None = None,
|
|
1139
1132
|
) -> List[Dict]:
|
|
@@ -1195,7 +1188,7 @@ class Api:
|
|
|
1195
1188
|
"version": version,
|
|
1196
1189
|
"day": day,
|
|
1197
1190
|
"resolved": resolved,
|
|
1198
|
-
"tournament": self.tournament_id
|
|
1191
|
+
"tournament": self.tournament_id,
|
|
1199
1192
|
"lastNRounds": last_n_rounds,
|
|
1200
1193
|
"distinctOnRound": distinct_on_round,
|
|
1201
1194
|
}
|
numerapi/utils.py
CHANGED
|
@@ -14,6 +14,8 @@ import tqdm
|
|
|
14
14
|
|
|
15
15
|
logger = logging.getLogger(__name__)
|
|
16
16
|
|
|
17
|
+
DOWNLOAD_CHUNK_SIZE = 1024 * 1024 # 1 MiB
|
|
18
|
+
|
|
17
19
|
|
|
18
20
|
def load_secrets() -> tuple:
|
|
19
21
|
"""load secrets from environment variables or dotenv file"""
|
|
@@ -96,9 +98,9 @@ def download_file(url: str, dest_path: str, show_progress_bars: bool = True):
|
|
|
96
98
|
# Update progress bar to reflect how much of the file is already downloaded
|
|
97
99
|
pbar.update(file_size)
|
|
98
100
|
with open(temp_path, "ab") as dest_file:
|
|
99
|
-
for chunk in req.iter_content(
|
|
101
|
+
for chunk in req.iter_content(DOWNLOAD_CHUNK_SIZE):
|
|
100
102
|
dest_file.write(chunk)
|
|
101
|
-
pbar.update(
|
|
103
|
+
pbar.update(len(chunk))
|
|
102
104
|
# move temp file to target destination
|
|
103
105
|
os.replace(temp_path, dest_path)
|
|
104
106
|
return dest_path
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
numerapi/__init__.py,sha256=15Ba_Ma1HCBVmSpTBbI-tjNGbfJUo2jagm5r7o2amT8,445
|
|
2
|
+
numerapi/base_api.py,sha256=StASiaw3rX6RzV4uAkM3QEsPxF24LupwWgmKde9IIJ4,73357
|
|
3
|
+
numerapi/cli.py,sha256=oaATypyxS0mlW2Uouby6Srq0DxWkouBg63uiXJY-QHM,8206
|
|
4
|
+
numerapi/cryptoapi.py,sha256=J9fAEhiaEfpvRCiDsSJz8rlazKD-4nkJRJ85f09jGp0,1502
|
|
5
|
+
numerapi/numerapi.py,sha256=cyTpNGRKr4BqK2jKA2Rj540tjyykpV3axz-6jLm1Flo,12323
|
|
6
|
+
numerapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
numerapi/signalsapi.py,sha256=inKwMvuIWNGcDFzzdhqRO1RIms_qz1d7lkwA2dzvAoQ,10188
|
|
8
|
+
numerapi/utils.py,sha256=lzYzWhaYRjXZS0OPoU3dJl5n-fOMymOuNJUtWfe-n34,4753
|
|
9
|
+
numerapi-2.23.2.dist-info/licenses/LICENSE,sha256=BnOIJOdxTIxmbNPf_ZmCXqepXDTRWad1nQf9eYk-eSg,1056
|
|
10
|
+
numerapi-2.23.2.dist-info/METADATA,sha256=f9moaALlP6xk-JB6ShGyjeE-gi5yeDt7gD8FQfNJV0Y,7036
|
|
11
|
+
numerapi-2.23.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
12
|
+
numerapi-2.23.2.dist-info/entry_points.txt,sha256=P7RHLytfftNPE14vRxml52-UEkyuAviRegWTID4a_ig,46
|
|
13
|
+
numerapi-2.23.2.dist-info/top_level.txt,sha256=7f4lKNQqRDEGaDXGIqRQCx-rU5pNl6ZgbXz864F1uXY,9
|
|
14
|
+
numerapi-2.23.2.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
numerapi/__init__.py,sha256=okDA4NGjUj1Q8bDJg4T1t0LTf_S3GPbXCdw8gla7_VU,449
|
|
2
|
-
numerapi/base_api.py,sha256=lAz19NA9WCF5VSo2V3IJXgqoLmXGXV9_rXzsGQTA1Qg,73800
|
|
3
|
-
numerapi/cli.py,sha256=oaATypyxS0mlW2Uouby6Srq0DxWkouBg63uiXJY-QHM,8206
|
|
4
|
-
numerapi/cryptoapi.py,sha256=J9fAEhiaEfpvRCiDsSJz8rlazKD-4nkJRJ85f09jGp0,1502
|
|
5
|
-
numerapi/numerapi.py,sha256=cyTpNGRKr4BqK2jKA2Rj540tjyykpV3axz-6jLm1Flo,12323
|
|
6
|
-
numerapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
numerapi/signalsapi.py,sha256=inKwMvuIWNGcDFzzdhqRO1RIms_qz1d7lkwA2dzvAoQ,10188
|
|
8
|
-
numerapi/utils.py,sha256=YgXujHyE1TLTf5v1pspcVAX89SQI3Zl3vMcbNlHZJDs,4688
|
|
9
|
-
numerapi-2.23.0.dev3.dist-info/licenses/LICENSE,sha256=BnOIJOdxTIxmbNPf_ZmCXqepXDTRWad1nQf9eYk-eSg,1056
|
|
10
|
-
numerapi-2.23.0.dev3.dist-info/METADATA,sha256=FYh6HA-M0CsNHqwOQaQZzEOGQy1mMGCmBJgv4F6w1ng,7041
|
|
11
|
-
numerapi-2.23.0.dev3.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
12
|
-
numerapi-2.23.0.dev3.dist-info/entry_points.txt,sha256=P7RHLytfftNPE14vRxml52-UEkyuAviRegWTID4a_ig,46
|
|
13
|
-
numerapi-2.23.0.dev3.dist-info/top_level.txt,sha256=7f4lKNQqRDEGaDXGIqRQCx-rU5pNl6ZgbXz864F1uXY,9
|
|
14
|
-
numerapi-2.23.0.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|