PythonDocument

Document

Construct, query, edit, and serialize the editable TeXForm document tree.

Documentclass#

The editable document tree — the working format you read, edit, and output.

A Document wraps the internal arena tree behind a fallible, DOM-style surface, so no internal panic ever reaches the caller. Reads go through read-only Node handles; edits are validated eagerly and raise on misuse. The tree is always structurally valid, even when it contains Error nodes.

A tree that has_errors() is read-only, fixed that way at construction: every editing method then raises EditError. The only use for an error tree is inspection.

Construct one by parsing (Parser.parse), from scratch (Document()), or from a snapshot (Document.from_syntax). For the conceptual model, see the Parsing guide.

Python
import texform

doc = texform.Parser().parse(r"\frac{x}{y}")["document"]
doc.to_latex()  # '\frac { x } { y }'

Construction and copying#

Document#

Document(    knowledge_base: KnowledgeBase | None = None,    mode: Literal['math', 'text'] = 'math',) -> None

Construct an empty document holding a single empty root.

This is a complete tree: has_errors() is False and it is fully editable. It serializes to the empty string.

ParameterTypeDefault
knowledge_baseKnowledgeBase | NoneNone
modeLiteral['math', 'text']'math'
Python
doc = texform.Document()
doc.to_latex()  # ''

from_syntaxstatic method#

from_syntax(    node: SyntaxNode,    knowledge_base: KnowledgeBase | None = None,) -> Document

Build a document from a SyntaxNode dict, the lossless parse snapshot.

from_syntax and to_syntax are symmetric over every node kind, including Error and Prime. A bare Prime is a math symbol; use Scripted with an empty group base for a leading quote. Invalid external syntax is rejected rather than corrupting the tree. The document can be transformed by any engine sharing its knowledge-base instance.

ParameterTypeDefaultDescription
nodeSyntaxNode—

A SyntaxNode dict, typically produced by to_syntax().

knowledge_baseKnowledgeBase | NoneNone—
Returns
Document —

A new Document wrapping the snapshot.

Raises
Python
result = texform.Parser().parse(r"\frac{x}{y}")
document = result["document"]
assert document is not None
syntax = document.to_syntax()
doc = texform.Document.from_syntax(syntax)

copy#

copy() -> Document

Deep-copy the tree into a new document with new node identities.

The copy shares this document's knowledge base, so a transform engine built on it accepts both. Also available as copy.copy and copy.deepcopy.

Returns

__copy__#

__copy__() -> Document
Returns

__deepcopy__#

__deepcopy__(memo: dict[int, Any]) -> Document
ParameterType
memodict[int, Any]
Returns

Queries#

root#

root() -> Node

Return the root Node of the tree.

Returns
Node —

The Root node handle.

Python
doc.root().kind()  # 'Root'

has_errors#

has_errors() -> bool

Report whether the tree contains any Error placeholder node.

This is a cheap O(1) signal, separate from structural validity and independent of the abort_on_error parse setting. When True, the document is read-only.

Returns
bool —

True if the tree holds at least one Error node.

Python
result = texform.Parser().parse(r"\sqrt[")
document = result["document"]
assert document is not None
document.has_errors()  # True

is_read_only#

is_read_only() -> bool

Report whether the document is read-only.

A tree that has_errors() is read-only and fixed that way at construction; its error count cannot change, so its read-only-ness cannot either.

Returns
bool —

True if no editing method will succeed on this document.

errors#

errors() -> list[Node]

Return the Error placeholder nodes in the tree.

Returns
list[Node] —

The list of Error node handles, empty when has_errors() is False.

find_commands#

find_commands(name: str) -> list[Node]

Return every command node whose name matches.

ParameterTypeDescription
namestr

The command name without the leading backslash.

Returns
list[Node] —

The matching Command node handles, in document order.

Python
doc = texform.Parser().parse(r"\frac{x}{y} + \frac{a}{b}")["document"]
len(doc.find_commands("frac"))  # 2

find_environments#

find_environments(name: str) -> list[Node]

Return every environment node whose name matches.

ParameterTypeDescription
namestr

The environment name.

Returns
list[Node] —

The matching Environment node handles, in document order.

node_spans#

