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.1.1.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.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TCPYLib-0.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 6e7ebb2ae31d56988851e0223982233f04226d83e8ac480927d956aa3117b3c3
MD5 9fe429b3580386b5e53c5fdda2db0d2f
BLAKE2b-256 3b77ce5a9ba165ec6b24d07fc8f8db0a81fafd677994471f297c7b25835764c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TCPYLib-0.1.1-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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2df7d221bead7e4dd83a1fcd095ee97c862f46151ff6ed6d3ef8bbb01a74b75c
MD5 66945f216a25635e3f66122b3bb4513c
BLAKE2b-256 e7dc6365abba92a2008ca33a1439c972badd8e379e42752dfd55959e0ad199c9

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