wolfsoftware.drawlines
A python package that allows you to draw multiple different types of lines on the console.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.4%) to scientific vocabulary
Keywords
Repository
A python package that allows you to draw multiple different types of lines on the console.
Basic Info
Statistics
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 3
- Releases: 5
Topics
Metadata Files
README.md
Overview
A 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.
Features
- Customizable text positions: left, right, or center.
- Support for various text colors and styles including bold.
- Adjustable line width and padding.
- Uses
coloramafor color and style handling, ensuring compatibility across different operating systems.
Installation
shell
pip install wolfsoftware.drawlines
Usage
The main functionality is provided by the draw_line function, which can be used to create lines in the terminal with or without text.
Function Signature
```python def drawline(text='', position='center', fillchar='-', pad=2, width=-1, color=''): """ Draw a line across the terminal with optional text.
Args:
text (str): Text to include in the line. Defaults to '' (no text).
position (str): Position of the text ('left', 'right', 'center'). Defaults to 'center'.
fill_char (str): Character used to fill the line. Defaults to '-'.
pad (int): Padding characters around the text. Defaults to 2.
width (int): Total width of the line; defaults to the terminal width if set to -1.
color (str): Color and style of the text, e.g., 'red', 'blue+bold'. Defaults to no color.
"""
```
Examples
1. Simple line with default settings
```python from yourmodule import drawline
Draw a simple dashed line
print(draw_line()) ```
Output
```shell
```
2. Line with centered text and custom color
```python
Draw a line with centered text
print(draw_line(text="Hello, World!", position='center')) ```
Output
shell
------------------------------------- Hello, World! --------------------------------------
If you set the
fill_char=' 'you will simply get centered text with no line.
3. Line with left-aligned text and custom fill character
```python
Draw a line with left-aligned text and asterisk fill character
print(drawline(text="Left aligned text", position='left', fillchar='*')) ```
Output
shell
** Left aligned text *********************************************************************
Customization
This 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:
| Name | Default Value | Purpose | Allowed Values | | :-------- | :-----------: | :--------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | text | '' | Any string you want to display within the line. | Any string | | position | 'center' | Where to place the text. | 'left', 'center', 'right' | | fillchar | '-' | The character to use when drawing the line. If more than one is given, only the first is used. | Any single character | | leftpad | 2 | How many fillchars to use as a prefix when aligning the text left. | Any positive integer | | rightpad | 2 | How many fill_chars to use as a postfix when aligning the text right. | Any positive integer | | 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 | | 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' | | bold | False | Should the text be bold. This can be used with or without a defined color. | True, False |
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.
Owner
- Name: Developers Toolbox
- Login: DevelopersToolbox
- Kind: organization
- Email: github@wolfsoftware.com
- Location: United Kingdom
- Website: https://wolfsoftware.com
- Twitter: wolfsoftware
- Repositories: 24
- Profile: https://github.com/DevelopersToolbox
A selection of tools to help developers. Created by Wolf Software.
Citation (CITATION.cff)
cff-version: 1.2.0
message: If you use this software, please cite it using these metadata.
title: Draw Lines
abstract: Draw lines on the console with optional text.
type: software
version: 0.1.3
date-released: 2024-06-25
repository-code: https://github.com/DevelopersToolbox/draw-lines-package
keywords:
- "Wolf Software"
- "Software"
license: MIT
authors:
- family-names: "Wolf"
orcid: "https://orcid.org/0009-0007-0983-2072"
GitHub Events
Total
- Delete event: 76
- Issue comment event: 156
- Push event: 132
- Pull request review event: 115
- Pull request event: 153
- Create event: 80
Last Year
- Delete event: 76
- Issue comment event: 156
- Push event: 132
- Pull request review event: 115
- Pull request event: 153
- Create event: 80
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 0
- Total pull requests: 118
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 1.72
- Merged pull requests: 92
- Bot issues: 0
- Bot pull requests: 117
Past Year
- Issues: 0
- Pull requests: 85
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.76
- Merged pull requests: 63
- Bot issues: 0
- Bot pull requests: 85
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (178)
- TGWolf (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 482 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
pypi.org: wolfsoftware.drawlines
Draw lines on the console with optional text.
- Homepage: https://github.com/DevelopersToolbox/draw-lines-package
- Documentation: https://github.com/DevelopersToolbox/draw-lines-package
- License: MIT
-
Latest release: 0.1.3
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- citation-file-format/cffconvert-github-action 4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 composite
- ruby/setup-ruby 0cde4689ba33c09f1b890c1725572ad96751a3fc composite
- Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- github/codeql-action/analyze a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
- github/codeql-action/autobuild a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
- github/codeql-action/init a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
- Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
- Mattraks/delete-workflow-runs 39f0bbed25d76b34de5594dceab824811479e5de composite
- dependabot/fetch-metadata 5e5f99653a5b510e8555840e80cbf1514ad4af38 composite
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- actions/setup-node 60edb5dd545a775178f52524783378180af0d1f8 composite
- ruby/setup-ruby 0cde4689ba33c09f1b890c1725572ad96751a3fc composite
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
- actions/first-interaction 34f15e814fe48ac9312ccf29db4e74fa767cbab7 composite
- Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
- otto-de/purge-deprecated-workflow-runs 31a4e821d43e9a354cbd65845922c76e4b4b3633 composite
- ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- actions/setup-go cdcb36043654635271a94b9a6d1392de5bb323a7 composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
- zgosalvez/github-actions-ensure-sha-pinned-actions 2f2ebc6d914ab515939dc13f570f91baeb2c194c composite
- Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
- actions/stale 28ca1036281a5e5922ead5184a1bbf96e5fc984e composite
- colorama ==0.4.6
- setuptools ==70.0.0