Skip to main content

No project description provided

Project description

MegaKit

MegaKit is a comprehensive utility library that provides a wide range of functions for various operations, including color conversions, file handling, image manipulations, list processing, random data generation, string manipulations, system interactions, and time operations. This toolkit is designed to simplify and streamline common programming tasks.

Table of Contents

Installation

You can install MegaKit using pip:

$ pip install megakit

Usage

Color Operations

  • hex_to_rgb(hex_code): Converts a hexadecimal color code to RGB format.
  • rgb_to_hex(rgb): Converts an RGB color tuple to hexadecimal format.

File Operations

  • read_lines(file_path): Reads and returns lines from a file.
  • count_lines(file_path): Counts lines in a file.
  • count_folders(folder_path): Counts folders in a directory.
  • count_files(folder_path): Counts files in a directory.
  • get_file_name(file_path): Returns file name with extension.
  • get_file_extension(file_path): Returns file extension.
  • get_file_location(file_path): Returns directory of the file.
  • is_file(path): Checks if path points to a file.
  • is_folder(path): Checks if path points to a folder.
  • is_existing(path): Checks if path exists.
  • list_directories(folder_path): Lists directories in a folder.
  • list_files(folder_path): Lists files in a folder.
  • is_empty(folder_path): Checks if folder is empty.
  • delete_file(file_path): Deletes a file.
  • delete_folder(folder_path): Deletes a folder and its contents.

Image Operations

  • add_padding(image_path, padding_value, color): Adds padding to an image.
  • round_corners(image_path, radius): Rounds corners of an image.
  • turn_to_square(image_path, color): Converts image to a square shape.

List Operations

  • has_duplicates(lst): Check if a list has duplicate elements.
  • print_options(lst): Print options from a list with each option indexed.

Random Data Operations

  • random_integer(n): Generates a random integer with n digits.
  • random_string(n): Generates a random string with n uppercase letters.
  • random_serial(n): Generates a random serial code with n alphanumeric characters.

String Operations

  • get_first_characters(s, chars): Get the first chars characters of a string.
  • get_last_characters(s, chars): Get the last chars characters of a string.
  • reverse_string(s): Reverse a given string.
  • number_of_words(title): Count the number of words in a string.

System Operations

  • clear_terminal(): Clears the terminal screen.
  • close_finder_windows(): Closes all Finder windows on macOS using AppleScript.

Time Operations

  • get_date(): Returns current date in MM/DD/YYYY format.
  • get_month(): Returns current month index (0-11) and name.
  • get_year(): Returns current year as an integer.
  • estimate_reading_time(words_number): Estimates reading time in minutes based on the number of words. add any necessary missing sections to make this a good readme

License

MegaKit is licensed under the MIT License.

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

megakit-1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

megakit-1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file megakit-1.0.tar.gz.

File metadata

  • Download URL: megakit-1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for megakit-1.0.tar.gz
Algorithm Hash digest
SHA256 248acfeade8826fc52815d8c750867dca2b8e79c03ae8ff7c1d5382c3e64575c
MD5 c56e01d3247376b37ce9c767aee9ea7a
BLAKE2b-256 705433b25ff866308e409452be61c6091560abd6551a3dacda11665535960442

See more details on using hashes here.

File details

Details for the file megakit-1.0-py3-none-any.whl.

File metadata

  • Download URL: megakit-1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for megakit-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad705799595be2171469dce409748d080d212d6f52fe5fbfeac20769ff61db6d
MD5 819c0819b332e74619246cb412d5053f
BLAKE2b-256 54a166b869401c154c8c107f494ab6defb1c074953cf010eb66b5da6a084f567

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