The misc.py module#

Summary#

is_float

Determine if a string can be converted to a float.

random_string

Generate a random string of a fixed length.

create_temp_dir

Create a unique working directory in a temporary directory.

check_valid_ip

Check if an IP address is valid.

check_valid_port

Check if a port is valid.

Description#

Module providing miscellaneous functions and methods.

Module detail#

misc.is_float(input_string)#

Determine if a string can be converted to a float.

Parameters:
input_stringstr

String.

Returns:
True when the str can be converted to a float, False otherwise.
misc.random_string(stringLength=10, letters=string.ascii_lowercase)#

Generate a random string of a fixed length.

Parameters:
stringLengthint, optional

Length of the string. The default is 10.

letters
misc.create_temp_dir(tmpdir=None)#

Create a unique working directory in a temporary directory.

Parameters:
tempdirstr, optional

Name of the temporary directory to create the working directory in. The default is None.

misc.check_valid_ip(ip)#

Check if an IP address is valid.

Parameters:
ip

IP address.

misc.check_valid_port(port, lower_bound=1000, high_bound=60000)#

Check if a port is valid.

Parameters:
portint

Port.

lower_boundint, optional

Lowest value for the port range. The default is 1000.

high_boundint, optional

Highest value for the port range. The default is 6000.

misc.MODULE_PATH#
misc.base_report_class#