{"id":17703420,"url":"https://github.com/randoragon/bashdraw","last_synced_at":"2026-05-08T14:09:21.855Z","repository":{"id":176069833,"uuid":"204071372","full_name":"randoragon/BashDraw","owner":"randoragon","description":"A compact module for drawing pixels in a command line environment. Windows and GNU/Linux only.","archived":false,"fork":false,"pushed_at":"2019-08-31T07:51:57.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T04:11:42.901Z","etag":null,"topics":["cli","linux","python-module","python3","terminal-colors","windows"],"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/randoragon.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":"2019-08-23T21:19:52.000Z","updated_at":"2022-03-17T20:20:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c09ae03-b01d-4fb2-8b82-d7ddb6c42bd3","html_url":"https://github.com/randoragon/BashDraw","commit_stats":null,"previous_names":["randoragon/bashdraw"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/randoragon/BashDraw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2FBashDraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2FBashDraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2FBashDraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2FBashDraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randoragon","download_url":"https://codeload.github.com/randoragon/BashDraw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2FBashDraw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268330933,"owners_count":24233152,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","linux","python-module","python3","terminal-colors","windows"],"created_at":"2024-10-24T20:22:57.217Z","updated_at":"2026-05-08T14:09:16.826Z","avatar_url":"https://github.com/randoragon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BashPython\n\nAll modules are written in Python 3.7. They are not available via PyPi or anything alike, you have to download the python file and import it from your working directory.\n\n## BashDraw Module\n\nThis module lets you define a rectangular canvas inside a command line environment, and draw basic shapes in various colors inside it.\n\n### Example 1\n\n```python\nimport bashdraw as bd\n\nd = bd.Display(25, 25)  # Initialize a 25x25 pixels display\nd.NewState('MyState')   # You need at least 1 state to be able to draw, use any object as identifier\nd.SetState('MyState')   # Set the working state to 'MyState'\nd.Clear('MyState')      # This resets the entire 'MyState' canvas to pitch black. Omit the state parameter to use the last set state.\n\nf1 = bd.Point(0, 0, 'white')    # Create a Point figure at coordinates 0, 0 and white color\nd.DrawFigure(f1)                # Draw the point to the display.\nd.DrawFigure(f1, 'MyState')     # This line and above are identical in this context, if no state parameter is specified, the last set state is used implicitly\nd.Draw()                        # Draw the current state to the terminal.\n```\n\nHere's the output of the above code:\n\n![Imgur](https://i.imgur.com/m9Fd6xy.png)\n\n### Documentation (v1.0.0)\n\n#### Available Figures\n\n1. Point(x, y, color = 'white')\n2. Rectangle(x0, y0, width, height, fill = False, color = 'white') **OR** Rectangle.FromPoints(p0, p1, fill = False, color = 'white')\n3. Line(x0, y0, x1, y1, color = 'white') **OR** Line.FromPoints(p0, p1, color = 'white')\n4. Triangle(x0, y0, x1, y1, x2, y2, fill = True, color = 'white') **OR** Triangle.FromPoints(p0, p1, p2, fill = True, color = 'white')\n4. Chain(p0, p1, ..., pn, color = 'white') - this draws a serie of connected Lines\n5. Spline(type, p0, p1, ..., pn, color = 'white') - type can be either Spline.BEZIER or Spline.CATMULL_ROM\n\n- ``x, y`` parameters refer to integer x and y position of the display.\n- ``p0, p1`` parameters refer to Point objects.\n\n#### Available Colors\n\nThe following colors are accepted as parameters, but whether or not some of them display properly will depend on your OS and CLI:\n\n- 'white'\n- 'red'\n- 'green'\n- 'blue'\n- 'yellow'\n- 'magenta'\n- 'cyan'\n- 'grey'\n- 'black'\n\n#### Horizontal Alignment\n\nYou can control where the display will be drawn by passing an optional align parameter:\n\n```python\nimport bashdraw as bd\n\nd = bd.Display(10, 10, bd.LEFT)     # This is the default setting\nd = bd.Display(10, 10, bd.CENTER)\nd = bd.Display(10, 10, bd.RIGHT)\n```\n\n#### Dependencies\n\nYou will need these modules installed with Python 3:\n\n- termcolor\n- colorama\n- Color_Console\n- math\n- shlex\n- struct\n- platform\n- subprocess\n\n### Example 2\n\n```python\nimport bashdraw as bd\n\nd = bd.Display(20, 20, bd.CENTER)\nd.NewState(0)\nd.SetState(0)\n\nd.DrawFigure(bd.Rectangle(0, 0, 20, 20, 'yellow', True))\nd.DrawFigure(bd.Spline(bd.Spline.BEZIER, bd.Point(4, 14), bd.Point(7, 16), bd.Point(13, 15), bd.Point(16, 11), 'red'))\nd.DrawFigure(bd.Line(6, 5, 6, 7, 'cyan'))\nd.DrawFigure(bd.Line(13, 5, 13, 7, 'cyan'))\n\nd.Draw()\n```\n\nThis gives the following output:\n\n![Imgur](https://i.imgur.com/UwwWJRc.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandoragon%2Fbashdraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandoragon%2Fbashdraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandoragon%2Fbashdraw/lists"}