toolchest.hash¶
- toolchest.hash.generate_hash(list_to_hash, validator=<function validate_string>)[source]¶
Takes a list of strings in any order, sorts them for consistency, and generates a cryptographic hash to provide a unique representation of this combination of strings.
- Parameters
list_to_hash (list) – List of Strings to turn into a hash
validator (func) – A function to use to validate the format of items in the list of Strings. This function should throw a ValueError if the pattern does not match.
- Returns
A String that is a hash of the passed in list.
- Raises
ValueError – If the passed in list cannot be validated with the passed in validator, a ValueError is thrown.
toolchest.introspect¶
Methods related to introspection of a class
- toolchest.introspect.build_attrs(instance)[source]¶
Build a dict of attributes on a given instance
- Parameters
instance – An instance of some class
- Returns
Dict of all object attributes that are properties
toolchest.strutil¶
toolchest.yaml¶
Yaml related tools
- class toolchest.yaml.IndentDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]¶
Bases:
yaml.dumper.DumperCustom yaml dumper to ensure elements are indented