CLight is a Python command-line interface application. A lightweight Framework that simplifies CLI app development and the package distribution process, with automatic deployment strategies from Local, GitHub and GitLab environments.
Project description
CLight v2.1.0
Project: CLight
Version: 2.1.0
OS: Microsoft / Windows
Author: Irakli Gzirishvili
Mail: gziraklirex@gmail.com
CLight is a Python command-line interface application. A lightweight Framework that simplifies CLI app development and the package distribution process, with automatic deployment strategies from Local, GitHub and GitLab environments.
Installation
To use CLight, follow these steps:
- Open CMD as administrator and run the following command to install
pip install clightthen restart your CMD - To check if CLight is installed correctly, run the following command
clight
Runn CMD as administrator
Commands
These are the available commands you can use:
clight- To list available commandsclight new- Create new projectclight add- Add existing project to catalogclight module (name)- Create new moduleclight reform (-t)- Edit project params, (-t) to skip templatesclight version- Upgrade semantic version number of the projectclight all- List existing projectsclight publish (-t)- Publish project on PyPI, (-t) to test locallyclight remove (project)- Remove projectclight pypidel- Delete PyPI credentialsclight install- Test the installation process locallyclight update- Update local installation testclight uninstall- Test the uninstallation process locally
Rules
Don't remove these items from the project's .system folder:
- modules - Folder for your custom modules
- sources - Folder for system resources
- imports.py - File to import pip and your custom packages
- index.py - Index file, defining the main CLI commands that users will interact with
The index and module files are constructed with 3 sections of code:
- Load - Section for initializing your project and running some scripts before executing required command
- Main - CLI command methods with name, arguments and description
- Helpers - Private methods used to support the Main methods
You don't need anything else, this is the simplest CLI application framework interface to save your time
Shared cli Methods
These are basic methods from the clight package class called cli that you can use in your index and module files:
cli.error("message")- Print an error message in redcli.info("message")- Print an info message in bluecli.hint("message")- Print a hint in yellowcli.done("message")- Print a completion message in greencli.trace("message")- Print hidden developer message, activate dev mode withcli.dev = Truecli.input("hint")- Define CLI input fieldcli.selection("hint", ["A", "B"])- Define selection input fieldcli.selections("hint", ["A", "B"])- Define multiple selection input fieldcli.confirmation("hint")- Define confirmation input fieldcli.value("key", {...}, "default")- Get value from datacli.sound("done")- Set system sound - start, ready, done, error, ask, set or unsetcli.speak("text")- Read text with voicecli.listen()- Listen and convert speech to textcli.read("Folder/file.txt")- Read file and get contentcli.write("Folder/file.txt", "content")- Write file with contentcli.append("Folder/file.txt", "content")- Append content to the filecli.yaml("Folder/file.yaml")- Read and convert YAML file as dictcli.template("content", {...})- Parse template content with given key-value pairscli.chars(10)- Get random characters with given lengthcli.isValue(value)- Check if value existscli.isPath(path)- Check if path existscli.isFile(file)- Check if file existscli.isFolder(folder)- Check if folder existscli.execute("cmd", "message")- Execute CMD commandcli.encrypt("data", "key")- Encrypt data by keycli.decrypt("encrypted", "key")- Decrypt encrypted data by key
Specifying Parameters
When creating your new project, you will be asked to fill a simple form just once, to specify your project's configuration parameters:
- Name - Name of your project
required - Version - Version of your project
required - Description - Description of your project
required - Link - Link to your project
- CMD - CMD name alias for your project
required - Author - Author of the project
required - Mail - Mail of the project author
required - Project Type - Type of the project
required - Repository Type - Project repository type
required - License - License for your project
- Operating System - Required operating system for your project
required
Project Type: Select
Appto develop a new CLI application, or selectModuleto develop a single pip module
Specifying Repository Type
At this stage, CLight works with 3 types of project repository environments:
- Local - Publishing projects from your local development Windows environment to PyPI
- GitHub - Automated deployment process to PyPI once you push changes to the main branch
- GitLab - Automated deployment process to PyPI once you push changes to the main branch
PyPI is the official third-party package repository for the Python programming language. It hosts and distributes software packages for developers to use. Developers can upload Python packages to PyPI, where they can be easily accessed by others. Anyone can then download them using the
pip install <package>command
Specifying License
When creating a project with CLight, you can include one of the 8 OSI-Approved license types:
- MIT License
- BSD License
- ISC License (ISCL)
- Apache Software License
- Mozilla Public License 2.0 (MPL 2.0)
- GNU Affero General Public License v3
- GNU General Public License v3 (GPLv3)
- GNU Lesser General Public License v3 (LGPLv3)
Specifying Operating System
When creating a project with CLight, you should specify the OS environment for your project:
- OS Independent
- Microsoft / Windows
- POSIX / Linux
- MacOS
Deployment
Before publishing your updated project, according to PyPI rules, you must increase your project's version number:
- Navigate to your project's root directory using CMD and run
clight reform - Skip everything else, and only edit the Version parameter's value
Based on your selected Repository Type, the project will be deployed to PyPI in the following ways:
-
Local - Publishing projects from your local development Windows environment to PyPI
- Navigate to your project's root directory using CMD and run
clight publish - If this is your first time, provide your PyPI
PYPI_USERNAMEandPYPI_API_TOKEN - Then choose whether to save your credentials or not
- If you choose to save your credentials, provide a
Password Keyto encrypt them - That's it. The next time, you will just be asked for the Password Key
- Navigate to your project's root directory using CMD and run
-
GitHub - Automated deployment process to PyPI once you push changes to the main branch
- Nothing to do, just push the changes
-
GitLab - Automated deployment process to PyPI once you push changes to the main branch
- Nothing to do, just push the changes
Note: You must add PyPI credentials as repository secure variables in GitHub and GitLab with these names:
PYPI_USERNAMEandPYPI_API_TOKEN
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 clight-2.1.0.tar.gz.
File metadata
- Download URL: clight-2.1.0.tar.gz
- Upload date:
- Size: 416.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2ee9c2e77211724b7855b2a14c913cea44edb10ea06e21275d524f53893fc8a
|
|
| MD5 |
9737fb210d54c42e88e2be5536395b80
|
|
| BLAKE2b-256 |
642c54738fccf4a58d2de63bcdb2cefae8d8e4e5d21c69435690aee93bb35b32
|
File details
Details for the file clight-2.1.0-py3-none-any.whl.
File metadata
- Download URL: clight-2.1.0-py3-none-any.whl
- Upload date:
- Size: 417.3 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 |
6584a288438862670a15f484e76cad9bc3d4edfe35de244f2a1ee79e3057b996
|
|
| MD5 |
f0924aa8a5c5e9d25237e6e34217c0a1
|
|
| BLAKE2b-256 |
ed58d445d89cce302f68ec6385bd1f8b4c7b60f9a728f28da9e320f827c265ed
|