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 📄

About other features read more on PyBonsai.

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 0]

    -c, --branch-chars    string of chars randomly chosen for branches [default "~;:="]
    -C, --leaf-chars      string of chars randomly chosen for leaves [default "&%#@"]

    -x, --width           maximum width of the tree [default 80]
    -y, --height          maximum height of the tree [default 25]

    -t, --type            tree type: integer between 0 and 3 inclusive [default random]
    -S, --start-len       length of the root branch [default 15]
    -L, --leaf-len        length of each leaf [default 4]
    -l, --layers          number of branch layers: more => more branches [default 8]
    -a, --angle           mean angle of branches to their parent, in degrees; more => more arched trees [default 40]

    -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 5]

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.0.0.tar.gz (20.8 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.0.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pybonsai-2.0.0.tar.gz
Algorithm Hash digest
SHA256 be799681e1f2104472b751d9183b2c0be530082480c42a7f4f48fb49283cd080
MD5 aac0f342002c785465fdab3bcd5af909
BLAKE2b-256 843db0c031ed62b0ad73b8be511479cbdff51d7a7965b5d25c514ff6b96a90d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybonsai-2.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: pybonsai-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca3203283f8f5107d33621b1b9b8aad3a1aee51a08b56971803f9187b21948ad
MD5 146a503d0784ca30b5570d9e9a2f62be
BLAKE2b-256 825987a4a2e8bb4e628a8bfb66d40048ec9d8c834a6c15561ea4e169e37ac44a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybonsai-2.0.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