nc-console
The programmatic consoler.
Checkout the official documentation at nc-console.netlify.app
Official PYPI link : pypi
Now it's quite easy to log the status and take inputs from the terminal using nc-colsole.
Introduction
nc-console provides you a clean, understandable and programmatic overview to log your data on the terminal or take inputs from the terminal.
It's internally using the click module from palletsprojects to deliver such services.
Requirements
To use this module you must need to use Python version 3.6 or grater than it.
This module requires the following modules:
- click==8.0.1
Installation
You can install the package from the official PYPI:
pip install nc-console
You can install it directly from the source code:
git clone https://github.com/marktennyson/nc-console.git && cd nc-colsole
python setup.py install
Usage
Implementation of logging system.
It gives you a very logical way to print your logging output.
For a basic example:
from nc_console import Console
Console.log.Info("This is the first info message.")
And the output will be:
[ INFO ] This is the first info message.
Available options/methods to print the different log:
Console.log.Info() # to log a info type message.
Console.log.Warning() # to log a warning type message.
Console.log.Success() # to log a success type message.
Console.log.Error() # to log a error type message.
- The default colour for type
infoisbright_blue. - The default colour for type
successisbright_green. - The default colour for type
warningisbright_magenta. - The default colour for type
Errorisbright_red. - The default colour for
messageisyellow.
It's very easy to change the default colours. To do this please go with the below mentioned steps:
from nc_console import Console
Console.setLogConfig(
box_colour="cyan"
type_info_colour="red"
...
)
So using the setLogConfig method you can adjust the default colours.
Available parameters for the setLogConfig method are:
- box_colour : to change the box([]) colour.
- msg_colour : to change the colour of message.
- type_info_colour : to change the base colour for the type info.
- type_success_colour : to change the base colour for the type success.
- type_warning_colour : to change the base colour for the type warning.
- type_error_colour : to change the base colour for the type error.
All of the colours accept the default available colour for click.style.
Implementation of input system.
Beside the logging system this module is able to take inputs from the terminal too. This system will give you the feel like Java.
For a basic example:
from nc_console import Console
#To take a string based input from the terminal
name = Console.input.String("Enter your name: ")
#To take a Integer based input from the terminal
age = Console.input.Integer("Enter your age: ")
The output will be:
[INPUT STRING] Enter your name:
[INPUT INTEGER] Enter your age:
Available options/methods to take different types of input from the terminal:
Console.input.String() # to take a string type input.
Console.input.Password() # to take a password type input.
Console.input.Integer() # to take a integer type input.
Console.input.Float() # to take a float type input.
Console.input.Boolean() # to take a blooean type input(Y/n).
- The default colour for
typeisbright_blue. - The default colour for
messageisyellow.
It's very easy to change the default colours for the input system too. To do this please go with the below mentioned steps:
from nc_console import Console
Console.setInputConfig(
box_colour="cyan"
msg_colour="red"
...
)
So using the setInputConfig method you can adjust the default colours.
Available parameters for the setLogConfig method are:
- box_colour : to change the box([]) colour.
- msg_colour : to change the colour of message.
- base_colour : to change the base colour for the input text.
- type_colour : to change the input type colour.
All of the colours accept the default available colour for click.style.
Maintainers
Current Maintainers:
- Aniket sarkar aka marktennyson
Contributors
Current Contributors:
Contribution
If you want to become a contributor of this project then please contact me at => aniketsarkar@yahoo.com or follow the below mentioned steps.
- Fork and clone this repository.
- Make some changes as required.
- Write unit test to showcase its functionality.
- Submit a pull request under
developmentbranch.
Metadata
Release files for nc-console 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nc-console-0.1.0.tar.gz | 8.8 kB | Without provenance | Details for nc-console-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nc_console-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nc_console-0.1.0-py3-none-any.whl |
Total release size: 16.2 kB
Release files / nc-console-0.1.0.tar.gz
| Download URL | nc-console-0.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f5701ad729f031ece8e74a9363773e0bd9ef7678d64895217041ab80b58598b
|
|
BLAKE2b-256 checksum How to use checksums |
027ddc692ea01aa0501164b94224a0cb7f6ebaa0f0d191e1c0ba7cc7769c4371
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / nc_console-0.1.0-py3-none-any.whl
| Download URL | nc_console-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca3a75f7b0f14fb74f923f51ab3f779d8a88a1f7660098fc28aceef448e475d2
|
|
BLAKE2b-256 checksum How to use checksums |
3e923b5a5ddf5898643c9b7080d25e2f9eeee8d6458f697fb1ced2c93d1dca73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for nc-console 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.