{"id":22316688,"url":"https://github.com/developerstoolbox/draw-lines-package","last_synced_at":"2025-07-29T12:30:37.355Z","repository":{"id":240901552,"uuid":"803512533","full_name":"DevelopersToolbox/draw-lines-package","owner":"DevelopersToolbox","description":"A python package that allows you to draw multiple different types of lines on the console.","archived":false,"fork":false,"pushed_at":"2024-11-18T04:53:53.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-18T05:35:09.798Z","etag":null,"topics":["draw-lines","pypi","pypi-package","python","python-package","wolfsoftware"],"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/DevelopersToolbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["WolfSoftware","TGWolf"]}},"created_at":"2024-05-20T21:36:26.000Z","updated_at":"2024-11-18T04:53:57.000Z","dependencies_parsed_at":"2024-06-24T05:40:02.164Z","dependency_job_id":"9fba3313-5464-463e-a131-b0cbf11705f4","html_url":"https://github.com/DevelopersToolbox/draw-lines-package","commit_stats":null,"previous_names":["developerstoolbox/draw-lines-package"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fdraw-lines-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fdraw-lines-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fdraw-lines-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fdraw-lines-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevelopersToolbox","download_url":"https://codeload.github.com/DevelopersToolbox/draw-lines-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228012341,"owners_count":17855984,"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":["draw-lines","pypi","pypi-package","python","python-package","wolfsoftware"],"created_at":"2024-12-03T23:07:27.650Z","updated_at":"2024-12-03T23:07:28.408Z","avatar_url":"https://github.com/DevelopersToolbox.png","language":"Python","readme":"\u003c!-- markdownlint-disable --\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/\"\u003e\n        \u003cimg src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png\" alt=\"DevelopersToolbox logo\" /\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/actions/workflows/cicd.yml\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/draw-lines-package/cicd.yml?branch=master\u0026label=build%20status\u0026style=for-the-badge\" alt=\"Github Build Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/blob/master/LICENSE.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/DevelopersToolbox/draw-lines-package?color=blue\u0026label=License\u0026style=for-the-badge\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/created-at/DevelopersToolbox/draw-lines-package?color=blue\u0026label=Created\u0026style=for-the-badge\" alt=\"Created\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/DevelopersToolbox/draw-lines-package?color=blue\u0026label=Latest%20Release\u0026style=for-the-badge\" alt=\"Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release-date/DevelopersToolbox/draw-lines-package?color=blue\u0026label=Released\u0026style=for-the-badge\" alt=\"Released\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commits-since/DevelopersToolbox/draw-lines-package/latest.svg?color=blue\u0026style=for-the-badge\" alt=\"Commits since release\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/blob/master/.github/CODE_OF_CONDUCT.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/blob/master/.github/CONTRIBUTING.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/blob/master/.github/SECURITY.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/draw-lines-package/issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n\nA Python module for drawing styled and colored lines in the terminal. This utility allows for the customization of line styles, colors, and text positioning, making it a versatile tool for enhancing the output of CLI applications.\n\n## Features\n\n- Customizable text positions: left, right, or center.\n- Support for various text colors and styles including bold.\n- Adjustable line width and padding.\n- Uses `colorama` for color and style handling, ensuring compatibility across different operating systems.\n\n## Installation\n\n```shell\npip install wolfsoftware.drawlines\n```\n\n## Usage\n\nThe main functionality is provided by the `draw_line` function, which can be used to create lines in the terminal with or without text.\n\n### Function Signature\n\n```python\ndef draw_line(text='', position='center', fill_char='-', pad=2, width=-1, color=''):\n    \"\"\"\n    Draw a line across the terminal with optional text.\n\n    Args:\n        text (str): Text to include in the line. Defaults to '' (no text).\n        position (str): Position of the text ('left', 'right', 'center'). Defaults to 'center'.\n        fill_char (str): Character used to fill the line. Defaults to '-'.\n        pad (int): Padding characters around the text. Defaults to 2.\n        width (int): Total width of the line; defaults to the terminal width if set to -1.\n        color (str): Color and style of the text, e.g., 'red', 'blue+bold'. Defaults to no color.\n    \"\"\"\n```\n\n### Examples\n\n#### 1. Simple line with default settings\n\n```python\nfrom your_module import draw_line\n\n# Draw a simple dashed line\nprint(draw_line())\n```\n\n#### Output\n\n```shell\n------------------------------------------------------------------------------------------\n```\n\n#### 2. Line with centered text and custom color\n\n```python\n# Draw a line with centered text\nprint(draw_line(text=\"Hello, World!\", position='center'))\n```\n\n#### Output\n\n```shell\n------------------------------------- Hello, World! --------------------------------------\n```\n\u003e If you set the `fill_char=' '` you will simply get centered text with no line.\n\n#### 3. Line with left-aligned text and custom fill character\n\n```python\n# Draw a line with left-aligned text and asterisk fill character\nprint(draw_line(text=\"Left aligned text\", position='left', fill_char='*'))\n```\n\n#### Output\n\n```shell\n** Left aligned text *********************************************************************\n```\n\n## Customization\n\nThis section provides details on how you can customize the `draw_line` function parameters. Below is a table listing each parameter, its default value, purpose, and allowed values:\n\n| Name      | Default Value | Purpose                                                                                        | Allowed Values                                                                                                                                                                                                    |\n| :-------- | :-----------: | :--------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| text      | ''            | Any string you want to display within the line.                                                | Any string                                                                                                                                                                                                        |\n| position  | 'center'      | Where to place the text.                                                                       | 'left', 'center', 'right'                                                                                                                                                                                         |\n| fill_char | '-'           | The character to use when drawing the line. If more than one is given, only the first is used. | Any single character                                                                                                                                                                                              |\n| left_pad  | 2             | How many fill_chars to use as a prefix when aligning the text left.                            | Any positive integer                                                                                                                                                                                              |\n| right_pad | 2             | How many fill_chars to use as a postfix when aligning the text right.                          | Any positive integer                                                                                                                                                                                              |\n| width     | -1            | How wide to draw the line. Defaults to the terminal's width minus one if not specified.        | Any integer; -1 for terminal width minus 1                                                                                                                                                                        |\n| color     | ''            | What color to make the text.                                                                   | 'bold', 'black', 'blue', 'cyan', 'green', 'grey', 'magenta', 'red', 'white', 'yellow', 'black+bold', 'blue+bold', 'cyan+bold', 'green+bold', 'grey+bold', 'magenta+bold', 'red+bold', 'white+bold', 'yellow+bold' |\n| bold      | False         | Should the text be bold. This can be used with or without a defined color.                     | True, False                                                                                                                                                                                                       |\n\n\u003e If you are adding bold to a color it **must** come after the color name. E.b. cyan+bold **NOT** bold+cyan as this will cause an exception to be thrown.\n\n\u003cbr /\u003e\n\u003cp align=\"right\"\u003e\u003ca href=\"https://wolfsoftware.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /\u003e\u003c/a\u003e\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/WolfSoftware","https://github.com/sponsors/TGWolf"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fdraw-lines-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperstoolbox%2Fdraw-lines-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fdraw-lines-package/lists"}