Registry / serialization / brackettree

brackettree

JSON →
library0.2.5pypypi✓ verified 80d ago

A Python library for parsing bracket-delimited strings into tree structures, enabling nested representation from indentation or bracket patterns. Version 0.2.5 is stable, with infrequent releases.

pip install brackettree
INSTALL
IMPORT
SIG · BRACKETTREE
B
brackettree
serializationpythonv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BracketNode
from brackettree import BracketNode
from brackettree import BracketTree
Node
from brackettree import Node
SquareNode
from brackettree import SquareNode

Parse a simple bracket string into a nested dictionary structure.

from brackettree import BracketTree # Parse a bracket string into a tree bt = BracketTree('[a[bc]]') tree = bt.parse() print(tree.to_dict()) # E.g., {'a': {'b': 'c'}}
Debug
Known issues
gotchaBracketTree assumes well-formed brackets; malformed input may lead to unexpected parse results or recursion errors.
fix
Validate bracket balance before parsing, e.g., using a custom check.
affects: all
deprecatedThe `BracketTree` class constructor with `None` input may raise errors in future versions; always provide a string.
fix
Always pass a non-None string to BracketTree constructor.
affects: <0.3.0
Upgrade
Version history
0.2.5latest on PyPI · released Apr 16, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
brackettree — pip install brackettree · libregistry