node_spans() -> list[NodeSpanEntry]

Return source byte spans for the nodes that carry them.

Returns
list[NodeSpanEntry] —

A list of {"id": str, "span": {...}} entries mapping node identifiers to source byte ranges.

node_at#

node_at(path: str) -> Node

Resolve a tree path to a node handle.

Paths are rooted at root and use the scheme of Node.path(); use paths read from the current tree, since edits shift them.

ParameterTypeDescription
pathstr

A path such as one returned by Node.path().

Returns
Node —

The node at that path.

Raises

knowledge_base#

knowledge_base() -> KnowledgeBase

Return the immutable knowledge base bound to this document.

Construction and edits are checked against it; to_latex is not.

Output#

to_latex#

to_latex(**options) -> str

Serialize the tree back to LaTeX text.

Error nodes round-trip their captured source snippet verbatim, so a partial tree round-trips losslessly. The serializer guarantees text idempotency: re-parsing and re-serializing the output yields the same string. There is intentionally no method named serialize on Document; this is the text channel and to_syntax() is the data channel.

ParameterTypeDescription
**optionsUnpack[SerializeOptions]

SerializeOptions keywords. Omitted keys and explicit None keep the default (spaced) style.

Returns
str —

The serialized LaTeX string.

Raises
  • ConfigError —

    If an option key is unknown or a value has the wrong type.

  • TypeError —

    If options are passed as a positional dict instead of keyword arguments. Use doc.to_latex(**options) for a dict.

Python
doc = texform.Parser().parse(r"x^2")["document"]
doc.to_latex()                  # 'x ^ { 2 }'
doc.to_latex(style="compact")   # 'x^2'

to_tokenized_latex#

to_tokenized_latex(**options) -> TokenizedLatex

Serialize the tree to LaTeX together with typed output tokens.

start_byte and end_byte are UTF-8 byte offsets, not Python string indices. Empty error snippets produce no zero-width token; use has_errors() to detect whether the document contains error nodes.

ParameterTypeDescription
**optionsUnpack[SerializeOptions]

SerializeOptions keywords, as for to_latex. Omitted keys and explicit None keep the default (spaced) style.

Returns
TokenizedLatex —

A TokenizedLatex dict with latex and tokens.

Raises
  • ConfigError —

    If an option key is unknown or a value has the wrong type.

Python
tok = texform.Parser().parse(r"x^2")["document"].to_tokenized_latex()
tok["latex"]  # 'x ^ { 2 }'
tok["tokens"][0]["kind"]  # 'character'

to_syntax#

to_syntax() -> SyntaxNode

Convert the tree to a SyntaxNode dict for serde and transport.

This is the structured-data channel, distinct from the text channel to_latex(). The conversion is symmetric with from_syntax.

Returns
SyntaxNode —

A SyntaxNode dict, the single serde DTO for the tree.

Python
doc.to_syntax()  # {'Root': {...}}

to_columnar#

to_columnar() -> ColumnarTree

Flatten the tree into columns for bulk structural analysis with Arrow or DataFrame tools.

Each table can be passed directly to pyarrow.table. Parent, slot index, and content columns use -1 when no row or index applies. Other missing values are None. Modes describe each node's context. Detached subtrees are excluded; incomplete documents remain exportable.

Staging constructors#

The create_* methods, parse_fragment, clone_node, and import_node build detached subtrees owned by this document. A staged node is not in the tree until you attach it with an edit method.

create_char#

create_char(value: str, mode: RuntimeContentMode | None = None) -> Node

Create a detached Char node owned by this document.

Staged nodes are not in the tree until attached with an edit method. The context mode defaults to the document root's mode; every create_* method accepts it as a keyword to construct in another context.

ParameterTypeDefaultDescription
valuestr—

The single character. "&" is a literal ampersand written \&.

modeRuntimeContentMode | NoneNone

The context mode, "math" or "text".

Returns
Node —

The detached Char node handle.

Raises
  • ConformanceError —

    If the character cannot be written in that mode, such as \, ^, ~, or a math-mode space.

  • EditError —

    If the document is read-only.

create_text#

create_text(value: str, mode: RuntimeContentMode | None = None) -> Node

Create a detached Text node owned by this document.

