genelastic 0.6.1__py3-none-any.whl → 0.8.0__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.
- genelastic/api/cli_start_api.py +18 -0
- genelastic/api/extends/example.py +2 -3
- genelastic/api/extends/example.yml +20 -0
- genelastic/api/routes.py +160 -23
- genelastic/api/server.py +42 -31
- genelastic/api/settings.py +5 -8
- genelastic/api/specification.yml +350 -0
- genelastic/common/__init__.py +41 -9
- genelastic/common/cli.py +103 -23
- genelastic/common/elastic.py +80 -49
- genelastic/common/exceptions.py +0 -2
- genelastic/common/server.py +51 -0
- genelastic/common/types.py +20 -15
- genelastic/import_data/__init__.py +23 -5
- genelastic/import_data/analyses.py +17 -20
- genelastic/import_data/analysis.py +69 -65
- genelastic/import_data/bi_process.py +7 -5
- genelastic/import_data/bi_processes.py +8 -8
- genelastic/import_data/cli_gen_data.py +143 -0
- genelastic/import_data/cli_import.py +379 -0
- genelastic/import_data/{info.py → cli_info.py} +104 -75
- genelastic/import_data/cli_integrity.py +384 -0
- genelastic/import_data/cli_validate.py +54 -0
- genelastic/import_data/constants.py +11 -32
- genelastic/import_data/data_file.py +23 -20
- genelastic/import_data/filename_pattern.py +26 -32
- genelastic/import_data/import_bundle.py +56 -47
- genelastic/import_data/import_bundle_factory.py +166 -158
- genelastic/import_data/logger.py +22 -18
- genelastic/import_data/random_bundle.py +425 -0
- genelastic/import_data/tags.py +46 -26
- genelastic/import_data/wet_process.py +8 -4
- genelastic/import_data/wet_processes.py +13 -8
- genelastic/ui/__init__.py +0 -0
- genelastic/ui/cli_start_ui.py +18 -0
- genelastic/ui/routes.py +86 -0
- genelastic/ui/server.py +14 -0
- genelastic/ui/settings.py +7 -0
- genelastic/ui/templates/analyses.html +11 -0
- genelastic/ui/templates/bi_processes.html +11 -0
- genelastic/ui/templates/home.html +4 -0
- genelastic/ui/templates/layout.html +34 -0
- genelastic/ui/templates/version.html +9 -0
- genelastic/ui/templates/wet_processes.html +11 -0
- genelastic-0.8.0.dist-info/METADATA +109 -0
- genelastic-0.8.0.dist-info/RECORD +52 -0
- {genelastic-0.6.1.dist-info → genelastic-0.8.0.dist-info}/WHEEL +1 -1
- genelastic-0.8.0.dist-info/entry_points.txt +8 -0
- genelastic/import_data/gen_data.py +0 -194
- genelastic/import_data/import_data.py +0 -292
- genelastic/import_data/integrity.py +0 -290
- genelastic/import_data/validate_data.py +0 -43
- genelastic-0.6.1.dist-info/METADATA +0 -41
- genelastic-0.6.1.dist-info/RECORD +0 -36
- genelastic-0.6.1.dist-info/entry_points.txt +0 -6
- {genelastic-0.6.1.dist-info → genelastic-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
---
|
|
2
|
+
openapi: "3.0.3"
|
|
3
|
+
info:
|
|
4
|
+
description: This is the swagger file for our API
|
|
5
|
+
version: "1.0.1"
|
|
6
|
+
title: Swagger for ReST API
|
|
7
|
+
servers:
|
|
8
|
+
- url: "/api"
|
|
9
|
+
|
|
10
|
+
paths:
|
|
11
|
+
/ping:
|
|
12
|
+
get:
|
|
13
|
+
operationId: genelastic.api.routes.ping
|
|
14
|
+
tags:
|
|
15
|
+
- Tests
|
|
16
|
+
summary: Server status check
|
|
17
|
+
description: Test route to verify that the server is online
|
|
18
|
+
responses:
|
|
19
|
+
200:
|
|
20
|
+
description: The server is online
|
|
21
|
+
content:
|
|
22
|
+
application/json:
|
|
23
|
+
schema:
|
|
24
|
+
type: object
|
|
25
|
+
properties:
|
|
26
|
+
message:
|
|
27
|
+
type: string
|
|
28
|
+
example: pong
|
|
29
|
+
|
|
30
|
+
/indices:
|
|
31
|
+
get:
|
|
32
|
+
operationId: genelastic.api.routes.list_indices
|
|
33
|
+
tags:
|
|
34
|
+
- Indexes
|
|
35
|
+
summary: Listing the indexes present in Elasticsearch
|
|
36
|
+
description: Listing the indexes present in Elasticsearch
|
|
37
|
+
responses:
|
|
38
|
+
200:
|
|
39
|
+
description: Success of the request
|
|
40
|
+
content:
|
|
41
|
+
application/json:
|
|
42
|
+
schema:
|
|
43
|
+
type: object
|
|
44
|
+
400:
|
|
45
|
+
description: The server could not understand the request due to invalid syntax.
|
|
46
|
+
500:
|
|
47
|
+
description: Internal server error
|
|
48
|
+
|
|
49
|
+
/indices/{index_id}/documents/{document_id}:
|
|
50
|
+
get:
|
|
51
|
+
operationId: genelastic.api.routes.retrieve_document
|
|
52
|
+
parameters:
|
|
53
|
+
- in: path
|
|
54
|
+
name: index_id
|
|
55
|
+
schema:
|
|
56
|
+
type: string
|
|
57
|
+
required: true
|
|
58
|
+
description: The index in which to search for the document
|
|
59
|
+
- in: path
|
|
60
|
+
name: document_id
|
|
61
|
+
schema:
|
|
62
|
+
type: string
|
|
63
|
+
required: true
|
|
64
|
+
description: The ID of the document to retrieve
|
|
65
|
+
tags:
|
|
66
|
+
- Document
|
|
67
|
+
summary: Retrieve a document
|
|
68
|
+
description: Retrieve a specific document from Elasticsearch
|
|
69
|
+
responses:
|
|
70
|
+
200:
|
|
71
|
+
description: Success in reading the data
|
|
72
|
+
content:
|
|
73
|
+
application/json:
|
|
74
|
+
schema:
|
|
75
|
+
type: object
|
|
76
|
+
404:
|
|
77
|
+
description: Document not found
|
|
78
|
+
500:
|
|
79
|
+
description: Internal server error
|
|
80
|
+
|
|
81
|
+
/wet_processes:
|
|
82
|
+
get:
|
|
83
|
+
operationId: genelastic.api.routes.list_wet_processes
|
|
84
|
+
summary: Retrieve a list of wet processes
|
|
85
|
+
tags:
|
|
86
|
+
- Wet processes
|
|
87
|
+
responses:
|
|
88
|
+
200:
|
|
89
|
+
description: List of wet processes
|
|
90
|
+
content:
|
|
91
|
+
application/json:
|
|
92
|
+
schema:
|
|
93
|
+
type: array
|
|
94
|
+
|
|
95
|
+
/bi_processes:
|
|
96
|
+
get:
|
|
97
|
+
operationId: genelastic.api.routes.list_bi_processes
|
|
98
|
+
summary: Retrieve a list of bi processes
|
|
99
|
+
tags:
|
|
100
|
+
- Bi processes
|
|
101
|
+
responses:
|
|
102
|
+
200:
|
|
103
|
+
description: List of bi processes
|
|
104
|
+
content:
|
|
105
|
+
application/json:
|
|
106
|
+
schema:
|
|
107
|
+
type: array
|
|
108
|
+
|
|
109
|
+
/analyses:
|
|
110
|
+
get:
|
|
111
|
+
operationId: genelastic.api.routes.list_analyses
|
|
112
|
+
summary: Retrieve a list of analyses
|
|
113
|
+
tags:
|
|
114
|
+
- Analyses
|
|
115
|
+
responses:
|
|
116
|
+
200:
|
|
117
|
+
description: List of analyses
|
|
118
|
+
content:
|
|
119
|
+
application/json:
|
|
120
|
+
schema:
|
|
121
|
+
type: string
|
|
122
|
+
|
|
123
|
+
/wet_process/{proc_id}:
|
|
124
|
+
get:
|
|
125
|
+
operationId: genelastic.api.routes.list_analyses_wet_processes
|
|
126
|
+
summary: Retrieve a list of analyses of one specific wet process
|
|
127
|
+
tags:
|
|
128
|
+
- Analyses
|
|
129
|
+
parameters:
|
|
130
|
+
- in: path
|
|
131
|
+
name: proc_id
|
|
132
|
+
schema:
|
|
133
|
+
type: string
|
|
134
|
+
required: true
|
|
135
|
+
description: Wet process ID
|
|
136
|
+
responses:
|
|
137
|
+
200:
|
|
138
|
+
description: List of wet processes
|
|
139
|
+
content:
|
|
140
|
+
application/json:
|
|
141
|
+
schema:
|
|
142
|
+
type: array
|
|
143
|
+
items:
|
|
144
|
+
type: string
|
|
145
|
+
|
|
146
|
+
/bi_process/{proc_id}:
|
|
147
|
+
get:
|
|
148
|
+
operationId: genelastic.api.routes.list_analyses_bi_processes
|
|
149
|
+
summary: Retrieve a list of analyses of one specific bi process
|
|
150
|
+
tags:
|
|
151
|
+
- Analyses
|
|
152
|
+
parameters:
|
|
153
|
+
- in: path
|
|
154
|
+
name: proc_id
|
|
155
|
+
schema:
|
|
156
|
+
type: string
|
|
157
|
+
required: true
|
|
158
|
+
description: Bi process ID
|
|
159
|
+
responses:
|
|
160
|
+
200:
|
|
161
|
+
description: List of bi processes
|
|
162
|
+
content:
|
|
163
|
+
application/json:
|
|
164
|
+
schema:
|
|
165
|
+
type: array
|
|
166
|
+
items:
|
|
167
|
+
type: string
|
|
168
|
+
|
|
169
|
+
/snvs_documents:
|
|
170
|
+
get:
|
|
171
|
+
operationId: genelastic.api.routes.list_snv_documents
|
|
172
|
+
summary: Retrieve all documents containing an insertion (INS), a deletion (DEL) or a mutation
|
|
173
|
+
at a single position (SNV)
|
|
174
|
+
tags:
|
|
175
|
+
- Documents
|
|
176
|
+
responses:
|
|
177
|
+
200:
|
|
178
|
+
description: Complete list of documents containing an insertion (INS), a deletion (DEL) or a mutation
|
|
179
|
+
at a single position (SNV)
|
|
180
|
+
content:
|
|
181
|
+
application/json:
|
|
182
|
+
schema:
|
|
183
|
+
type: array
|
|
184
|
+
items:
|
|
185
|
+
type: object
|
|
186
|
+
properties:
|
|
187
|
+
type:
|
|
188
|
+
type: string
|
|
189
|
+
chr:
|
|
190
|
+
type: string
|
|
191
|
+
pos:
|
|
192
|
+
type: integer
|
|
193
|
+
alt:
|
|
194
|
+
type: array
|
|
195
|
+
items:
|
|
196
|
+
type: string
|
|
197
|
+
info:
|
|
198
|
+
type: object
|
|
199
|
+
additionalProperties:
|
|
200
|
+
type: string
|
|
201
|
+
400:
|
|
202
|
+
description: Invalid request
|
|
203
|
+
500:
|
|
204
|
+
description: Internal server error
|
|
205
|
+
|
|
206
|
+
/snvs_insertion_documents:
|
|
207
|
+
get:
|
|
208
|
+
operationId: genelastic.api.routes.list_snv_insertion_documents
|
|
209
|
+
summary: Retrieve all documents containing an insertion (INS) at a single position (SNV)
|
|
210
|
+
tags:
|
|
211
|
+
- Documents
|
|
212
|
+
responses:
|
|
213
|
+
200:
|
|
214
|
+
description: Complete list of documents containing an insertion (INS) at a single position (SNV)
|
|
215
|
+
content:
|
|
216
|
+
application/json:
|
|
217
|
+
schema:
|
|
218
|
+
type: array
|
|
219
|
+
items:
|
|
220
|
+
type: object
|
|
221
|
+
properties:
|
|
222
|
+
type:
|
|
223
|
+
type: string
|
|
224
|
+
chr:
|
|
225
|
+
type: string
|
|
226
|
+
pos:
|
|
227
|
+
type: integer
|
|
228
|
+
alt:
|
|
229
|
+
type: array
|
|
230
|
+
items:
|
|
231
|
+
type: string
|
|
232
|
+
info:
|
|
233
|
+
type: object
|
|
234
|
+
properties:
|
|
235
|
+
SVTYPE:
|
|
236
|
+
type: string
|
|
237
|
+
END:
|
|
238
|
+
type: integer
|
|
239
|
+
SVLEN:
|
|
240
|
+
type: array
|
|
241
|
+
items:
|
|
242
|
+
type: integer
|
|
243
|
+
400:
|
|
244
|
+
description: Invalid request
|
|
245
|
+
500:
|
|
246
|
+
description: Internal server error
|
|
247
|
+
|
|
248
|
+
/snvs_deletion_documents:
|
|
249
|
+
get:
|
|
250
|
+
operationId: genelastic.api.routes.list_snv_deletion_documents
|
|
251
|
+
summary: Retrieve all documents containing a deletion (DEL) at a single position (SNV)
|
|
252
|
+
tags:
|
|
253
|
+
- Documents
|
|
254
|
+
responses:
|
|
255
|
+
200:
|
|
256
|
+
description: Complete list of documents containing a deletion (DEL) at a single position (SNV)
|
|
257
|
+
content:
|
|
258
|
+
application/json:
|
|
259
|
+
schema:
|
|
260
|
+
type: array
|
|
261
|
+
items:
|
|
262
|
+
type: object
|
|
263
|
+
properties:
|
|
264
|
+
type:
|
|
265
|
+
type: string
|
|
266
|
+
chr:
|
|
267
|
+
type: string
|
|
268
|
+
pos:
|
|
269
|
+
type: integer
|
|
270
|
+
alt:
|
|
271
|
+
type: array
|
|
272
|
+
items:
|
|
273
|
+
type: string
|
|
274
|
+
info:
|
|
275
|
+
type: object
|
|
276
|
+
properties:
|
|
277
|
+
SVTYPE:
|
|
278
|
+
type: string
|
|
279
|
+
END:
|
|
280
|
+
type: integer
|
|
281
|
+
SVLEN:
|
|
282
|
+
type: array
|
|
283
|
+
items:
|
|
284
|
+
type: integer
|
|
285
|
+
400:
|
|
286
|
+
description: Invalid request
|
|
287
|
+
500:
|
|
288
|
+
description: Internal server error
|
|
289
|
+
|
|
290
|
+
/snvs_mutation_documents:
|
|
291
|
+
get:
|
|
292
|
+
operationId: genelastic.api.routes.list_snv_mutation_documents
|
|
293
|
+
summary: Retrieve all documents containing a mutation at a single position (SNV)
|
|
294
|
+
tags:
|
|
295
|
+
- Documents
|
|
296
|
+
responses:
|
|
297
|
+
200:
|
|
298
|
+
description: Complete list of documents containing a mutation at a single position (SNV)
|
|
299
|
+
content:
|
|
300
|
+
application/json:
|
|
301
|
+
schema:
|
|
302
|
+
type: array
|
|
303
|
+
items:
|
|
304
|
+
type: object
|
|
305
|
+
properties:
|
|
306
|
+
type:
|
|
307
|
+
type: string
|
|
308
|
+
chr:
|
|
309
|
+
type: string
|
|
310
|
+
pos:
|
|
311
|
+
type: integer
|
|
312
|
+
alt:
|
|
313
|
+
type: array
|
|
314
|
+
items:
|
|
315
|
+
type: string
|
|
316
|
+
info:
|
|
317
|
+
type: object
|
|
318
|
+
properties:
|
|
319
|
+
SVTYPE:
|
|
320
|
+
type: string
|
|
321
|
+
END:
|
|
322
|
+
type: integer
|
|
323
|
+
SVLEN:
|
|
324
|
+
type: array
|
|
325
|
+
items:
|
|
326
|
+
type: integer
|
|
327
|
+
400:
|
|
328
|
+
description: Invalid request due to incorrect parameters or format
|
|
329
|
+
500:
|
|
330
|
+
description: Internal server error
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
/version:
|
|
334
|
+
get:
|
|
335
|
+
operationId: genelastic.api.routes.get_genelastic_version
|
|
336
|
+
tags:
|
|
337
|
+
- Version
|
|
338
|
+
summary: Get the genelastic package version
|
|
339
|
+
description: Return the installed version of the genelastic package
|
|
340
|
+
responses:
|
|
341
|
+
200:
|
|
342
|
+
description: Success
|
|
343
|
+
content:
|
|
344
|
+
application/json:
|
|
345
|
+
schema:
|
|
346
|
+
type: object
|
|
347
|
+
properties:
|
|
348
|
+
version:
|
|
349
|
+
type: string
|
|
350
|
+
example: "1.0.0"
|
genelastic/common/__init__.py
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
"""Genelastic package for common code between API and import scripts."""
|
|
2
|
-
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
from .cli import (
|
|
4
|
+
add_es_connection_args,
|
|
5
|
+
add_verbose_control_args,
|
|
6
|
+
parse_server_launch_args,
|
|
7
|
+
)
|
|
8
|
+
from .elastic import ElasticImportConn, ElasticQueryConn
|
|
6
9
|
from .exceptions import DBIntegrityError
|
|
10
|
+
from .types import (
|
|
11
|
+
AnalysisDocument,
|
|
12
|
+
AnalysisMetaData,
|
|
13
|
+
BioInfoProcessData,
|
|
14
|
+
Bucket,
|
|
15
|
+
BulkItems,
|
|
16
|
+
BundleDict,
|
|
17
|
+
MetadataDocument,
|
|
18
|
+
ProcessDocument,
|
|
19
|
+
RandomAnalysisData,
|
|
20
|
+
RandomBiProcessData,
|
|
21
|
+
RandomWetProcessData,
|
|
22
|
+
WetProcessesData,
|
|
23
|
+
)
|
|
7
24
|
|
|
8
|
-
__all__ = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
__all__ = [
|
|
26
|
+
"AnalysisDocument",
|
|
27
|
+
"AnalysisMetaData",
|
|
28
|
+
"BioInfoProcessData",
|
|
29
|
+
"Bucket",
|
|
30
|
+
"BulkItems",
|
|
31
|
+
"BundleDict",
|
|
32
|
+
"DBIntegrityError",
|
|
33
|
+
"ElasticImportConn",
|
|
34
|
+
"ElasticQueryConn",
|
|
35
|
+
"MetadataDocument",
|
|
36
|
+
"ProcessDocument",
|
|
37
|
+
"RandomAnalysisData",
|
|
38
|
+
"RandomBiProcessData",
|
|
39
|
+
"RandomWetProcessData",
|
|
40
|
+
"WetProcessesData",
|
|
41
|
+
"add_es_connection_args",
|
|
42
|
+
"add_verbose_control_args",
|
|
43
|
+
"parse_server_launch_args",
|
|
44
|
+
]
|
genelastic/common/cli.py
CHANGED
|
@@ -1,35 +1,115 @@
|
|
|
1
1
|
"""Utility functions for CLI scripts."""
|
|
2
|
+
|
|
2
3
|
import argparse
|
|
3
4
|
|
|
5
|
+
BASE_LOG_LEVEL = ["critical", "error", "warning", "info", "debug"]
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
def add_verbose_control_args(parser: argparse.ArgumentParser) -> None:
|
|
6
|
-
"""
|
|
7
|
-
Add verbose control arguments to the parser.
|
|
9
|
+
"""Add verbose control arguments to the parser.
|
|
8
10
|
Arguments are added to the parser by using its reference.
|
|
9
11
|
"""
|
|
10
|
-
parser.add_argument(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
parser.add_argument(
|
|
13
|
+
"-q",
|
|
14
|
+
"--quiet",
|
|
15
|
+
dest="verbose",
|
|
16
|
+
action="store_const",
|
|
17
|
+
const=0,
|
|
18
|
+
default=1,
|
|
19
|
+
help="Set verbosity to 0 (quiet mode).",
|
|
20
|
+
)
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"-v",
|
|
23
|
+
"--verbose",
|
|
24
|
+
dest="verbose",
|
|
25
|
+
action="count",
|
|
26
|
+
default=1,
|
|
27
|
+
help=(
|
|
28
|
+
"Verbose level. -v for information, -vv for debug, -vvv for trace."
|
|
29
|
+
),
|
|
30
|
+
)
|
|
17
31
|
|
|
18
32
|
|
|
19
33
|
def add_es_connection_args(parser: argparse.ArgumentParser) -> None:
|
|
20
|
-
"""
|
|
21
|
-
Add arguments to the parser needed to gather ElasticSearch server connection parameters.
|
|
34
|
+
"""Add arguments to the parser needed to gather ElasticSearch server connection parameters.
|
|
22
35
|
Arguments are added to the parser by using its reference.
|
|
23
36
|
"""
|
|
24
|
-
parser.add_argument(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
parser.add_argument(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--es-host",
|
|
39
|
+
dest="es_host",
|
|
40
|
+
default="localhost",
|
|
41
|
+
help="Address of Elasticsearch host.",
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"--es-port",
|
|
45
|
+
type=int,
|
|
46
|
+
default=9200,
|
|
47
|
+
dest="es_port",
|
|
48
|
+
help="Elasticsearch port.",
|
|
49
|
+
)
|
|
50
|
+
parser.add_argument(
|
|
51
|
+
"--es-usr", dest="es_usr", default="elastic", help="Elasticsearch user."
|
|
52
|
+
)
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
"--es-pwd", dest="es_pwd", required=True, help="Elasticsearch password."
|
|
55
|
+
)
|
|
56
|
+
parser.add_argument(
|
|
57
|
+
"--es-cert-fp",
|
|
58
|
+
dest="es_cert_fp",
|
|
59
|
+
help="Elasticsearch sha256 certificate fingerprint.",
|
|
60
|
+
)
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"--es-index-prefix",
|
|
63
|
+
dest="es_index_prefix",
|
|
64
|
+
help="Add the given prefix to each index created during import.",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def parse_server_launch_args(
|
|
69
|
+
parser_desc: str, default_port: int
|
|
70
|
+
) -> argparse.Namespace:
|
|
71
|
+
parser = argparse.ArgumentParser(
|
|
72
|
+
description=parser_desc,
|
|
73
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
74
|
+
allow_abbrev=False,
|
|
75
|
+
)
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"--host",
|
|
78
|
+
type=str,
|
|
79
|
+
default="127.0.0.1",
|
|
80
|
+
)
|
|
81
|
+
parser.add_argument(
|
|
82
|
+
"--port",
|
|
83
|
+
type=int,
|
|
84
|
+
default=default_port,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
env_subparsers = parser.add_subparsers(dest="env", required=True)
|
|
88
|
+
dev_parser = env_subparsers.add_parser(
|
|
89
|
+
"dev",
|
|
90
|
+
help="Use development environment.",
|
|
91
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
92
|
+
)
|
|
93
|
+
dev_parser.add_argument(
|
|
94
|
+
"--log-level",
|
|
95
|
+
type=str,
|
|
96
|
+
default="info",
|
|
97
|
+
choices=[*BASE_LOG_LEVEL, "trace"],
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
prod_parser = env_subparsers.add_parser(
|
|
101
|
+
"prod",
|
|
102
|
+
help="Use production environment.",
|
|
103
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
104
|
+
)
|
|
105
|
+
prod_parser.add_argument(
|
|
106
|
+
"--log-level", type=str, default="info", choices=BASE_LOG_LEVEL
|
|
107
|
+
)
|
|
108
|
+
prod_parser.add_argument(
|
|
109
|
+
"-w", "--workers", type=int, default=1, help="Number of workers."
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
prod_parser.add_argument("--access-logfile", type=str, default=None)
|
|
113
|
+
prod_parser.add_argument("--log-file", type=str, default=None)
|
|
114
|
+
|
|
115
|
+
return parser.parse_args()
|