Skip to content

Python API

The public API is every name in the __all__ of the modules below. Names starting with an underscore are internal. The most used names are also importable from the dpmxl package itself.

Module Purpose
dpmxl.evaluator Evaluation, preconditions, per-record outcomes, caches; thread safety.
dpmxl.explain Fills a failing record's formula with operand values.
dpmxl.provider The DataProvider protocol and the in-memory MemoryProvider.
dpmxl.columnar The same semantics on polars frames (columnar extra); the frame schema.
dpmxl.parser Tokenizer and recursive-descent parser. Nodes keep source spans.
dpmxl.ast Expression tree, selections, axis selectors and item literals.
dpmxl.grammar Keywords, operators, function names and signatures; the TextMate grammar.
dpmxl.values Number with interval tolerance, comparison and formatting.
dpmxl.recordset Keyed record sets and the natural join used by every operator.
dpmxl.references Static selections (with with context applied) and {v_…} templates.
dpmxl.diagnostics Positioned problems for editors: syntax, calls, tables and coordinates.

The command line (dpmxl.cli) is documented in the CLI reference.

The dpmxl package

import dpmxl

print(dpmxl.__all__)
['AxisSelector', 'CellQuery', 'DataPoint', 'DataProvider', 'Diagnostic', 'DpmXlSyntaxError', 'Evaluation', 'EvaluationError', 'Evaluator', 'Explanation', 'Item', 'MemoryProvider', 'Node', 'Number', 'Operand', 'Outcome', 'Recordset', 'Reference', 'RuleResult', 'SelectionCache', 'SelectionSpec', 'TableLayout', 'UnsupportedError', 'Value', 'ValueSet', '__version__', 'axis_matcher', 'axis_matches', 'compare', 'diagnose', 'evaluate_rule', 'explain', 'format_value', 'iter_points', 'normalize_code', 'parse', 'parse_cached', 'parse_program', 'parse_selection', 'references', 'reported_templates', 'tables', 'unique_points']
Name Defined in
evaluate_rule, RuleResult, Outcome, Evaluation, Evaluator, SelectionCache, parse_cached dpmxl.evaluator
explain, Explanation, Operand dpmxl.explain
DataProvider, MemoryProvider, TableLayout, CellQuery, DataPoint, axis_matcher, axis_matches, normalize_code dpmxl.provider
parse, parse_program, parse_selection, DpmXlSyntaxError dpmxl.parser
Node, Item, SelectionSpec, AxisSelector dpmxl.ast
Number, Value, ValueSet, compare, format_value dpmxl.values
Recordset, EvaluationError, UnsupportedError, iter_points, unique_points dpmxl.recordset
references, Reference, tables, reported_templates dpmxl.references
diagnose, Diagnostic dpmxl.diagnostics

dpmxl.__version__ is the installed version.