Skip to main content

PyBonsai procedurally generates ASCII art bonsai trees in your terminal.

Project description

PyBonsai-CLI 🌴

PyBonsai is a Python script that generates procedural ASCII art trees in the comfort of your terminal.

Features 🌱

This is a fork of PyBonsai with some additional features.

  • Simple package installation 📦
  • Better CLI experience 💻
  • Infinite mode 🔄
  • Save to text files 📄
  • [NEW] ✨ True bonsai 🌳
  • [NEW] ✨ Preset change 🎨
  • [NEW] ✨ Falling leaves animation 🍃
  • [NEW] ✨ Lofi radio 📻

About other features read more on examples.md.

Installation 🔗

Requirements:

  • Python 3.9 or greater

Recommended

Use pipx to install PyBonsai globally.

pipx install pybonsai

or using uv to install in temporary, isolated environment:

uvx pybonsai

Alternative

Also can be installed using pip:

pip install pybonsai

or build from source:

git clone https://github.com/DaEtoJostka/PyBonsai-CLI.git
cd PyBonsai-CLI
pip install .

Verify the installation by running:

pybonsai --version

Usage 🔧

Run pybonsai --help for usage:

OPTIONS:
    -h, --help            display help
        --version         display version

    -s, --seed            seed for the random number generator

    -i, --instant         instant mode: display finished tree immediately
    -w, --wait            time delay between drawing characters when not in instant mode [default {Options.WAIT_TIME}]

    -c, --branch-chars    string of chars randomly chosen for branches [default "{Options.BRANCH_CHARS}"]
    -C, --leaf-chars      string of chars randomly chosen for leaves [default "{Options.LEAF_CHARS}"]

    -x, --width           maximum width of the tree [default {Options.WINDOW_WIDTH}]
    -y, --height          maximum height of the tree [default {Options.WINDOW_HEIGHT}]

    -t, --type            tree type [0-3]: "classic":0, "fibonacci":1, "offset fibonacci":2, "random fibonacci":3 [default random]
    -b, --bonsai          enable bonsai preset settings (invokes specific defaults for small tree)
    -S, --start-len       length of the root branch [default {Options.INITIAL_LEN}]
    -L, --leaf-len        length of each leaf [default {Options.LEAF_LEN}]
    -l, --layers          number of branch layers: more => more branches [default {Options.NUM_LAYERS}]
    -a, --angle           mean angle of branches to their parent, in degrees; more => more arched trees [default {Options.ANGLE_MEAN}]

    -o, --save PATH       save the tree to a text file. If only a filename is provided, it will be saved in a user's Downloads directory.
    -f, --fixed-window    do not allow window height to increase when tree grows off screen
    
    -I, --infinite        run in infinite mode, infinitely growing same tree
    -n, --new             run in infinite mode, automatically growing new trees
    -W, --wait-infinite   time delay between drawing in infinite mode [default {Options.INFINITE_WAIT_TIME}]

    -p, --preset          [NEW] ✨ apply a color preset: {", ".join(colors.PRESETS.keys())}
    -B, --branch-color    [NEW] ✨ custom color for branches (e.g. "red", "#553311", "100,60,30")
    -e, --leaf-color      [NEW] ✨ custom color for leaves
    -g, --soil-color      [NEW] ✨ custom color for soil

    -F, --leaves-falling  [NEW] ✨ animate leaves falling from the tree continuously
    -N, --intensity       [NEW] ✨ intensity of falling leaves [1-10, default {Options.INTENSITY}]
    -d, --fall-speed      [NEW] ✨ speed of falling animation [default {Options.FALL_SPEED}]
    -T, --tumbling-speed  [NEW] ✨ speed of leaf character change [default {Options.TUMBLING_SPEED}]
    -K, --falling-chars   [NEW] ✨ custom characters for falling leaves (e.g. "01" for matrix-style)

    -R, --lofi            [NEW] ✨ play Lo-Fi radio stream in the terminal (requires ffplay)
    -V, --volume          [NEW] ✨ volume level for radio [0-100, default {Options.VOLUME}]
    -U, --radio-url       [NEW] ✨ custom radio stream URL

Other options usage examples see examples.md

Like it?

If you like this project, please consider giving it a ⭐️ on GitHub

Also don't forget to check out PyBonsai

Contributing

If you want to contribute to this project, please feel free to submit a pull request.

License

MIT license

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybonsai-2.1.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybonsai-2.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file pybonsai-2.1.0.tar.gz.

File metadata

  • Download URL: pybonsai-2.1.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybonsai-2.1.0.tar.gz
Algorithm Hash digest
SHA256 cd73ea51a9ef348ef96a9dc6ad2552d084601f853f7646ada008a1b77746fc79
MD5 d6590eb0af1e5e6a86b7b611b7b87c62
BLAKE2b-256 8328d4939b55797319e3e9e333131a349548ee49cd08e33b121139731c2bebaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybonsai-2.1.0.tar.gz:

Publisher: python-publish.yml on DaEtoJostka/PyBonsai-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybonsai-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pybonsai-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybonsai-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a58a1d9a16bae285a006544be086c33b2eeea12dc2c5fab197009c5db76dd79e
MD5 9ddabb308cbb8e7b34b2aa74db67fc15
BLAKE2b-256 f05c94516235d1fef5991f41267ac3d2f6a4d908f93f305816b3770b47df1975

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybonsai-2.1.0-py3-none-any.whl:

Publisher: python-publish.yml on DaEtoJostka/PyBonsai-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page