Skip to main content

Provides basic functions for argument passing, encryption, shell execution and file management

Project description

🧹 Essential Helpers 🧹

Install

pip install essential-helpers

Usage

import ess_helpers 

Argument Parsing

Uses the argparse built-in module to parse arguments ran alongside your script.

  • Assign your args
from essential-helpers.arguments import ArgumentParser

parser = ArgumentParser()

# Strings
string_arg: tuple = ("-s", "--string-example")
string_help: str = "This is an example string argument, pass in a string after this argument."
parser.add_string_argument(string_arg, string_help)

# Ints
int_arg: str = "-i"
int_help: str = "This is an example int argument, pass in an int after this argument."
parser.add_int_argument(int_arg, int_help)

# Bools
bool_arg: frozenset = {"-b", "--bool"}
bool_help: str = "This is an example bool argument, passing this will set this bool to true."
parser.add_bool_argument(bool_arg, bool_help)

*You can pass in a str ("-eg") or a tuple/list/set (["-eg", "--example"])

  • Reference them to see if they have been passed in and what values they hold
string_value: str = parser.get_arg("s")
int_value: int = parser.get_arg("int")
is_bool: bool = parser.get_arg("bool")
all_args: dict = parser.get_all_args()
string_value: str = all_args.get("s")
int_value: int = all_args.get("int")
is_bool: bool = all_args.get("bool")

Encryption

Shell Execution

File Management

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

essential-helpers-0.0.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

essential_helpers-0.0.5-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file essential-helpers-0.0.5.tar.gz.

File metadata

  • Download URL: essential-helpers-0.0.5.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for essential-helpers-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a82d4ba132b3038863bc9593b2a88865f30e142013c9266b9e57421d42379328
MD5 309240db2181c63cae76c349b5bcdd16
BLAKE2b-256 fc6868b53d203dbf909d31f6016f8cda10e74c9c86c62bdfb411519294948b11

See more details on using hashes here.

File details

Details for the file essential_helpers-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for essential_helpers-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 89abd27b558c352f09512b42641c0cb5c7feead271a32e5999deed6eeae419c0
MD5 1ac0f47cfa46109244635b24f1da2329
BLAKE2b-256 847ee6cc713fea1d54abdcf72d6372fccd5c1fc9071812e5460faaa546c8f4e7

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