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
Built Distribution
Close
Hashes for essential_helpers-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89abd27b558c352f09512b42641c0cb5c7feead271a32e5999deed6eeae419c0 |
|
MD5 | 1ac0f47cfa46109244635b24f1da2329 |
|
BLAKE2b-256 | 847ee6cc713fea1d54abdcf72d6372fccd5c1fc9071812e5460faaa546c8f4e7 |