Skip to main content

Tree Parser

build PyPI version License: GPL v3

A simple tree parser for trees in bracket notation written in python. For example the following code (with default values for fontdict and textkwargs explicitly specified)

from treeparser import TreeParser
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=(20, 10))
string = "[C[C[C[C[C][C[G7[Dm7][G7]][C]]][G[G[D7[Am][D7]][G]][G[D7[Am[CM7][Am]][D7]][G]]]][C[C[Bo7[Dm[C#o7][Dm]][Bo7]][C]][C[G7[Dm7[FM7][Dm7]][G7]][C [C][C[G7[FM7[C7][FM7]][G7[G7[F#o7][G7[Fm6][G7]]][G7[G7[G64][G7[G47][G7]]][G7[G47[G64[F#o7][G64]][G47]][G7]]]]][C[G7[C64[C7][C64]][G7]][C]]]]]]]]"
parser = TreeParser(string, True)
parser.plot(ax=ax, padding=1, fontdict={'fontsize': 12}, textkwargs={'bbox': {'facecolor': 'red', 'pad': 10}, 'style': 'italic'})

results in: tree

Release files for treeparser 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treeparser 0.1.1
File Size Uploaded
treeparser-0.1.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for treeparser 0.1.1
File Interpreter ABI Platform
treeparser-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / treeparser-0.1.1.tar.gz

Download URL treeparser-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
761ecb56d2fa63b26f151d660710c0d5d2bb3a28746a77298e745f52da8515da
BLAKE2b-256 checksum
How to use checksums
720f89b36b10158d3f405d57bc93f8d80ef49680072068793ffe62321bd84b1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release files / treeparser-0.1.1-py3-none-any.whl

Download URL treeparser-0.1.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50bbd3d397fe8a6e7e510fb12e2974d15c205cfa60b032a5b24e78ac40448ee6
BLAKE2b-256 checksum
How to use checksums
f0393f61efbfbe530e5e9e05dce8ba01ae1bf9ed9b7ee75bfc3d89301936d58a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page