deftlariat package

Submodules

deftlariat.core module

Main module.

class deftlariat.core.AnythingMatcher(match_col_key)[source]

Bases: deftlariat.core.Matcher

Matcher always successfully matches any input. Always returns True.

is_match(match_values, data_record) bool[source]
class deftlariat.core.EqualTo(match_col_key)[source]

Bases: deftlariat.core.Matcher

Equal To matching style. Cast everything to str.

is_match(match_values, data_record) bool[source]
class deftlariat.core.ExistsMatchers(match_col_key, matcher_type)[source]

Bases: deftlariat.core.Matcher

is_match(data_record) bool[source]
class deftlariat.core.Matcher(match_col_key)[source]

Bases: abc.ABC

get_key_val()[source]

Generate a value suitable for hashing, dictionary key

abstract is_match(match_values, data_record) bool[source]
validate_key_exists(data_record) bool[source]

Validate match-key-column exists in data record

class deftlariat.core.MatcherType(value)[source]

Bases: enum.Enum

An enumeration.

ANYTHING = 'Anything'
CLOSE_TO = 'CloseTo'
CONTAINS_STRING = 'ContainsString'
CONTAINS_STRING_IN_ORDER = 'ContainsStringInOrder'
EQUAL_TO = 'EqualTo'
EQUAL_TO_IGNORE_CASE = 'EqualToIgnoreCase'
EQUAL_TO_IGNORE_WHITESPACE = 'EqualToIgnoreWhitespace'
GREATER_THAN = 'GreaterThan'
GREATER_THAN_EQUAL_TO = 'GreaterThanEqualTo'
LESS_THAN = 'LessThan'
LESS_THAN_EQUAL_TO = 'LessThanEqualTo'
NONE = 'None'
NONE_OR_EMPTY = 'NoneOrEmpty'
NOTHING = 'Nothing'
NOT_NONE = 'NotNone'
NOT_NONE_OR_EMPTY = 'NotNoneOrEmpty'
STARTS_WITH = 'StartsWith'
class deftlariat.core.NothingMatcher(match_col_key)[source]

Bases: deftlariat.core.Matcher

Matcher never successfully matches any input. Always returns False.

is_match(match_values, data_record) bool[source]
class deftlariat.core.NumberComparer(match_col_key, matcher_type, convert_none_to=None)[source]

Bases: deftlariat.core.Matcher

get_record_value(data_record) int[source]

If you want to convert a None to an Int, set a replacement value.

is_match(match_values, data_record) bool[source]
class deftlariat.core.TextComparer(match_col_key, matcher_type)[source]

Bases: deftlariat.core.Matcher

is_match(match_values, data_record) bool[source]
deftlariat.core.pull_val(x)[source]

Module contents

Top-level package for Python Deft Lariats.