{"id":15919580,"url":"https://github.com/Ben-Edwards44/PyBonsai","last_synced_at":"2025-10-18T14:30:22.924Z","repository":{"id":250417189,"uuid":"833718357","full_name":"Ben-Edwards44/PyBonsai","owner":"Ben-Edwards44","description":"Generate procedural ASCII art trees in the terminal.","archived":false,"fork":false,"pushed_at":"2024-11-28T19:05:30.000Z","size":2299,"stargazers_count":71,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-28T20:20:05.293Z","etag":null,"topics":["ascii-art","command-line","procedural-generation","terminal-based","trees"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ben-Edwards44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T15:48:54.000Z","updated_at":"2024-11-28T19:05:34.000Z","dependencies_parsed_at":"2024-07-27T09:24:11.507Z","dependency_job_id":"e72a03d5-d68a-4218-ad49-45d26bcea57c","html_url":"https://github.com/Ben-Edwards44/PyBonsai","commit_stats":null,"previous_names":["ben-edwards44/pybonsai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ben-Edwards44%2FPyBonsai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ben-Edwards44%2FPyBonsai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ben-Edwards44%2FPyBonsai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ben-Edwards44%2FPyBonsai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ben-Edwards44","download_url":"https://codeload.github.com/Ben-Edwards44/PyBonsai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236967539,"owners_count":19233688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii-art","command-line","procedural-generation","terminal-based","trees"],"created_at":"2024-10-06T19:01:53.031Z","updated_at":"2025-10-18T14:30:17.518Z","avatar_url":"https://github.com/Ben-Edwards44.png","language":"Python","funding_links":[],"categories":["Python","\u003ca name=\"animation\"\u003e\u003c/a\u003eAnimation"],"sub_categories":[],"readme":"# PyBonsai :palm_tree:\n\nPyBonsai is a Python script that generates procedural ASCII art trees in the comfort of your terminal.\n\n## About :seedling:\n\n\u003cimg src=\"Images/demo.gif\" align=\"right\" width=\"450px\"\u003e\n\nPyBonsai is inspired by the amazing [cbonsai](https://gitlab.com/jallbrit/cbonsai) repository.\nWhereas cbonsai grows bonsai trees, PyBonsai trees look more like trees you would find in a forest (oak, ash and so on).\n\nThe trees are configurable via CLI options to make them different sizes, more or less complex, grow at different rates, or use a different set of characters. See [useage](#useage-wrench) for more information.\n\nCurrently, PyBonsai supports 4 different types of tree. Details of these are shown in the [tree types](#tree-types-leaves) section.\n\nPyBonsai uses [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) for colouring characters. Almost all modern terminals will support this but, if yours does not, PyBonsai will not work.\n\nIf you encounter an issue with PyBonsai, or have an idea for an improvement, do not be afraid to open an issue.\n\n## Installation :link:\n\nRequirements:\n\n- Python 3.9 or greater\n\nTo use PyBonsai, you need to first clone the repository:\n\n    git clone https://github.com/Ben-Edwards44/PyBonsai.git\n\n### Linux\n\nTo install for all users, run the included `install.sh` script to create a symlink in `/usr/local/bin`\n\n    cd PyBonsai\n    sudo bash install.sh\n\nVerify the installation by running:\n\n    pybonsai --version\n\n### Windows\n\nAfter cloning the repository you need to follow these steps in order to run PyBonsai in your terminal:\n\n1. Install the `pyinstaller` package\n\n```\npip install pyinstaller\n```\n\n\u003e You may need to run the terminal in admin mode while installing `pyinstaller`\n\n2. Change to the directory containing the cloned repo and run the `pyinstaller` command on `main.py`\n\n```\ncd directory-that-contains-pybonsai\npyinstaller main.py\n```\n\nThis will create a new `dist` folder with an executable of the PyBonsai, you can test it by changing to the `dist` folder and running `main.exe`\n\n```\ncd dist\nmain.exe\n```\n\nYou should see something like this:\n\n\u003cimg src=\"Images/demo-windows.gif\" width=\"450px\"\u003e\n\n\u003cbr /\u003e\n\nNow rename the `main.exe` to `pybonsai.exe`\n\n3. Copy the path of the `dist` folder and add it to your `Path` environment variable\n\n\u003cimg src=\"Images/env-example.png\" width=\"450px\"\u003e\n\n\u003cbr /\u003e\n\nNow you can run PyBonsai with the command `pybonsai.exe` or `pybonsai`\n\nYou can even pass flags\n\n```\npybonsai --layers 10\n```\n\n### MacOS\n\nPlease note that PyBonsai has not been tested on MacOS, but I see no reason why it would not work on Mac OS.\nTo install PyBonsai, you will need to clone the repository and add it to your system's PATH.\n\n## Usage :wrench:\n\nRun `pybonsai --help` for useage:\n\n    USEAGE pybonsai [OPTION]...\n\n    PyBonsai procedurally generates ASCII art trees in your terminal.\n\n    OPTIONS:\n        -h, --help            display help\n            --version         display version\n\n        -s, --seed            seed for the random number generator\n\n        -i, --instant         instant mode: display finished tree immediately\n        -w, --wait            time delay between drawing characters when not in instant mode [default 0]\n\n        -c, --branch-chars    string of chars randomly chosen for branches [default \"~;:=\"]\n        -C, --leaf-chars      string of chars randomly chosen for leaves [default \"\u0026%#@\"]\n\n        -x, --width           maximum width of the tree [default 80]\n        -y, --height          maximum height of the tree [default 25]\n\n        -t, --type            tree type: integer between 0 and 3 inclusive [default random]\n        -S, --start-len       length of the root branch [default 15]\n        -L, --leaf-len        length of each leaf [default 4]\n        -l, --layers          number of branch layers: more =\u003e more branches [default 8]\n        -a, --angle           mean angle of branches to their parent, in degrees; more =\u003e more arched trees [default 40]\n\n        -f, --fixed-window    do not allow window height to increase when tree grows off screen\n\nThe following images demonstrate the use of the different options:\n\n| Effect               | Image                                              |\n| -------------------- | -------------------------------------------------- |\n| Big tree             | ![big tree](/Images/options/big.png)               |\n| Different characters | ![different characters](/Images/options/chars.png) |\n| Longer leaves        | ![longer leaves](/Images/options/leafy.png)        |\n\n## Tree Types :leaves:\n\nPyBonsai supports 4 different tree types. Unless specified with the `--type` option, the tree type will be chosen at random.\n\nAll tree types are generated recursively and are, essentially, variations on [this](https://www.youtube.com/watch?v=0jjeOYMjmDU) basic fractal tree.\n\n| Type             | Image                                       | Description                                                                                                              |\n| ---------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| Classic          | ![classic](/Images/types/classic.png)       | The number of child branches is normally distributed with $\\mu = 2$ and $\\sigma = 0.5$.                                  |\n| Fibonacci        | ![fib](/Images/types/fib.png)               | The number of branches on the $n^{th}$ layer is the $n^{th}$ fibonacci number.                                           |\n| Offset fibonacci | ![offset fib](/Images/types/offset_fib.png) | Similar to above, except child branches grow in the middle of the parent as well as the end.                             |\n| Random fibonacci | ![random fib](/Images/types/rand_fib.png)   | Similar to above, except child branches grow at random positions on the parent and leaves can grow in the middle layers. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBen-Edwards44%2FPyBonsai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBen-Edwards44%2FPyBonsai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBen-Edwards44%2FPyBonsai/lists"}