numerapi 2.23.0.dev1__py3-none-any.whl → 2.23.0.dev3__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/base_api.py +80 -1
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/METADATA +1 -1
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/RECORD +7 -7
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/WHEEL +0 -0
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/entry_points.txt +0 -0
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/licenses/LICENSE +0 -0
- {numerapi-2.23.0.dev1.dist-info → numerapi-2.23.0.dev3.dist-info}/top_level.txt +0 -0
numerapi/base_api.py
CHANGED
|
@@ -14,6 +14,7 @@ import requests
|
|
|
14
14
|
from numerapi import utils
|
|
15
15
|
|
|
16
16
|
API_TOURNAMENT_URL = "https://api-tournament.numer.ai"
|
|
17
|
+
_DEFAULT_TOURNAMENT = object()
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class Api:
|
|
@@ -427,7 +428,7 @@ class Api:
|
|
|
427
428
|
|
|
428
429
|
max_amount = max_amount if max_amount is not None else amount
|
|
429
430
|
query = """
|
|
430
|
-
|
|
431
|
+
query($submissionId: ID!, $staker: String!, $maxAmount: String!) {
|
|
431
432
|
v3StakeAuth(
|
|
432
433
|
submissionId: $submissionId
|
|
433
434
|
staker: $staker
|
|
@@ -620,6 +621,84 @@ class Api:
|
|
|
620
621
|
round_num = data["number"]
|
|
621
622
|
return round_num
|
|
622
623
|
|
|
624
|
+
def list_rounds(
|
|
625
|
+
self,
|
|
626
|
+
tournament: int | None | object = _DEFAULT_TOURNAMENT,
|
|
627
|
+
number: int | None = None,
|
|
628
|
+
target: str | None = None,
|
|
629
|
+
status: str | None = None,
|
|
630
|
+
limit: int | None = None,
|
|
631
|
+
) -> List[Dict]:
|
|
632
|
+
"""List rounds with the filters supported by the round resolver.
|
|
633
|
+
|
|
634
|
+
Args:
|
|
635
|
+
tournament (int, optional): tournament filter, defaults to the API
|
|
636
|
+
instance tournament. Pass `None` to omit the tournament filter
|
|
637
|
+
number (int, optional): round number filter
|
|
638
|
+
target (str, optional): round target filter
|
|
639
|
+
status (str, optional): round status filter. One of `upcoming`,
|
|
640
|
+
`open`, `resolving`, or `resolved`
|
|
641
|
+
limit (int, optional): maximum number of rounds to return
|
|
642
|
+
|
|
643
|
+
Returns:
|
|
644
|
+
list of dicts: round entries matching the provided filters
|
|
645
|
+
"""
|
|
646
|
+
query = """
|
|
647
|
+
query($tournament: Int
|
|
648
|
+
$number: Int
|
|
649
|
+
$target: String
|
|
650
|
+
$status: RoundStatus
|
|
651
|
+
$limit: Int) {
|
|
652
|
+
rounds(tournament: $tournament
|
|
653
|
+
number: $number
|
|
654
|
+
target: $target
|
|
655
|
+
status: $status
|
|
656
|
+
limit: $limit) {
|
|
657
|
+
id
|
|
658
|
+
tournament
|
|
659
|
+
number
|
|
660
|
+
target
|
|
661
|
+
closeTime
|
|
662
|
+
closeStakingTime
|
|
663
|
+
openTime
|
|
664
|
+
scoreTime
|
|
665
|
+
resolveTime
|
|
666
|
+
resolvedGeneral
|
|
667
|
+
resolvedStaking
|
|
668
|
+
payoutFactor
|
|
669
|
+
stakeThreshold
|
|
670
|
+
minCorrMultiplier
|
|
671
|
+
maxCorrMultiplier
|
|
672
|
+
defaultCorrMultiplier
|
|
673
|
+
minMmcMultiplier
|
|
674
|
+
maxMmcMultiplier
|
|
675
|
+
defaultMmcMultiplier
|
|
676
|
+
dataDatestamp
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
"""
|
|
680
|
+
if tournament is _DEFAULT_TOURNAMENT:
|
|
681
|
+
tournament = self.tournament_id if self.tournament_id else None
|
|
682
|
+
arguments = {
|
|
683
|
+
"tournament": tournament,
|
|
684
|
+
"number": number,
|
|
685
|
+
"target": target,
|
|
686
|
+
"status": None if status is None else status.upper(),
|
|
687
|
+
"limit": limit,
|
|
688
|
+
}
|
|
689
|
+
rounds = self.raw_query(query, arguments)["data"]["rounds"]
|
|
690
|
+
for round_info in rounds:
|
|
691
|
+
for field in [
|
|
692
|
+
"closeTime",
|
|
693
|
+
"closeStakingTime",
|
|
694
|
+
"openTime",
|
|
695
|
+
"scoreTime",
|
|
696
|
+
"resolveTime",
|
|
697
|
+
]:
|
|
698
|
+
utils.replace(round_info, field, utils.parse_datetime_string)
|
|
699
|
+
utils.replace(round_info, "payoutFactor", utils.parse_float_string)
|
|
700
|
+
return rounds
|
|
701
|
+
|
|
623
702
|
def set_bio(self, model_id: str, bio: str) -> bool:
|
|
624
703
|
"""Set bio field for a model id.
|
|
625
704
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
numerapi/__init__.py,sha256=okDA4NGjUj1Q8bDJg4T1t0LTf_S3GPbXCdw8gla7_VU,449
|
|
2
|
-
numerapi/base_api.py,sha256=
|
|
2
|
+
numerapi/base_api.py,sha256=lAz19NA9WCF5VSo2V3IJXgqoLmXGXV9_rXzsGQTA1Qg,73800
|
|
3
3
|
numerapi/cli.py,sha256=oaATypyxS0mlW2Uouby6Srq0DxWkouBg63uiXJY-QHM,8206
|
|
4
4
|
numerapi/cryptoapi.py,sha256=J9fAEhiaEfpvRCiDsSJz8rlazKD-4nkJRJ85f09jGp0,1502
|
|
5
5
|
numerapi/numerapi.py,sha256=cyTpNGRKr4BqK2jKA2Rj540tjyykpV3axz-6jLm1Flo,12323
|
|
6
6
|
numerapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
numerapi/signalsapi.py,sha256=inKwMvuIWNGcDFzzdhqRO1RIms_qz1d7lkwA2dzvAoQ,10188
|
|
8
8
|
numerapi/utils.py,sha256=YgXujHyE1TLTf5v1pspcVAX89SQI3Zl3vMcbNlHZJDs,4688
|
|
9
|
-
numerapi-2.23.0.
|
|
10
|
-
numerapi-2.23.0.
|
|
11
|
-
numerapi-2.23.0.
|
|
12
|
-
numerapi-2.23.0.
|
|
13
|
-
numerapi-2.23.0.
|
|
14
|
-
numerapi-2.23.0.
|
|
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
|