Skip to main content

A Console Framework for Interactive Applications

Project description

Alt text


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 in user_value.
  • multi_choice(question: str, options: list) -> None: Prompts the user to select from options. Result is stored in user_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

  1. Inherit from Plugin:
from consolar.plugin_manger import Plugin
class MyPlugin(Plugin):
    def run(self):
        print("MyPlugin is running!")
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

consolar-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

consolar-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for consolar-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d04b59ce9537b0f8e4464f95c09c43f13e062aa14de8048925f1daabdf8bf010
MD5 de7a8c2efe7872179234315e3c19f2df
BLAKE2b-256 d3a00d466d550fedee1b999f9301fdf3a523cd7b6c41f11364e912a1c14284d2

See more details on using hashes here.

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

Hashes for consolar-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 373876d21f59e091d349b5db6c1d6c2de40944c7096eda261c62bda04cdef205
MD5 8e2b2d869a2343434423425ca13f0b24
BLAKE2b-256 dec04534f4f117fd3dcf5984895c02ed7fc298d04968ef23cdba8ecc6d927cc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page