11# API
22
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+
331## Marks
432
533pytask uses marks to attach additional information to task functions which is processed
@@ -192,7 +220,9 @@ def task_function():
192220.. autoclass:: pytask.MarkGenerator
193221```
194222
195- ### Functions to work with marks
223+ ### Functions
224+
225+ These functions help you to handle marks.
196226
197227``` {eval-rst}
198228.. autofunction:: pytask.get_all_marks
@@ -231,24 +261,49 @@ The remaining exceptions convey specific errors.
231261
232262``` {eval-rst}
233263.. 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
241264.. autoclass:: pytask.Session
242265```
243266
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.
245283
246284``` {eval-rst}
247285.. autofunction:: pytask.depends_on
248- .. autofunction:: pytask.produces
249286.. 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
252307```
253308
254309## Outcomes
@@ -284,13 +339,29 @@ outcome.
284339.. autoclass:: pytask.SkippedUnchanged
285340```
286341
342+ ### Functions
343+
344+ ``` {eval-rst}
345+ .. autofunction:: pytask.count_outcomes
346+ ```
347+
287348## Programmatic Interfaces
288349
289350``` {eval-rst}
290351.. autofunction:: pytask.build_dag
291352.. autofunction:: pytask.main
292353```
293354
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+
294365## Tracebacks
295366
296367``` {eval-rst}
@@ -299,3 +370,18 @@ outcome.
299370.. autofunction:: pytask.remove_traceback_from_exc_info
300371.. autofunction:: pytask.render_exc_info
301372```
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