Skip to main content

A collection of utilities and functions for various tasks.

Project description

TCPYLib

The TCPYLib module is a collection of utilities and functions designed to support various tasks in the project. Below is an overview of the submodules and their functionalities.

Submodules

lib.cli

  • arguments.py
    • add_arg(parser: ArgumentParser, name: str, help_text: str, default: str | None = None, action: str | None = None, required: bool = False) -> None
    • parse_args(parser: ArgumentParser) -> dict[str, str]
  • shell.py
    • clear_console()
    • run_command(cmd)

lib.config

  • config.json
    • Configuration file containing logging settings and paths.
  • loader.py
    • load_config() -> dict
    • CONFIG: dict

lib.core

  • parser.py
    • parse_custom_time(time_str: str)
  • time.py
    • get_timestamp()
    • format_date(date: datetime, fmt: str = "%Y-%m-%d %H:%M:%S")

lib.logger

  • logger.py
    • Logger
      • debug(self, msg: str) -> None
      • info(self, msg: str) -> None
      • warn(self, msg: str) -> None
      • error(self, msg: str) -> None
      • critical(self, msg: str, exit: bool = False, exit_code: int = 0) -> None

lib.math

  • advanced.py
    • clamp(value, min_value, max_value)
  • random.py
    • random_string(length=10)

lib.network

  • ip.py
    • get_ip()
    • ping(host: str)

lib.screens

  • download.py
    • run_download_screen(...)
  • error.py
    • run_error_screen(...)
  • info.py
    • run_info_screen(...)
  • warn.py
    • run_warn_screen(...)

lib.startup

  • functions.py
    • clean_pycaches(root_dir, show: bool = False)
    • check_environment()
    • backup_config()
    • pre_tasks()
    • log_performance(execution_time)
    • cleanup_resources()
    • post_tasks(execution_time)

lib.utils

  • file_ops.py
    • create_folder(path)
    • delete_folder(path)
    • read_file(file_path)
    • write_file(file_path, content)
    • append_file(file_path, content)
    • delete_file(file_path)
  • passwords.py
    • input_pwsd(prompt: str, mask: str = "*") -> str
    • hash_password(password: str, salt: str = "") -> str
    • generate_password(length: int = 12, use_digits: bool = True, use_special: bool = True) -> str
    • strong_password_check(password: str, min_length: int = 8) -> bool
  • decorators.py
    • deactive(reason="Diese Funktion ist deaktiviert.")

License

This project is licensed under the MIT License - see the LICENSE file for 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

TCPYLib-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

TCPYLib-0.3.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file TCPYLib-0.3.0.tar.gz.

File metadata

  • Download URL: TCPYLib-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for TCPYLib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7ae7ca358928b2aa0953a95dca2a3863679d2ed45180c69037739adde38194ea
MD5 3f6e92be4286e155f3706b2526c28462
BLAKE2b-256 b97a5a2a528900bcd5d6bd16120423d6229ed67c583e6e8cb6aaceaf7f0de332

See more details on using hashes here.

File details

Details for the file TCPYLib-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: TCPYLib-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for TCPYLib-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff9a7a1989f736ca28235321286e1c6f488f514b453b58543bd9a4222d137e4
MD5 36bcda52c7d591997c9d5444a1e13bfb
BLAKE2b-256 66d0752cdf26b86fe6ab80c975d75b50650ee240a19d2ba59dc695f068e165b5

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