A Console Framework for Interactive Applications
Project description
ConSolar Framework Documentation
Overview
ConSolar is a console framework for building extensible console applications with plugin support.
Getting Started
Installation
Clone the repository and install dependencies from requirements.txt using pip install -r requirements.txt.
Basic Usage
from consolar import user, Framework, Plugin, load_plugin
# Create a user input
user.user_input("Enter your name:")
print(user.user_value)
API Reference
class user
user_input(question: str) -> None: Prompts the user for input. Result is stored inuser_value.multi_choice(question: str, options: list) -> None: Prompts the user to select from options. Result is stored inuser_value.user_value: Stores the last answer from user input or choice.
class Framework
register_plugin(plugin: Plugin): Registers a plugin instance.plugins: List of registered plugins.
class Plugin
run(): Method to be implemented by plugins.
function load_plugin(module_name: str, class_name: str) -> Plugin
Dynamically loads a plugin class from a module.
Writing Plugins
- Inherit from
Plugin:
from consolar.plugin_manger import Plugin
class MyPlugin(Plugin):
def run(self):
print("MyPlugin is running!")
- Register with the framework:
from consolar.plugin_manger import Framework
fw = Framework()
fw.register_plugin(MyPlugin())
Logger
- automaticly log the target with toggble visbilty
from consolar.logger import log
x = input("foo bar? ")
log(target= x, show_target= True, repeat= 1)
Error Handling
- Plugin registration errors are printed to the console.
Contribution
- Fork the repo, add features, and submit pull requests.
License
MIT
Copyright (c) 2025 Samyar Sharafi
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file consolar-0.0.1.tar.gz.
File metadata
- Download URL: consolar-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d04b59ce9537b0f8e4464f95c09c43f13e062aa14de8048925f1daabdf8bf010
|
|
| MD5 |
de7a8c2efe7872179234315e3c19f2df
|
|
| BLAKE2b-256 |
d3a00d466d550fedee1b999f9301fdf3a523cd7b6c41f11364e912a1c14284d2
|
File details
Details for the file consolar-0.0.1-py3-none-any.whl.
File metadata
- Download URL: consolar-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
373876d21f59e091d349b5db6c1d6c2de40944c7096eda261c62bda04cdef205
|
|
| MD5 |
8e2b2d869a2343434423425ca13f0b24
|
|
| BLAKE2b-256 |
dec04534f4f117fd3dcf5984895c02ed7fc298d04968ef23cdba8ecc6d927cc9
|