Utilities¶
- tablecrow.utilities.parse_hostname(hostname: str) Dict[str, str] ¶
parse detailed connection information from the given URL
- Parameters:
hostname – URL with connection information
- Returns:
dictionary of hostname, port, username, and password
- tablecrow.utilities.read_configuration(filename: PathLike) Dict[str, str] ¶
read a configuration file with
configparser
- Parameters:
filename – path to configuration
- Returns:
dictionary mapping of configuration entries
- tablecrow.utilities.repository_root(path: Optional[PathLike] = None) Path ¶
get the root directory of the current Git repository
- Parameters:
path – query path
- Returns:
repository root directory
- tablecrow.utilities.split_hostname_port(hostname: str) -> (<class 'str'>, typing.Optional[str])¶
split the given URL into host and port, assuming port is appended after a colon
- Parameters:
hostname – hostname string
- Returns:
hostname and port (if found, otherwise
None
)