Skip to main content

Library of useful code snippets

Project description

Kelian

Kelian is a Python library that provides a collection of useful and commonly used code snippets to speed up development and avoid reinventing the wheel. It includes utility functions, common algorithms, data manipulations, and more, designed to simplify your workflow and increase productivity.

Installation

You can install the Kelian library via pip:

pip install kelian

Examples

Functions

Time Tracking

Utility to measure and average time intervals for various operations.

  • AverageTime: Class
    • start: Starts a timer for a specific ID.
    • loop: Records both start and end times for a specific ID.
    • stop: Stops a timer for a specific ID.
    • get_average: Retrieves the average elapsed time for a specific ID or all IDs.
    • __str__, __repr__: Returns the average elapsed time(s) as a formatted string.

(see examples of use)

Encryption

Simple functions to encrypt and decrypt data using predefined mappings or lists.

  • alpha2dict: Maps alphabets to a dictionary for encryption.
  • list2dict: Converts a list to a dictionary.
  • encrypt: Encrypts a given text using predefined mappings.
  • decrypt: Decrypts a given encrypted text.
  • encrypt_by_list: Encrypts text based on a custom list.
  • decrypt_by_list: Decrypts text based on a custom list.

(see examples of use)

Loading Bar

  • ProgressBar: Class
    • format: Change pattern of progress bar.
    • update: Increment the progress by one.
    • display: Return the progress bar updated or not, depending on the given parameter.
    • __str__, __repr__: Return the progress bar updated.

(see examples of use)

System

Retrieve detailed information about your computer's hardware, including processor, motherboard, GPU, RAM, and more.

  • get_processor_details: Returns details about the CPU.
  • get_motherboard_details: Returns details about the motherboard.
  • get_gpu_details: Returns details about the GPU.
  • get_monitor_details: Returns details about the monitor.
  • get_cd_drive_details: Returns details about the CD drive.
  • get_mouse_details: Returns details about the mouse.
  • get_speaker_details: Returns details about the speakers.
  • get_keyboard_details: Returns details about the keyboard.
  • get_hard_disk_details: Returns details about the hard disk.
  • get_ram_details: Returns details about the RAM.

(see examples of use)

Utility

Helper functions like hashing utilities for common tasks.

  • string2hash: Converts a string to its sha256 hashed value.
  • fix_encoding: Corrects common encoding issues in a text.
  • multi_replace: Replaces multiple substrings in a text with specified values.
  • multi_replace_by_one: Replaces multiple substrings in a text with a single specified value.
  • while_replace: Replaces a substring in a text repeatedly until it no longer exists.

(see examples of use)

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

kelian-0.1.9.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

kelian-0.1.9-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file kelian-0.1.9.tar.gz.

File metadata

  • Download URL: kelian-0.1.9.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for kelian-0.1.9.tar.gz
Algorithm Hash digest
SHA256 ae2f1cb499cca6533e2484b36dc220e9111a8a209c37b3917289581f61a33060
MD5 52c20e54b1afdb3bc2b61e0461cf5f9e
BLAKE2b-256 e1ac1dbed7e937eda6fa9d04f60dec69353e17b5449615d49fc8a4637b80dfc0

See more details on using hashes here.

File details

Details for the file kelian-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: kelian-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for kelian-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 eb7d52d0ddacb277a43101513a03004ba8e4ab3fbffe94eb1f7b259a3a5b4ed1
MD5 620d6ccd8addcb8654b4476c77c67e7e
BLAKE2b-256 d5b973fda9386f8652b1607a9c644c3a879b01467fa4b1aa85b2e1a0e5fe1c41

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