Name | consolio JSON |
Version |
0.1.6
JSON |
| download |
home_page | None |
Summary | A simple terminal I/O utility with spinner animation |
upload_time | 2024-11-18 22:16:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Ioannis D. (devcoons) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
consolio
terminal
color
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Consolio
[![PyPI - Version](https://img.shields.io/pypi/v/consolio?style=for-the-badge)](https://pypi.org/project/consolio)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/consolio?style=for-the-badge)
![GitHub License](https://img.shields.io/github/license/devcoons/consolio?style=for-the-badge)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/consolio?style=for-the-badge&color=%23F0F)
`Consolio` is a Python library that provides an elegant way to display progress updates, warnings, errors, and other status messages in the console with color-coded indicators and spinners. Ideal for CLI applications that require step-by-step feedback to users.
## Table of Contents
- [Installation](#installation)
- [Features](#features)
- [Usage](#usage)
- [Basic Initialization](#basic-initialization)
- [Status Message Types](#status-message-types)
- [Spinners](#spinners)
- [Customization](#customization)
## Installation
Consolio does not require any dependencies outside of Python's standard library. To use it just install it using `pip install consolio`.
## Features
- Color-coded messages for different statuses: Success, Error, Warning, and more.
- Progress spinners in various styles (`dots`, `braille`, `default`).
- Inline spinners for seamless progress tracking within a single line.
- Thread-safe output for smooth and consistent console display.
## Usage
### Basic Initialization
To get started, initialize `Consolio` with a desired spinner type. You can choose from `dots`, `braille`, or `default`.
```
from consolio import Consolio
console = Consolio(spinner_type='dots') # Initialize with dots spinner
```
### Status Message Types
Consolio supports multiple status messages, each with a unique color and symbol:
- **Info**: `[!]` Blue - Marks the start of a process
- **Work(Step)**: `[-]` Cyan - Intermediate step in a process
- **Warning**: `[!]` Yellow - Displays warnings
- **Error**: `[x]` Red - Displays errors
- **Complete**: `[v]` Green - Indicates completion of a step or process
Use the `print` method to print messages with a specific status, indentation level, and replacement option:
```
console.print(indent=0, status="inf", text="Starting process")
console.print(indent=1, status="wip", text="Executing step 1")
console.print(indent=1, status="wrn", text="Warning: Check your input")
console.print(indent=1, status="err", text="Error: Process failed")
console.print(indent=0, status="cmp", text="Process complete")
```
### Spinners
You can start a spinner to indicate an ongoing process using the `start_animate` method, then stop it using `stop_animate`.
```
console.start_animate(indent=1)
# Perform a time-consuming task here
time.sleep(3) # Simulating task duration
console.stop_animate()
```
Use the `inline_spinner=True` option to display the spinner on the same line as the last message:
```
console.print(1, "stp", "Calculating size")
console.start_animate(inline_spinner=True)
time.sleep(2)
console.stop_animate()
```
### Customization
The `Consolio` library supports a few customization options:
- **Spinner Type**: Set `spinner_type` to `dots`, `braille`, or `default`.
- **Indentation Level**: Control indentation level in messages for organized output.
- **Inline Spinner**: Use `inline_spinner=True` to keep spinners on the same line as a message.
- **Replacement Mode**: Set `replace=True` in `sprint` to overwrite the previous message line.
Raw data
{
"_id": null,
"home_page": null,
"name": "consolio",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "consolio, terminal, color",
"author": null,
"author_email": "\"Ioannis D (devcoons)\" <support@devcoons.com>",
"download_url": "https://files.pythonhosted.org/packages/38/ca/a6d243c4b1f8df0ff47d938d31bb94e62b02f4b6d91059ba7f6ab70be543/consolio-0.1.6.tar.gz",
"platform": null,
"description": "# Consolio\n\n[![PyPI - Version](https://img.shields.io/pypi/v/consolio?style=for-the-badge)](https://pypi.org/project/consolio)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/consolio?style=for-the-badge)\n![GitHub License](https://img.shields.io/github/license/devcoons/consolio?style=for-the-badge)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/consolio?style=for-the-badge&color=%23F0F)\n\n`Consolio` is a Python library that provides an elegant way to display progress updates, warnings, errors, and other status messages in the console with color-coded indicators and spinners. Ideal for CLI applications that require step-by-step feedback to users.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Features](#features)\n- [Usage](#usage)\n - [Basic Initialization](#basic-initialization)\n - [Status Message Types](#status-message-types)\n - [Spinners](#spinners)\n- [Customization](#customization)\n\n## Installation\n\nConsolio does not require any dependencies outside of Python's standard library. To use it just install it using `pip install consolio`.\n\n## Features\n\n- Color-coded messages for different statuses: Success, Error, Warning, and more.\n- Progress spinners in various styles (`dots`, `braille`, `default`).\n- Inline spinners for seamless progress tracking within a single line.\n- Thread-safe output for smooth and consistent console display.\n\n## Usage\n\n### Basic Initialization\n\nTo get started, initialize `Consolio` with a desired spinner type. You can choose from `dots`, `braille`, or `default`.\n\n```\nfrom consolio import Consolio\n\nconsole = Consolio(spinner_type='dots') # Initialize with dots spinner\n```\n\n### Status Message Types\n\nConsolio supports multiple status messages, each with a unique color and symbol:\n\n- **Info**: `[!]` Blue - Marks the start of a process\n- **Work(Step)**: `[-]` Cyan - Intermediate step in a process\n- **Warning**: `[!]` Yellow - Displays warnings\n- **Error**: `[x]` Red - Displays errors\n- **Complete**: `[v]` Green - Indicates completion of a step or process\n\nUse the `print` method to print messages with a specific status, indentation level, and replacement option:\n\n```\nconsole.print(indent=0, status=\"inf\", text=\"Starting process\")\nconsole.print(indent=1, status=\"wip\", text=\"Executing step 1\")\nconsole.print(indent=1, status=\"wrn\", text=\"Warning: Check your input\")\nconsole.print(indent=1, status=\"err\", text=\"Error: Process failed\")\nconsole.print(indent=0, status=\"cmp\", text=\"Process complete\")\n```\n\n### Spinners\n\nYou can start a spinner to indicate an ongoing process using the `start_animate` method, then stop it using `stop_animate`.\n\n```\nconsole.start_animate(indent=1)\n# Perform a time-consuming task here\ntime.sleep(3) # Simulating task duration\nconsole.stop_animate()\n```\n\nUse the `inline_spinner=True` option to display the spinner on the same line as the last message:\n\n```\nconsole.print(1, \"stp\", \"Calculating size\")\nconsole.start_animate(inline_spinner=True)\ntime.sleep(2)\nconsole.stop_animate()\n```\n### Customization\n\nThe `Consolio` library supports a few customization options:\n\n- **Spinner Type**: Set `spinner_type` to `dots`, `braille`, or `default`.\n- **Indentation Level**: Control indentation level in messages for organized output.\n- **Inline Spinner**: Use `inline_spinner=True` to keep spinners on the same line as a message.\n- **Replacement Mode**: Set `replace=True` in `sprint` to overwrite the previous message line.\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Ioannis D. (devcoons) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "A simple terminal I/O utility with spinner animation",
"version": "0.1.6",
"project_urls": {
"Homepage": "https://github.com/devcoons/consolio",
"Issues": "https://github.com/devcoons/consolio/issues"
},
"split_keywords": [
"consolio",
" terminal",
" color"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "20212a0288442f63649bd5d44f7a40cbae935d9633f7c9bafc931c9ff5b9ab2d",
"md5": "6999f4f8d83e1d9e72b6dba643786f8b",
"sha256": "c0b73bae941434f041e20d426eef3c217ab7952d16a730150543fef03351b778"
},
"downloads": -1,
"filename": "consolio-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6999f4f8d83e1d9e72b6dba643786f8b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7742,
"upload_time": "2024-11-18T22:15:59",
"upload_time_iso_8601": "2024-11-18T22:15:59.320600Z",
"url": "https://files.pythonhosted.org/packages/20/21/2a0288442f63649bd5d44f7a40cbae935d9633f7c9bafc931c9ff5b9ab2d/consolio-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "38caa6d243c4b1f8df0ff47d938d31bb94e62b02f4b6d91059ba7f6ab70be543",
"md5": "043ba5fe7961f4ffbd5c07884ce09a3f",
"sha256": "bbacb3b04064a8b21ed56579fd83c90b39dc3fbc91314d889a107a94c20b80cf"
},
"downloads": -1,
"filename": "consolio-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "043ba5fe7961f4ffbd5c07884ce09a3f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8050,
"upload_time": "2024-11-18T22:16:01",
"upload_time_iso_8601": "2024-11-18T22:16:01.335912Z",
"url": "https://files.pythonhosted.org/packages/38/ca/a6d243c4b1f8df0ff47d938d31bb94e62b02f4b6d91059ba7f6ab70be543/consolio-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 22:16:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "devcoons",
"github_project": "consolio",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "consolio"
}