Skip to main content

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 clight then 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 commands
  • clight new - Create new project
  • clight add - Add existing project to catalog
  • clight module (name) - Create new module
  • clight reform (-t) - Edit project params, (-t) to skip templates
  • clight version - Upgrade semantic version number of the project
  • clight all - List existing projects
  • clight publish (-t) - Publish project on PyPI, (-t) to test locally
  • clight remove (project) - Remove project
  • clight pypidel - Delete PyPI credentials
  • clight install - Test the installation process locally
  • clight update - Update local installation test
  • clight 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:

  1. Load - Section for initializing your project and running some scripts before executing required command
  2. Main - CLI command methods with name, arguments and description
  3. 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 red
  • cli.info("message") - Print an info message in blue
  • cli.hint("message") - Print a hint in yellow
  • cli.done("message") - Print a completion message in green
  • cli.trace("message") - Print hidden developer message, activate dev mode with cli.dev = True
  • cli.input("hint") - Define CLI input field
  • cli.selection("hint", ["A", "B"]) - Define selection input field
  • cli.selections("hint", ["A", "B"]) - Define multiple selection input field
  • cli.confirmation("hint") - Define confirmation input field
  • cli.value("key", {...}, "default") - Get value from data
  • cli.sound("done") - Set system sound - start, ready, done, error, ask, set or unset
  • cli.speak("text") - Read text with voice
  • cli.listen() - Listen and convert speech to text
  • cli.read("Folder/file.txt") - Read file and get content
  • cli.write("Folder/file.txt", "content") - Write file with content
  • cli.append("Folder/file.txt", "content") - Append content to the file
  • cli.yaml("Folder/file.yaml") - Read and convert YAML file as dict
  • cli.template("content", {...}) - Parse template content with given key-value pairs
  • cli.chars(10) - Get random characters with given length
  • cli.isValue(value) - Check if value exists
  • cli.isPath(path) - Check if path exists
  • cli.isFile(file) - Check if file exists
  • cli.isFolder(folder) - Check if folder exists
  • cli.execute("cmd", "message") - Execute CMD command
  • cli.encrypt("data", "key") - Encrypt data by key
  • cli.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:

  1. Name - Name of your project required
  2. Version - Version of your project required
  3. Description - Description of your project required
  4. Link - Link to your project
  5. CMD - CMD name alias for your project required
  6. Author - Author of the project required
  7. Mail - Mail of the project author required
  8. Project Type - Type of the project required
  9. Repository Type - Project repository type required
  10. License - License for your project
  11. Operating System - Required operating system for your project required

Project Type: Select App to develop a new CLI application, or select Module to 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:

  1. MIT License
  2. BSD License
  3. ISC License (ISCL)
  4. Apache Software License
  5. Mozilla Public License 2.0 (MPL 2.0)
  6. GNU Affero General Public License v3
  7. GNU General Public License v3 (GPLv3)
  8. 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:

  1. OS Independent
  2. Microsoft / Windows
  3. POSIX / Linux
  4. MacOS

Deployment

Before publishing your updated project, according to PyPI rules, you must increase your project's version number:

  1. Navigate to your project's root directory using CMD and run clight reform
  2. 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_USERNAME and PYPI_API_TOKEN
    • Then choose whether to save your credentials or not
    • If you choose to save your credentials, provide a Password Key to encrypt them
    • That's it. The next time, you will just be asked for the Password Key
  • 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_USERNAME and PYPI_API_TOKEN

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

clight-2.1.0.tar.gz (416.4 kB view details)

Uploaded Source

Built Distribution

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

clight-2.1.0-py3-none-any.whl (417.3 kB view details)

Uploaded Python 3

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

Hashes for clight-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e2ee9c2e77211724b7855b2a14c913cea44edb10ea06e21275d524f53893fc8a
MD5 9737fb210d54c42e88e2be5536395b80
BLAKE2b-256 642c54738fccf4a58d2de63bcdb2cefae8d8e4e5d21c69435690aee93bb35b32

See more details on using hashes here.

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

Hashes for clight-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6584a288438862670a15f484e76cad9bc3d4edfe35de244f2a1ee79e3057b996
MD5 f0924aa8a5c5e9d25237e6e34217c0a1
BLAKE2b-256 ed58d445d89cce302f68ec6385bd1f8b4c7b60f9a728f28da9e320f827c265ed

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