|
1 | 1 | # Python API |
2 | 2 |
|
3 | | -All described objects can be imported from the `xrlint.all` module. |
4 | | - |
5 | | -## Class `XRLint` |
6 | | - |
| 3 | +This chapter provides a plain reference for the XRLint Python API. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +- The top-level API component is the class [XRLint][xrlint.cli.engine.XRLint] |
| 8 | + which encapsulates the functionality of the [XRLint CLI](cli.md). |
| 9 | +- The `linter` module provides the functionality for linting a single |
| 10 | + dataset: |
| 11 | + [new_linter()][xrlint.linter.new_linter] factory function and the |
| 12 | + [Linter][xrlint.linter.Linter] class. |
| 13 | +- The `plugin` module provides plugin related classes: |
| 14 | + [Plugin][xrlint.plugin.Plugin] and its |
| 15 | + metadata [PluginMeta][xrlint.plugin.PluginMeta]. |
| 16 | +- The `config` module provides classes that represent |
| 17 | + configuration information and provide related functionality: |
| 18 | + [Config][xrlint.config.Config] and [ConfigList][xrlint.config.ConfigList]. |
| 19 | +- The `rule` module provides rule related classes: |
| 20 | + [Rule][xrlint.rule.Rule] comprising rule metadata |
| 21 | + [RuleMeta][xrlint.rule.RuleMeta] and the rule operation |
| 22 | + [RuleOp][xrlint.rule.RuleOp], as well as related to the latter |
| 23 | + [RuleContext][xrlint.rule.RuleContext] and [RuleExit][xrlint.rule.RuleExit]. |
| 24 | +- The `node` module defines the nodes passed to [xrlint.rule.RuleOp]: |
| 25 | + base classes [None][xrlint.node.Node], [XarrayNode][xrlint.node.XarrayNode] |
| 26 | + and the specific [DatasetNode][xrlint.node.DatasetNode], |
| 27 | + [DataArray][xrlint.node.DataArrayNode], [AttrsNode][xrlint.node.AttrsNode], |
| 28 | + and [AttrNode][xrlint.node.AttrNode] nodes. |
| 29 | +- The `processor` module provides processor related classes: |
| 30 | + [Processor][xrlint.processor.Processor] comprising processor metadata |
| 31 | + [ProcessorMeta][xrlint.processor.ProcessorMeta] |
| 32 | + and the processor operation [ProcessorOp][xrlint.processor.ProcessorOp]. |
| 33 | +- The `result` module provides data classes that are used to |
| 34 | + represent validation results: |
| 35 | + [Result][xrlint.result.Result] composed of [Messages][xrlint.result.Message], |
| 36 | + which again may contain [Suggestions][xrlint.result.Suggestion]. |
| 37 | +- Finally, the `testing` module provides classes for rule testing: |
| 38 | + [RuleTester][xrlint.testing.RuleTester] that is made up |
| 39 | + of [RuleTest][xrlint.testing.RuleTest]s. |
| 40 | + |
| 41 | +Note: the `xrlint.all` convenience module exports all of the above from a |
| 42 | + single module. |
| 43 | + |
7 | 44 | ::: xrlint.cli.engine.XRLint |
8 | 45 |
|
9 | | -## Function `new_linter()` |
10 | | - |
11 | 46 | ::: xrlint.linter.new_linter |
12 | 47 |
|
13 | | -## Class `Linter` |
14 | | - |
15 | 48 | ::: xrlint.linter.Linter |
16 | 49 |
|
17 | | -## Class `Config` |
18 | | - |
19 | 50 | ::: xrlint.config.Config |
20 | 51 |
|
21 | | -## Class `ConfigList` |
22 | | - |
23 | 52 | ::: xrlint.config.ConfigList |
24 | 53 |
|
25 | | -## Class `Plugin` |
26 | | - |
27 | | -::: xrlint.plugin.Plugin |
28 | | - |
29 | | -## Class `PluginMeta` |
30 | | - |
31 | | -::: xrlint.plugin.PluginMeta |
| 54 | +::: xrlint.rule.Rule |
32 | 55 |
|
33 | | -## Class `Processor` |
| 56 | +::: xrlint.rule.RuleMeta |
34 | 57 |
|
35 | | -::: xrlint.processor.Processor |
| 58 | +::: xrlint.rule.RuleOp |
36 | 59 |
|
37 | | -## Class `ProcessorMeta` |
| 60 | +::: xrlint.rule.RuleContext |
38 | 61 |
|
39 | | -::: xrlint.processor.ProcessorMeta |
| 62 | +::: xrlint.rule.RuleExit |
40 | 63 |
|
41 | | -## Class `ProcessorOp` |
| 64 | +::: xrlint.node.Node |
42 | 65 |
|
43 | | -::: xrlint.processor.ProcessorOp |
| 66 | +::: xrlint.node.XarrayNode |
44 | 67 |
|
45 | | -## Class `RuleConfig` |
| 68 | +::: xrlint.node.DatasetNode |
46 | 69 |
|
47 | | -::: xrlint.rule.RuleConfig |
| 70 | +::: xrlint.node.DataArrayNode |
48 | 71 |
|
49 | | -## Class `Rule` |
| 72 | +::: xrlint.node.AttrsNode |
50 | 73 |
|
51 | | -::: xrlint.rule.Rule |
| 74 | +::: xrlint.node.AttrNode |
52 | 75 |
|
53 | | -## Class `RuleMeta` |
| 76 | +::: xrlint.plugin.Plugin |
54 | 77 |
|
55 | | -::: xrlint.rule.RuleMeta |
| 78 | +::: xrlint.plugin.PluginMeta |
56 | 79 |
|
57 | | -## Class `RuleOp` |
| 80 | +::: xrlint.processor.Processor |
58 | 81 |
|
59 | | -::: xrlint.rule.RuleOp |
| 82 | +::: xrlint.processor.ProcessorMeta |
| 83 | + |
| 84 | +::: xrlint.processor.ProcessorOp |
60 | 85 |
|
61 | | -## Class `RuleContext` |
| 86 | +::: xrlint.result.Result |
62 | 87 |
|
63 | | -::: xrlint.rule.RuleContext |
| 88 | +::: xrlint.result.Message |
64 | 89 |
|
65 | | -## Class `RuleTester` |
| 90 | +::: xrlint.result.Suggestion |
66 | 91 |
|
67 | 92 | ::: xrlint.testing.RuleTester |
68 | 93 |
|
69 | | -## Class `RuleTest` |
70 | | - |
71 | 94 | ::: xrlint.testing.RuleTest |
72 | 95 |
|
73 | | -## Class `Result` |
74 | | - |
75 | | -::: xrlint.result.Result |
76 | | - |
77 | | -## Class `Message` |
78 | | - |
79 | | -::: xrlint.result.Message |
80 | | - |
81 | | -## Class `Suggestion` |
82 | | - |
83 | | -::: xrlint.result.Suggestion |
84 | | - |
|
0 commit comments