1
1
# API
2
2
3
+ ## Command line interface
4
+
5
+ To extend pytask's command line interface and set the right types for your options,
6
+ pytask offers the following functionalities.
7
+
8
+ ### Classes
9
+
10
+ ``` {eval-rst}
11
+ .. autoclass:: pytask.ColoredCommand
12
+ .. autoclass:: pytask.ColoredGroup
13
+ .. autoclass:: pytask.EnumChoice
14
+ ```
15
+
16
+ ## Compatibility
17
+
18
+ ``` {eval-rst}
19
+ .. autofunction:: pytask.check_for_optional_program
20
+ .. autofunction:: pytask.import_optional_dependency
21
+ ```
22
+
23
+ ## Console
24
+
25
+ To write to the terminal, use pytask's console.
26
+
27
+ ``` {eval-rst}
28
+ .. autoclass:: pytask.console
29
+ ```
30
+
3
31
## Marks
4
32
5
33
pytask uses marks to attach additional information to task functions which is processed
@@ -192,7 +220,9 @@ def task_function():
192
220
.. autoclass:: pytask.MarkGenerator
193
221
```
194
222
195
- ### Functions to work with marks
223
+ ### Functions
224
+
225
+ These functions help you to handle marks.
196
226
197
227
``` {eval-rst}
198
228
.. autofunction:: pytask.get_all_marks
@@ -231,24 +261,49 @@ The remaining exceptions convey specific errors.
231
261
232
262
``` {eval-rst}
233
263
.. autoclass:: pytask.console
234
- .. autoclass:: pytask.FilePathNode
235
- .. autoclass:: pytask.MetaNode
236
- .. autoclass:: pytask.Task
237
- .. autoclass:: pytask.CollectionMetadata
238
- .. autoclass:: pytask.CollectionReport
239
- .. autoclass:: pytask.ExecutionReport
240
- .. autoclass:: pytask.ResolvingDependenciesReport
241
264
.. autoclass:: pytask.Session
242
265
```
243
266
244
- ## General functions
267
+ ## Nodes
268
+
269
+ Nodes are the interface for different kinds of dependencies or products. They inherit
270
+ from {class}` pytask.MetaNode ` .
271
+
272
+ ``` {eval-rst}
273
+ .. autoclass:: pytask.MetaNode
274
+ ```
275
+
276
+ Then, different kinds of nodes can be implemented.
277
+
278
+ ``` {eval-rst}
279
+ .. autoclass:: pytask.FilePathNode
280
+ ```
281
+
282
+ To parse dependencies and products from nodes, use the following functions.
245
283
246
284
``` {eval-rst}
247
285
.. autofunction:: pytask.depends_on
248
- .. autofunction:: pytask.produces
249
286
.. autofunction:: pytask.parse_nodes
250
- .. autofunction:: pytask.check_for_optional_program
251
- .. autofunction:: pytask.import_optional_dependency
287
+ .. autofunction:: pytask.produces
288
+ ```
289
+
290
+ ## Tasks
291
+
292
+ Task are currently represented by the following class:
293
+
294
+ ``` {eval-rst}
295
+ .. autoclass:: pytask.Task
296
+ ```
297
+
298
+ Currently, there are no different types of tasks since changing the ` .function `
299
+ attribute with a custom callable proved to be sufficient.
300
+
301
+ To carry over information from user-defined tasks like task functions to
302
+ {class}` pytask.Task ` objects, use a metadata object that is stored in an ` .pytask_meta `
303
+ attribute of the task function.
304
+
305
+ ``` {eval-rst}
306
+ .. autoclass:: pytask.CollectionMetadata
252
307
```
253
308
254
309
## Outcomes
@@ -284,13 +339,29 @@ outcome.
284
339
.. autoclass:: pytask.SkippedUnchanged
285
340
```
286
341
342
+ ### Functions
343
+
344
+ ``` {eval-rst}
345
+ .. autofunction:: pytask.count_outcomes
346
+ ```
347
+
287
348
## Programmatic Interfaces
288
349
289
350
``` {eval-rst}
290
351
.. autofunction:: pytask.build_dag
291
352
.. autofunction:: pytask.main
292
353
```
293
354
355
+ ## Reports
356
+
357
+ There are some classes to handle different kinds of reports.
358
+
359
+ ``` {eval-rst}
360
+ .. autoclass:: pytask.CollectionReport
361
+ .. autoclass:: pytask.ExecutionReport
362
+ .. autoclass:: pytask.ResolvingDependenciesReport
363
+ ```
364
+
294
365
## Tracebacks
295
366
296
367
``` {eval-rst}
@@ -299,3 +370,18 @@ outcome.
299
370
.. autofunction:: pytask.remove_traceback_from_exc_info
300
371
.. autofunction:: pytask.render_exc_info
301
372
```
373
+
374
+ ## Warnings
375
+
376
+ ### Classes
377
+
378
+ ``` {eval-rst}
379
+ .. autoclass: pytask.WarningReport
380
+ ```
381
+
382
+ ### Functions
383
+
384
+ ``` {eval-rst}
385
+ .. autofunction:: pytask.parse_warning_filter
386
+ .. autofunction:: pytask.warning_record_to_str
387
+ ```
0 commit comments