numerapi 2.19.0__tar.gz → 2.19.1__tar.gz

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.
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.1
2
+ Name: numerapi
3
+ Version: 2.19.1
4
+ Summary: Automatically download and upload data for the Numerai machine learning competition
5
+ Home-page: https://github.com/uuazed/numerapi
6
+ Maintainer: uuazed
7
+ Maintainer-email: uuazed@gmail.com
8
+ License: MIT License
9
+ Platform: OS Independent
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+
21
+ [![Build Status](https://app.travis-ci.com/uuazed/numerapi.svg)](https://app.travis-ci.com/uuazed/numerapi)
22
+ [![codecov](https://codecov.io/gh/uuazed/numerapi/branch/master/graph/badge.svg)](https://codecov.io/gh/uuazed/numerapi)
23
+ [![PyPI](https://img.shields.io/pypi/v/numerapi.svg)](https://pypi.python.org/pypi/numerapi)
24
+ [![Downloads](https://pepy.tech/badge/numerapi/month)](https://pepy.tech/project/numerapi)
25
+ [![Docs](https://readthedocs.org/projects/numerapi/badge/?version=stable)](http://numerapi.readthedocs.io/en/stable/?badge=stable)
26
+
27
+ # Numerai Python API
28
+ Automatically download and upload data for the Numerai machine learning
29
+ competition.
30
+
31
+ This library is a Python client to the Numerai API. The interface is programmed
32
+ in Python and allows downloading the training data, uploading predictions, and
33
+ accessing user, submission and competitions information. It works for both, the
34
+ main competition and the newer Numerai Signals competition.
35
+
36
+ If you encounter a problem or have suggestions, feel free to open an issue.
37
+
38
+ # Installation
39
+ `pip install --upgrade numerapi`
40
+
41
+ # Usage
42
+
43
+ Numerapi can be used as a regular, importable Python module or from the command
44
+ line.
45
+
46
+ Some actions (like uploading predictions or staking) require a token to verify
47
+ that it is really you interacting with Numerai's API. These tokens consists of
48
+ a `public_id` and `secret_key`. Both can be obtained by login in to Numer.ai and
49
+ going to Account -> Custom API Keys. Tokens can be passed to the Python module
50
+ as parameters or you can be set via environment variables (`NUMERAI_PUBLIC_ID`
51
+ and `NUMERAI_SECRET_KEY`).
52
+
53
+ ## Python module
54
+
55
+ ### Usage example - main competition
56
+
57
+ import numerapi
58
+ # some API calls do not require logging in
59
+ napi = numerapi.NumerAPI(verbosity="info")
60
+ # download current dataset => also check `https://numer.ai/data`
61
+ napi.download_dataset("v4/train.parquet", "train.parquet")
62
+ # get current leaderboard
63
+ leaderboard = napi.get_leaderboard()
64
+ # check if a new round has started
65
+ if napi.check_new_round():
66
+ print("new round has started within the last 12hours!")
67
+ else:
68
+ print("no new round within the last 12 hours")
69
+
70
+ # provide api tokens
71
+ example_public_id = "somepublicid"
72
+ example_secret_key = "somesecretkey"
73
+ napi = numerapi.NumerAPI(example_public_id, example_secret_key)
74
+
75
+ # upload predictions
76
+ model_id = napi.get_models()['uuazed']
77
+ napi.upload_predictions("preds.csv", model_id=model_id)
78
+ # increase your stake by 1.2 NMR
79
+ napi.stake_increase(1.2)
80
+
81
+ # convert results to a pandas dataframe
82
+ import pandas as pd
83
+ df = pd.DataFrame(napi.daily_user_performances("uuazed"))
84
+
85
+
86
+ ### Usage example - Numerai Signals
87
+
88
+ import numerapi
89
+
90
+ napi = numerapi.SignalsAPI()
91
+ # get current leaderboard
92
+ leaderboard = napi.get_leaderboard()
93
+
94
+ # setup API with api tokens
95
+ example_public_id = "somepublicid"
96
+ example_secret_key = "somesecretkey"
97
+ napi = numerapi.SignalsAPI(example_public_id, example_secret_key)
98
+
99
+ # upload predictions
100
+ model_id = napi.get_models()['uuazed']
101
+ napi.upload_predictions("preds.csv", model_id=model_id)
102
+
103
+ # get daily performance as pandas dataframe
104
+ import pandas as pd
105
+ df = pd.DataFrame(napi.daily_user_performances("uuazed"))
106
+
107
+ # using the diagnostics tool
108
+ napi.upload_diagnostics("preds.csv", model_id=model_id)
109
+ # ... or using a pandas DataFrame directly
110
+ napi.upload_diagnostics(df=df, model_id=model_id)
111
+ # fetch results
112
+ napi.diagnostic(model_id)
113
+
114
+
115
+ ## Command line interface
116
+
117
+ To get started with the cli interface, let's take a look at the help page:
118
+
119
+ $ numerapi --help
120
+ Usage: numerapi [OPTIONS] COMMAND [ARGS]...
121
+
122
+ Wrapper around the Numerai API
123
+
124
+ Options:
125
+ --help Show this message and exit.
126
+
127
+ Commands:
128
+ account Get all information about your account!
129
+ check-new-round Check if a new round has started within...
130
+ competitions Retrieves information about all...
131
+ current-round Get number of the current active round.
132
+ daily-model-performances Fetch daily performance of a model.
133
+ daily-submissions-performances Fetch daily performance of a user's...
134
+ dataset-url Fetch url of the current dataset.
135
+ download-dataset Download specified file for the given...
136
+ download-dataset-old Download dataset for the current active...
137
+ leaderboard Get the leaderboard.
138
+ list-datasets List of available data files
139
+ models Get map of account models!
140
+ profile Fetch the public profile of a user.
141
+ stake-decrease Decrease your stake by `value` NMR.
142
+ stake-drain Completely remove your stake.
143
+ stake-get Get stake value of a user.
144
+ stake-increase Increase your stake by `value` NMR.
145
+ submission-filenames Get filenames of your submissions
146
+ submit Upload predictions from file.
147
+ transactions List all your deposits and withdrawals.
148
+ user Get all information about you!...
149
+ version Installed numerapi version.
150
+
151
+
152
+ Each command has it's own help page, for example:
153
+
154
+ $ numerapi submit --help
155
+ Usage: numerapi submit [OPTIONS] PATH
156
+
157
+ Upload predictions from file.
158
+
159
+ Options:
160
+ --tournament INTEGER The ID of the tournament, defaults to 1
161
+ --model_id TEXT An account model UUID (required for accounts with
162
+ multiple models
163
+
164
+ --help Show this message and exit.
165
+
166
+
167
+ # API Reference
168
+
169
+ Checkout the [detailed API docs](http://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
170
+ to learn about all available methods, parameters and returned values.
171
+
172
+
@@ -1120,9 +1120,7 @@ class Api:
1120
1120
  """Completely remove your stake.
1121
1121
 
1122
1122
  Args:
1123
- model_id (str): Target model UUID (required for accounts with
1124
- multiple models)
1125
- tournament (int): ID of the tournament (optional, defaults to 8)
1123
+ model_id (str): Target model UUID
1126
1124
 
1127
1125
  Returns:
1128
1126
  dict: stake information with the following content:
@@ -1131,17 +1129,36 @@ class Api:
1131
1129
  * status (`str`)
1132
1130
  * requestedAmount (`decimal.Decimal`)
1133
1131
  * type (`str`)
1132
+ * drain (`bool`)
1134
1133
 
1135
1134
  Example:
1136
1135
  >>> api = NumerAPI(secret_key="..", public_id="..")
1137
- >>> model = api.get_models()['uuazed']
1138
- >>> api.stake_drain(model)
1136
+ >>> model_id = api.get_models()['uuazed']
1137
+ >>> api.stake_drain(model_id)
1139
1138
  {'dueDate': None,
1140
1139
  'requestedAmount': decimal.Decimal('11000000'),
1141
1140
  'type': 'decrease',
1142
- 'status': ''}
1141
+ 'status': '',
1142
+ 'drain": True}
1143
1143
  """
1144
- return self.stake_decrease(11000000, model_id)
1144
+ query = '''
1145
+ mutation($drain: bool!
1146
+ $amount: String
1147
+ $modelId: String) {
1148
+ releaseStake(drain: $drain
1149
+ modelId: $modelId
1150
+ amount: $amount) {
1151
+ id
1152
+ dueDate
1153
+ status
1154
+ type
1155
+ requestedAmount
1156
+ drain
1157
+ }
1158
+ }'''
1159
+ arguments = {'drain': True, "modelId": model_id, "amount": '11000000'}
1160
+ raw = self.raw_query(query, arguments, authorization=True)
1161
+ return raw['data']['releaseStake']
1145
1162
 
1146
1163
  def stake_decrease(self, nmr, model_id: str = None) -> Dict:
1147
1164
  """Decrease your stake by `value` NMR.
@@ -133,7 +133,7 @@ class SignalsAPI(base_api.Api):
133
133
  mutation($filename: String!
134
134
  $modelId: String
135
135
  $triggerId: String
136
- $ddataDatestamp: Int) {
136
+ $dataDatestamp: Int) {
137
137
  createSignalsSubmission(filename: $filename
138
138
  modelId: $modelId
139
139
  triggerId: $triggerId
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.1
2
+ Name: numerapi
3
+ Version: 2.19.1
4
+ Summary: Automatically download and upload data for the Numerai machine learning competition
5
+ Home-page: https://github.com/uuazed/numerapi
6
+ Maintainer: uuazed
7
+ Maintainer-email: uuazed@gmail.com
8
+ License: MIT License
9
+ Platform: OS Independent
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+
21
+ [![Build Status](https://app.travis-ci.com/uuazed/numerapi.svg)](https://app.travis-ci.com/uuazed/numerapi)
22
+ [![codecov](https://codecov.io/gh/uuazed/numerapi/branch/master/graph/badge.svg)](https://codecov.io/gh/uuazed/numerapi)
23
+ [![PyPI](https://img.shields.io/pypi/v/numerapi.svg)](https://pypi.python.org/pypi/numerapi)
24
+ [![Downloads](https://pepy.tech/badge/numerapi/month)](https://pepy.tech/project/numerapi)
25
+ [![Docs](https://readthedocs.org/projects/numerapi/badge/?version=stable)](http://numerapi.readthedocs.io/en/stable/?badge=stable)
26
+
27
+ # Numerai Python API
28
+ Automatically download and upload data for the Numerai machine learning
29
+ competition.
30
+
31
+ This library is a Python client to the Numerai API. The interface is programmed
32
+ in Python and allows downloading the training data, uploading predictions, and
33
+ accessing user, submission and competitions information. It works for both, the
34
+ main competition and the newer Numerai Signals competition.
35
+
36
+ If you encounter a problem or have suggestions, feel free to open an issue.
37
+
38
+ # Installation
39
+ `pip install --upgrade numerapi`
40
+
41
+ # Usage
42
+
43
+ Numerapi can be used as a regular, importable Python module or from the command
44
+ line.
45
+
46
+ Some actions (like uploading predictions or staking) require a token to verify
47
+ that it is really you interacting with Numerai's API. These tokens consists of
48
+ a `public_id` and `secret_key`. Both can be obtained by login in to Numer.ai and
49
+ going to Account -> Custom API Keys. Tokens can be passed to the Python module
50
+ as parameters or you can be set via environment variables (`NUMERAI_PUBLIC_ID`
51
+ and `NUMERAI_SECRET_KEY`).
52
+
53
+ ## Python module
54
+
55
+ ### Usage example - main competition
56
+
57
+ import numerapi
58
+ # some API calls do not require logging in
59
+ napi = numerapi.NumerAPI(verbosity="info")
60
+ # download current dataset => also check `https://numer.ai/data`
61
+ napi.download_dataset("v4/train.parquet", "train.parquet")
62
+ # get current leaderboard
63
+ leaderboard = napi.get_leaderboard()
64
+ # check if a new round has started
65
+ if napi.check_new_round():
66
+ print("new round has started within the last 12hours!")
67
+ else:
68
+ print("no new round within the last 12 hours")
69
+
70
+ # provide api tokens
71
+ example_public_id = "somepublicid"
72
+ example_secret_key = "somesecretkey"
73
+ napi = numerapi.NumerAPI(example_public_id, example_secret_key)
74
+
75
+ # upload predictions
76
+ model_id = napi.get_models()['uuazed']
77
+ napi.upload_predictions("preds.csv", model_id=model_id)
78
+ # increase your stake by 1.2 NMR
79
+ napi.stake_increase(1.2)
80
+
81
+ # convert results to a pandas dataframe
82
+ import pandas as pd
83
+ df = pd.DataFrame(napi.daily_user_performances("uuazed"))
84
+
85
+
86
+ ### Usage example - Numerai Signals
87
+
88
+ import numerapi
89
+
90
+ napi = numerapi.SignalsAPI()
91
+ # get current leaderboard
92
+ leaderboard = napi.get_leaderboard()
93
+
94
+ # setup API with api tokens
95
+ example_public_id = "somepublicid"
96
+ example_secret_key = "somesecretkey"
97
+ napi = numerapi.SignalsAPI(example_public_id, example_secret_key)
98
+
99
+ # upload predictions
100
+ model_id = napi.get_models()['uuazed']
101
+ napi.upload_predictions("preds.csv", model_id=model_id)
102
+
103
+ # get daily performance as pandas dataframe
104
+ import pandas as pd
105
+ df = pd.DataFrame(napi.daily_user_performances("uuazed"))
106
+
107
+ # using the diagnostics tool
108
+ napi.upload_diagnostics("preds.csv", model_id=model_id)
109
+ # ... or using a pandas DataFrame directly
110
+ napi.upload_diagnostics(df=df, model_id=model_id)
111
+ # fetch results
112
+ napi.diagnostic(model_id)
113
+
114
+
115
+ ## Command line interface
116
+
117
+ To get started with the cli interface, let's take a look at the help page:
118
+
119
+ $ numerapi --help
120
+ Usage: numerapi [OPTIONS] COMMAND [ARGS]...
121
+
122
+ Wrapper around the Numerai API
123
+
124
+ Options:
125
+ --help Show this message and exit.
126
+
127
+ Commands:
128
+ account Get all information about your account!
129
+ check-new-round Check if a new round has started within...
130
+ competitions Retrieves information about all...
131
+ current-round Get number of the current active round.
132
+ daily-model-performances Fetch daily performance of a model.
133
+ daily-submissions-performances Fetch daily performance of a user's...
134
+ dataset-url Fetch url of the current dataset.
135
+ download-dataset Download specified file for the given...
136
+ download-dataset-old Download dataset for the current active...
137
+ leaderboard Get the leaderboard.
138
+ list-datasets List of available data files
139
+ models Get map of account models!
140
+ profile Fetch the public profile of a user.
141
+ stake-decrease Decrease your stake by `value` NMR.
142
+ stake-drain Completely remove your stake.
143
+ stake-get Get stake value of a user.
144
+ stake-increase Increase your stake by `value` NMR.
145
+ submission-filenames Get filenames of your submissions
146
+ submit Upload predictions from file.
147
+ transactions List all your deposits and withdrawals.
148
+ user Get all information about you!...
149
+ version Installed numerapi version.
150
+
151
+
152
+ Each command has it's own help page, for example:
153
+
154
+ $ numerapi submit --help
155
+ Usage: numerapi submit [OPTIONS] PATH
156
+
157
+ Upload predictions from file.
158
+
159
+ Options:
160
+ --tournament INTEGER The ID of the tournament, defaults to 1
161
+ --model_id TEXT An account model UUID (required for accounts with
162
+ multiple models
163
+
164
+ --help Show this message and exit.
165
+
166
+
167
+ # API Reference
168
+
169
+ Checkout the [detailed API docs](http://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
170
+ to learn about all available methods, parameters and returned values.
171
+
172
+
@@ -6,7 +6,7 @@ def load(path):
6
6
  return open(path, 'r').read()
7
7
 
8
8
 
9
- numerapi_version = '2.19.0'
9
+ numerapi_version = '2.19.1'
10
10
 
11
11
 
12
12
  classifiers = [
numerapi-2.19.0/PKG-INFO DELETED
@@ -1,169 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: numerapi
3
- Version: 2.19.0
4
- Summary: Automatically download and upload data for the Numerai machine learning competition
5
- Home-page: https://github.com/uuazed/numerapi
6
- Maintainer: uuazed
7
- Maintainer-email: uuazed@gmail.com
8
- License: MIT License
9
- Description: [![Build Status](https://app.travis-ci.com/uuazed/numerapi.svg)](https://app.travis-ci.com/uuazed/numerapi)
10
- [![codecov](https://codecov.io/gh/uuazed/numerapi/branch/master/graph/badge.svg)](https://codecov.io/gh/uuazed/numerapi)
11
- [![PyPI](https://img.shields.io/pypi/v/numerapi.svg)](https://pypi.python.org/pypi/numerapi)
12
- [![Downloads](https://pepy.tech/badge/numerapi/month)](https://pepy.tech/project/numerapi)
13
- [![Docs](https://readthedocs.org/projects/numerapi/badge/?version=stable)](http://numerapi.readthedocs.io/en/stable/?badge=stable)
14
-
15
- # Numerai Python API
16
- Automatically download and upload data for the Numerai machine learning
17
- competition.
18
-
19
- This library is a Python client to the Numerai API. The interface is programmed
20
- in Python and allows downloading the training data, uploading predictions, and
21
- accessing user, submission and competitions information. It works for both, the
22
- main competition and the newer Numerai Signals competition.
23
-
24
- If you encounter a problem or have suggestions, feel free to open an issue.
25
-
26
- # Installation
27
- `pip install --upgrade numerapi`
28
-
29
- # Usage
30
-
31
- Numerapi can be used as a regular, importable Python module or from the command
32
- line.
33
-
34
- Some actions (like uploading predictions or staking) require a token to verify
35
- that it is really you interacting with Numerai's API. These tokens consists of
36
- a `public_id` and `secret_key`. Both can be obtained by login in to Numer.ai and
37
- going to Account -> Custom API Keys. Tokens can be passed to the Python module
38
- as parameters or you can be set via environment variables (`NUMERAI_PUBLIC_ID`
39
- and `NUMERAI_SECRET_KEY`).
40
-
41
- ## Python module
42
-
43
- ### Usage example - main competition
44
-
45
- import numerapi
46
- # some API calls do not require logging in
47
- napi = numerapi.NumerAPI(verbosity="info")
48
- # download current dataset => also check `https://numer.ai/data`
49
- napi.download_dataset("v4/train.parquet", "train.parquet")
50
- # get current leaderboard
51
- leaderboard = napi.get_leaderboard()
52
- # check if a new round has started
53
- if napi.check_new_round():
54
- print("new round has started within the last 12hours!")
55
- else:
56
- print("no new round within the last 12 hours")
57
-
58
- # provide api tokens
59
- example_public_id = "somepublicid"
60
- example_secret_key = "somesecretkey"
61
- napi = numerapi.NumerAPI(example_public_id, example_secret_key)
62
-
63
- # upload predictions
64
- model_id = napi.get_models()['uuazed']
65
- napi.upload_predictions("preds.csv", model_id=model_id)
66
- # increase your stake by 1.2 NMR
67
- napi.stake_increase(1.2)
68
-
69
- # convert results to a pandas dataframe
70
- import pandas as pd
71
- df = pd.DataFrame(napi.daily_user_performances("uuazed"))
72
-
73
-
74
- ### Usage example - Numerai Signals
75
-
76
- import numerapi
77
-
78
- napi = numerapi.SignalsAPI()
79
- # get current leaderboard
80
- leaderboard = napi.get_leaderboard()
81
-
82
- # setup API with api tokens
83
- example_public_id = "somepublicid"
84
- example_secret_key = "somesecretkey"
85
- napi = numerapi.SignalsAPI(example_public_id, example_secret_key)
86
-
87
- # upload predictions
88
- model_id = napi.get_models()['uuazed']
89
- napi.upload_predictions("preds.csv", model_id=model_id)
90
-
91
- # get daily performance as pandas dataframe
92
- import pandas as pd
93
- df = pd.DataFrame(napi.daily_user_performances("uuazed"))
94
-
95
- # using the diagnostics tool
96
- napi.upload_diagnostics("preds.csv", model_id=model_id)
97
- # ... or using a pandas DataFrame directly
98
- napi.upload_diagnostics(df=df, model_id=model_id)
99
- # fetch results
100
- napi.diagnostic(model_id)
101
-
102
-
103
- ## Command line interface
104
-
105
- To get started with the cli interface, let's take a look at the help page:
106
-
107
- $ numerapi --help
108
- Usage: numerapi [OPTIONS] COMMAND [ARGS]...
109
-
110
- Wrapper around the Numerai API
111
-
112
- Options:
113
- --help Show this message and exit.
114
-
115
- Commands:
116
- account Get all information about your account!
117
- check-new-round Check if a new round has started within...
118
- competitions Retrieves information about all...
119
- current-round Get number of the current active round.
120
- daily-model-performances Fetch daily performance of a model.
121
- daily-submissions-performances Fetch daily performance of a user's...
122
- dataset-url Fetch url of the current dataset.
123
- download-dataset Download specified file for the given...
124
- download-dataset-old Download dataset for the current active...
125
- leaderboard Get the leaderboard.
126
- list-datasets List of available data files
127
- models Get map of account models!
128
- profile Fetch the public profile of a user.
129
- stake-decrease Decrease your stake by `value` NMR.
130
- stake-drain Completely remove your stake.
131
- stake-get Get stake value of a user.
132
- stake-increase Increase your stake by `value` NMR.
133
- submission-filenames Get filenames of your submissions
134
- submit Upload predictions from file.
135
- transactions List all your deposits and withdrawals.
136
- user Get all information about you!...
137
- version Installed numerapi version.
138
-
139
-
140
- Each command has it's own help page, for example:
141
-
142
- $ numerapi submit --help
143
- Usage: numerapi submit [OPTIONS] PATH
144
-
145
- Upload predictions from file.
146
-
147
- Options:
148
- --tournament INTEGER The ID of the tournament, defaults to 1
149
- --model_id TEXT An account model UUID (required for accounts with
150
- multiple models
151
-
152
- --help Show this message and exit.
153
-
154
-
155
- # API Reference
156
-
157
- Checkout the [detailed API docs](http://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
158
- to learn about all available methods, parameters and returned values.
159
-
160
- Platform: OS Independent
161
- Classifier: Development Status :: 5 - Production/Stable
162
- Classifier: Environment :: Console
163
- Classifier: Intended Audience :: Science/Research
164
- Classifier: License :: OSI Approved :: MIT License
165
- Classifier: Operating System :: OS Independent
166
- Classifier: Programming Language :: Python
167
- Classifier: Programming Language :: Python :: 3
168
- Classifier: Topic :: Scientific/Engineering
169
- Description-Content-Type: text/markdown
@@ -1,169 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: numerapi
3
- Version: 2.19.0
4
- Summary: Automatically download and upload data for the Numerai machine learning competition
5
- Home-page: https://github.com/uuazed/numerapi
6
- Maintainer: uuazed
7
- Maintainer-email: uuazed@gmail.com
8
- License: MIT License
9
- Description: [![Build Status](https://app.travis-ci.com/uuazed/numerapi.svg)](https://app.travis-ci.com/uuazed/numerapi)
10
- [![codecov](https://codecov.io/gh/uuazed/numerapi/branch/master/graph/badge.svg)](https://codecov.io/gh/uuazed/numerapi)
11
- [![PyPI](https://img.shields.io/pypi/v/numerapi.svg)](https://pypi.python.org/pypi/numerapi)
12
- [![Downloads](https://pepy.tech/badge/numerapi/month)](https://pepy.tech/project/numerapi)
13
- [![Docs](https://readthedocs.org/projects/numerapi/badge/?version=stable)](http://numerapi.readthedocs.io/en/stable/?badge=stable)
14
-
15
- # Numerai Python API
16
- Automatically download and upload data for the Numerai machine learning
17
- competition.
18
-
19
- This library is a Python client to the Numerai API. The interface is programmed
20
- in Python and allows downloading the training data, uploading predictions, and
21
- accessing user, submission and competitions information. It works for both, the
22
- main competition and the newer Numerai Signals competition.
23
-
24
- If you encounter a problem or have suggestions, feel free to open an issue.
25
-
26
- # Installation
27
- `pip install --upgrade numerapi`
28
-
29
- # Usage
30
-
31
- Numerapi can be used as a regular, importable Python module or from the command
32
- line.
33
-
34
- Some actions (like uploading predictions or staking) require a token to verify
35
- that it is really you interacting with Numerai's API. These tokens consists of
36
- a `public_id` and `secret_key`. Both can be obtained by login in to Numer.ai and
37
- going to Account -> Custom API Keys. Tokens can be passed to the Python module
38
- as parameters or you can be set via environment variables (`NUMERAI_PUBLIC_ID`
39
- and `NUMERAI_SECRET_KEY`).
40
-
41
- ## Python module
42
-
43
- ### Usage example - main competition
44
-
45
- import numerapi
46
- # some API calls do not require logging in
47
- napi = numerapi.NumerAPI(verbosity="info")
48
- # download current dataset => also check `https://numer.ai/data`
49
- napi.download_dataset("v4/train.parquet", "train.parquet")
50
- # get current leaderboard
51
- leaderboard = napi.get_leaderboard()
52
- # check if a new round has started
53
- if napi.check_new_round():
54
- print("new round has started within the last 12hours!")
55
- else:
56
- print("no new round within the last 12 hours")
57
-
58
- # provide api tokens
59
- example_public_id = "somepublicid"
60
- example_secret_key = "somesecretkey"
61
- napi = numerapi.NumerAPI(example_public_id, example_secret_key)
62
-
63
- # upload predictions
64
- model_id = napi.get_models()['uuazed']
65
- napi.upload_predictions("preds.csv", model_id=model_id)
66
- # increase your stake by 1.2 NMR
67
- napi.stake_increase(1.2)
68
-
69
- # convert results to a pandas dataframe
70
- import pandas as pd
71
- df = pd.DataFrame(napi.daily_user_performances("uuazed"))
72
-
73
-
74
- ### Usage example - Numerai Signals
75
-
76
- import numerapi
77
-
78
- napi = numerapi.SignalsAPI()
79
- # get current leaderboard
80
- leaderboard = napi.get_leaderboard()
81
-
82
- # setup API with api tokens
83
- example_public_id = "somepublicid"
84
- example_secret_key = "somesecretkey"
85
- napi = numerapi.SignalsAPI(example_public_id, example_secret_key)
86
-
87
- # upload predictions
88
- model_id = napi.get_models()['uuazed']
89
- napi.upload_predictions("preds.csv", model_id=model_id)
90
-
91
- # get daily performance as pandas dataframe
92
- import pandas as pd
93
- df = pd.DataFrame(napi.daily_user_performances("uuazed"))
94
-
95
- # using the diagnostics tool
96
- napi.upload_diagnostics("preds.csv", model_id=model_id)
97
- # ... or using a pandas DataFrame directly
98
- napi.upload_diagnostics(df=df, model_id=model_id)
99
- # fetch results
100
- napi.diagnostic(model_id)
101
-
102
-
103
- ## Command line interface
104
-
105
- To get started with the cli interface, let's take a look at the help page:
106
-
107
- $ numerapi --help
108
- Usage: numerapi [OPTIONS] COMMAND [ARGS]...
109
-
110
- Wrapper around the Numerai API
111
-
112
- Options:
113
- --help Show this message and exit.
114
-
115
- Commands:
116
- account Get all information about your account!
117
- check-new-round Check if a new round has started within...
118
- competitions Retrieves information about all...
119
- current-round Get number of the current active round.
120
- daily-model-performances Fetch daily performance of a model.
121
- daily-submissions-performances Fetch daily performance of a user's...
122
- dataset-url Fetch url of the current dataset.
123
- download-dataset Download specified file for the given...
124
- download-dataset-old Download dataset for the current active...
125
- leaderboard Get the leaderboard.
126
- list-datasets List of available data files
127
- models Get map of account models!
128
- profile Fetch the public profile of a user.
129
- stake-decrease Decrease your stake by `value` NMR.
130
- stake-drain Completely remove your stake.
131
- stake-get Get stake value of a user.
132
- stake-increase Increase your stake by `value` NMR.
133
- submission-filenames Get filenames of your submissions
134
- submit Upload predictions from file.
135
- transactions List all your deposits and withdrawals.
136
- user Get all information about you!...
137
- version Installed numerapi version.
138
-
139
-
140
- Each command has it's own help page, for example:
141
-
142
- $ numerapi submit --help
143
- Usage: numerapi submit [OPTIONS] PATH
144
-
145
- Upload predictions from file.
146
-
147
- Options:
148
- --tournament INTEGER The ID of the tournament, defaults to 1
149
- --model_id TEXT An account model UUID (required for accounts with
150
- multiple models
151
-
152
- --help Show this message and exit.
153
-
154
-
155
- # API Reference
156
-
157
- Checkout the [detailed API docs](http://numerapi.readthedocs.io/en/latest/api/numerapi.html#module-numerapi.numerapi)
158
- to learn about all available methods, parameters and returned values.
159
-
160
- Platform: OS Independent
161
- Classifier: Development Status :: 5 - Production/Stable
162
- Classifier: Environment :: Console
163
- Classifier: Intended Audience :: Science/Research
164
- Classifier: License :: OSI Approved :: MIT License
165
- Classifier: Operating System :: OS Independent
166
- Classifier: Programming Language :: Python
167
- Classifier: Programming Language :: Python :: 3
168
- Classifier: Topic :: Scientific/Engineering
169
- Description-Content-Type: text/markdown
File without changes
File without changes
File without changes
File without changes
File without changes