ParameterTypeDefaultDescription
valuestr—

The text value.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to the root mode.

Returns
Node —

The detached Text node handle.

Raises

create_active_space#

create_active_space(mode: RuntimeContentMode | None = None) -> Node

Create a detached ActiveSpace node owned by this document.

ParameterTypeDefault
modeRuntimeContentMode | NoneNone
Returns
Node —

The detached ActiveSpace node handle.

create_group#

create_group(    mode: RuntimeContentMode | None = None,    children: list[Node | str] | None = None,) -> Node

Create a detached brace Group, built in its own mode.

ParameterTypeDefaultDescription
modeRuntimeContentMode | NoneNone

The group's content mode and context. Defaults to the root mode.

childrenlist[Node | str] | NoneNone

Detached nodes or source strings. A string is parsed in mode and its nodes are spliced into the list, so one string may yield several children.

Returns
Node —

The detached Group node handle.

Raises
  • ParseError —

    If a source string does not parse cleanly.

  • ConformanceError —

    If a child was built in another mode or an infix has siblings.

  • EditError —

    If a child is attached, foreign, or repeated, or the document is read-only.

Python
doc = texform.Document()
group = doc.create_group("math", ["x^2", doc.create_char("y")])

create_command#

create_command(    name: str,    args: list[Arg] | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached prefix Command owned by this document.

ParameterTypeDefaultDescription
namestr—

The command name without the leading backslash. A name missing from the knowledge base creates an unknown command without arguments.

argslist[Arg] | NoneNone

Values for every signature slot, or only the required slots. A str is the source written inside the slot's boundaries; None omits an optional slot and means false in a star slot; Paired selects an explicit delimiter pair. bool sets a star slot.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to the root mode.

Returns
Node —

The detached Command node handle.

Raises
  • ConformanceError —

    If the name is not a prefix command (the message names the right constructor, such as create_declarative for bf), the argument count is wrong, or an argument does not fit its slot.

  • ParseError —

    If a source argument does not parse cleanly.

  • EditError —

    For invalid nodes or a read-only document.

Python
doc = texform.Document()
cmd = doc.create_command("sqrt", ["x"])
doc.append_child(doc.root(), cmd)
doc.to_latex()  # '\sqrt { x }'

create_declarative#

create_declarative(    name: str,    args: list[Arg] | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached Declarative command such as \bf.

ParameterTypeDefaultDescription
namestr—

The declarative command name without the leading backslash.

argslist[Arg] | NoneNone

Slot values, as for create_command.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to the root mode.

Returns
Node —

The detached Declarative node handle.

Raises
  • ConformanceError —

    Under the conditions of create_command, except the record must be declarative.

  • ParseError —

    If a source argument does not parse cleanly.

create_environment#

create_environment(    name: str,    args: list[Arg] | None = None,    body: Node | list[Node | str] | str | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached Environment owned by this document.

ParameterTypeDefaultDescription
namestr—

The environment name. An unknown environment takes no arguments and uses the surrounding mode.

argslist[Arg] | NoneNone

Slot values, as for create_command.

bodyNode | list[Node | str] | str | NoneNone

A detached group in the body mode, a source string parsed in the recorded body mode, a list whose source strings are spliced as in create_group, or None for an empty body.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to the root mode.

Returns
Node —

The detached Environment node handle.

Raises
  • ConformanceError —

    If an argument does not fit the signature or the body is not a group in the body mode.

  • ParseError —

    If source does not parse cleanly.

  • EditError —

    For invalid nodes or a read-only document.

Python
doc = texform.Document()
env = doc.create_environment("matrix", body="a & b")

create_alignment_tab#

create_alignment_tab(mode: RuntimeContentMode | None = None) -> Node

Create a detached AlignmentTab node owned by this document.

This is the unescaped & that separates cells in alignment environments. Use create_char("&") for a literal ampersand, which serializes as \&.

ParameterTypeDefault
modeRuntimeContentMode | NoneNone
Returns
Node —

The detached AlignmentTab node handle.

create_delimited_group#

create_delimited_group(    left: str,    right: str,    children: list[Node | str] | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached \left...\right group, built in math mode.

ParameterTypeDefaultDescription
leftstr—

The left delimiter source, such as "(" or "\langle".

rightstr—

The right delimiter source.

childrenlist[Node | str] | NoneNone

Detached nodes or source strings, spliced as in create_group.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to "math".

Returns
Node —

The detached delimited Group node handle.

Raises
  • ConformanceError —

    If a delimiter is neither . nor registered in the knowledge base, or a child does not fit.

  • ParseError —

    If a source string does not parse cleanly.

  • EditError —

    For invalid children or a read-only document.

create_inline_math#

create_inline_math(    children: list[Node | str] | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached $...$ group whose children are math.

ParameterTypeDefaultDescription
childrenlist[Node | str] | NoneNone

Detached nodes or source strings, spliced as in create_group.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to "text".

Returns
Node —

The detached inline-math Group node handle.

Raises
  • ParseError —

    If a source string does not parse cleanly.

  • ConformanceError —

    If a child does not fit or the context is math.

  • EditError —

    For invalid children or a read-only document.

create_scripted#

create_scripted(    base: Node | str,    sub: Node | str | None = None,    sup: Node | str | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached Scripted node with a base and subscript and/or superscript.

ParameterTypeDefaultDescription
baseNode | str—

The base node or source string.

subNode | str | NoneNone

The subscript node or source, or None for none.

supNode | str | NoneNone

The superscript node or source, or None for none.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to "math".

Returns
Node —

The detached Scripted node handle.

Raises
  • ConformanceError —

    If both scripts are absent, or the base is a scripted node, an infix, or an alignment tab.

  • ParseError —

    If a source string does not parse cleanly.

  • EditError —

    For invalid nodes or a read-only document.

Python
doc = texform.Document()
doc.append_child(doc.root(), doc.create_scripted("x", sup="2"))

create_prime#

create_prime(count: int, mode: RuntimeContentMode | None = None) -> Node

Create a detached run of count primes.

ParameterTypeDefaultDescription
countint—

The number of primes; must be positive.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to "math".

Returns
Node —

The detached Prime node handle.

Raises

create_infix#

create_infix(    name: str,    left: Node | str,    right: Node | str,    args: list[Arg] | None = None,    mode: RuntimeContentMode | None = None,) -> Node

Create a detached Infix command such as \over.

ParameterTypeDefaultDescription
namestr—

The infix command name without the leading backslash.

leftNode | str—

The left operand node or source string.

rightNode | str—

The right operand node or source string.

argslist[Arg] | NoneNone

Values for extra slots, such as the dimension of \above.

modeRuntimeContentMode | NoneNone

The context mode. Defaults to "math".

Returns
Node —

The detached Infix node handle.

Raises
  • ConformanceError —

    Under the conditions of create_command, except the record must be infix.

  • ParseError —

    If a source operand or argument does not parse cleanly.

parse_fragment#

parse_fragment(    source: str,    mode: RuntimeContentMode | None = None,) -> Node

Parse source into a detached implicit Group.

ParameterTypeDefaultDescription
sourcestr—

The LaTeX source.

modeRuntimeContentMode | NoneNone

The parse mode. Defaults to the root mode.

Returns
Node —

The detached Group node handle.

Raises
  • ParseError —

    If the source does not parse cleanly. diagnostics carries the parser diagnostics.

clone_node#

clone_node(node: Node) -> Node

Deep-copy a subtree of this document as a detached node.

ParameterTypeDescription
nodeNode

The subtree root to copy.

Returns
Node —

The detached copy, ready to attach.

Raises
  • EditError —

    If node is foreign or missing, or the document is read-only.

import_node#

import_node(node: Node) -> Node

Copy a subtree from another document into this one as a detached node.

The subtree is validated against this document's knowledge base, so importing across knowledge bases can fail where clone_node cannot.

ParameterTypeDescription
nodeNode

A node of another document.

Returns
Node —

The detached copy, owned by this document.

Raises

Edit methods#

All edits are validated eagerly and raise EditError on misuse. Nodes must belong to this document, the root cannot be detached, and a tree that has_errors() is read-only.

append_child#

append_child(parent: Node, child: Node) -> None

Append child as the last child of parent.

ParameterTypeDescription
parentNode

The container node to append into.

childNode

The detached or detached node to attach.

Raises
  • EditError —

    If the edit is invalid (read-only tree, root protection, wrong container shape, or a foreign node).

insert_before#

insert_before(anchor: Node, new: Node) -> None

Insert new immediately before anchor among its siblings.

ParameterTypeDescription
anchorNode

The node to insert before.

newNode

The detached or detached node to attach.

Raises

insert_after#

insert_after(anchor: Node, new: Node) -> None

Insert new immediately after anchor among its siblings.

ParameterTypeDescription
anchorNode

The node to insert after.

newNode

The detached or detached node to attach.

Raises

insert_child#

insert_child(parent: Node, index: int, child: Node) -> None

Insert child at index among parent's children.

ParameterTypeDescription
parentNode

The container node to insert into.

indexint

The zero-based position to insert at.

childNode

The detached or detached node to attach.

Raises
  • EditError —

    If the edit is invalid, including an out-of-bounds index.

replace_with#

replace_with(target: Node, replacement: Node) -> None

Replace target in the tree with replacement.

ParameterTypeDescription
targetNode

The node to remove from its position.

replacementNode

The detached or detached node to put in its place.

Raises

wrap#

wrap(target: Node, wrapper: Node) -> Node

Wrap target inside wrapper, putting wrapper in its place.

ParameterTypeDescription
targetNode

The node to be wrapped.

wrapperNode

The detached container node to wrap it in.

Returns
Node —

The wrapper node handle, now in the tree.

Raises

unwrap#

unwrap(group: Node) -> list[Node]

Remove a group, splicing its children into the parent in its place.

ParameterTypeDescription
groupNode

The group node to dissolve.

Returns
list[Node] —

The freed child node handles, now attached to the parent.

Raises
Python
doc = texform.Parser().parse(r"{x y}")["document"]
group = next(n for n in doc.root().descendants() if n.kind() == "Group")
doc.unwrap(group)
doc.to_latex()  # 'x y'

extract#

extract(node: Node) -> Node

Detach node from the tree and return it as a detached node.

ParameterTypeDescription
nodeNode

The node to remove from its position and keep.

Returns
Node —

The detached node handle, reusable in a later edit.

Raises

remove#

remove(node: Node) -> None

Remove node from the tree and discard it.

ParameterTypeDescription
nodeNode

The node to remove.

Raises
  • EditError —

    If the edit is invalid, such as removing the root.

clear#

clear(container: Node) -> None

Remove every child of container.

ParameterTypeDescription
containerNode

The node whose children are removed.

Raises

set_command_name#

set_command_name(node: Node, name: str) -> None

Rename a command node in place.

ParameterTypeDescription
nodeNode

The Command or Declarative node to rename.

namestr

The new command name without the leading backslash.

Raises

set_env_name#

set_env_name(node: Node, name: str) -> None

Rename an environment, keeping its arguments and body.

ParameterTypeDescription
nodeNode

The Environment node to rename.

namestr

The new environment name.

Raises
  • ConformanceError —

    If the new name's signature or body mode does not fit the existing arguments and body.

  • EditError —

    If the edit is invalid.

set_text#

set_text(node: Node, value: str) -> None

Set a text node's value in place.

ParameterTypeDescription
nodeNode

The Text node to update.

valuestr

The new text value.

Raises

set_char#

set_char(node: Node, value: str) -> None

Set a char node's value in place.

ParameterTypeDescription
nodeNode

The Char node to update.

valuestr

The new single character.

Raises

set_arg#

set_arg(node: Node, index: int, value: Arg) -> None

Set the argument at index of a command-like node or environment.

ParameterTypeDescription
nodeNode

The command-like node or environment whose argument is set.

indexint

The zero-based slot index.

valueArg

The slot source (a str), content node, star flag, None to clear an optional slot, or Paired.

Raises
  • ConformanceError —

    If the value does not fit the slot.

  • ParseError —

    If a source string does not parse cleanly.

  • EditError —

    If the edit is invalid, including an out-of-bounds index.

set_arg_delimiters#

set_arg_delimiters(    node: Node,    index: int,    open: str,    close: str,) -> None

Change only the boundaries of a filled paired argument.

ParameterTypeDescription
nodeNode

The command-like node.

indexint

The zero-based slot index.

openstr

The new opening delimiter source.

closestr

The new closing delimiter source.

Raises
  • ConformanceError —

    If the slot is not a filled paired slot or the delimiters are not allowed.

  • EditError —

    If the edit is invalid.

set_delimiters#

set_delimiters(node: Node, left: str, right: str) -> None

Change the delimiters of a \left...\right group.

ParameterTypeDescription
nodeNode

The delimited Group node.

leftstr

The new left delimiter source.

rightstr

The new right delimiter source.

Raises

set_subscript#

set_subscript(target: Node, sub: Arg) -> Node

Set or clear the subscript of target.

If target is not scripted, it becomes the base of a new Scripted node; an existing scripted base is resolved automatically.

ParameterTypeDescription
targetNode

The base node or an existing Scripted node.

subArg

The new subscript node or source, or None to clear it.

Returns
Node —

The resulting Scripted node, or the base when clearing the last script collapses the wrapper.

Raises

set_superscript#

set_superscript(target: Node, sup: Arg) -> Node

Set or clear the superscript of target.

Behaves like set_subscript for the superscript slot.

ParameterTypeDescription
targetNode

The base node or an existing Scripted node.

supArg

The new superscript node or source, or None to clear it.

Returns
Node —

The resulting Scripted node, or the base after a collapse.

Raises

set_prime_count#

set_prime_count(node: Node, count: int) -> None

Set the number of primes in a Prime node.

ParameterTypeDescription
nodeNode

The Prime node.

countint

The new count; must be positive.

Raises

NodeSpanEntrydict type#

One entry mapping a node identifier to its source byte span.

FieldTypeDescription
idstr

The node identifier within the document.

spanSpan

A {"start": int, "end": int} byte range into the source.

TokenizedLatexdict type#

Serialized LaTeX and tokens produced by the same serializer traversal.

Text and tokenized output share one traversal and spacing policy; this is not a second lexer pass.

FieldTypeDescription
latexstr

The serialized LaTeX string, identical to Document.to_latex().

tokenslist[SerializationToken]

Ordered, non-overlapping, non-empty fragments. Gaps between spans contain serializer-inserted spacing.

SerializationTokendict type#

One serialization fragment with UTF-8 byte offsets.

start_byte / end_byte index the accompanying TokenizedLatex.latex string and are UTF-8 byte offsets, not Python code-point indices. Spans do not overlap. Empty error snippets emit no token.

FieldTypeDescription
textstr

The UTF-8 decoding of the byte slice latex.encode("utf-8")[start_byte:end_byte].

start_byteint

Inclusive UTF-8 byte offset into the serialized LaTeX string.

end_byteint

Exclusive UTF-8 byte offset into the serialized LaTeX string.

kindSerializationTokenKind

Semantic category of the fragment (control sequence, character, ...).

modeRuntimeContentMode

Semantic math/text mode of the fragment, independent of spacing policy.

SerializationTokenKindtype#

Literal['control_sequence', 'character', 'delimiter', 'text', 'raw', 'error']

Semantic category of one serialization fragment.

NodeTabledict type#

Preorder node columns. Row indices are local to this snapshot.

FieldType
kindlist[NodeKind]
parentlist[int]
slotlist[NodeSlotKind | None]
slot_indexlist[int]
depthlist[int]
modelist[RuntimeContentMode]
namelist[str | None]
valuelist[str | None]
knownlist[bool | None]
group_kindlist[Literal['explicit', 'implicit', 'delimited', 'inline_math'] | None]
leftlist[str | None]
rightlist[str | None]

ArgumentTabledict type#

All argument slots, ordered by owner row and slot index.

FieldType
ownerlist[int]
indexlist[int]
formlist[ArgFormKind | None]
presentlist[bool]
value_kindlist[Literal['math', 'text', 'operator_name', 'delimiter', 'cs_name', 'dimension', 'integer', 'key_val', 'column', 'boolean'] | None]
valuelist[str | None]
contentlist[int]
openlist[str | None]
closelist[str | None]

ColumnarTreedict type#

Tree columns for bulk structural analysis with Arrow or DataFrame tools.

FieldType
nodesNodeTable
argsArgumentTable