sidpy.base.string_utilsΒΆ

Utilities for formatting strings and other input / output methods

Created on Tue Nov 3 21:14:25 2015

@author: Suhas Somnath, Chris Smith

Functions

clean_string_att

Replaces any unicode objects within lists with their string counterparts to ensure compatibility with python 3.

format_quantity

Formats the provided quantity such as time or size to appropriate strings

format_size

Formats the provided size in bytes to kB, MB, GB, TB etc.

format_time

Formats the provided time in seconds into seconds, minutes, or hours

formatted_str_to_number

Takes a formatted string like '4.32 MHz' to 4.32 E+6.

get_time_stamp

Returns the current date and time as a string formatted as: Year_Month_Day-Hour_Minute_Second

remove_extra_delimiters

Removes extra spaces (or other delimiters) between words in a line.

str_to_other

Casts a single value encoded in a string to the appropriate python object.

validate_list_of_strings

This function is to be used when validating and cleaning a list of strings.

validate_single_string_arg

This function is to be used when validating a SINGLE string parameter for a function.

validate_string_args

This function is to be used when validating string parameters for a function.