orsopy.slddb.comparators module
Classes to represent comparisons in SQLite queries.
-
class orsopy.slddb.comparators.Comparator(value, key=None)[source]
Bases: ABC
-
abstract query_string()[source]
Return the SQL query string used when searching.
Should contain one question mark for each argument that is used.
-
abstract query_args()[source]
Return the arguments used for the query. The number of arguments should
be equal to the number of question marks returned by query_string.
-
class orsopy.slddb.comparators.GenericComparator(value, key=None)[source]
Bases: Comparator
Comparator used for the generic case. Makes a simple comparison
based on the type of the argument.
-
query_string()[source]
Return the SQL query string used when searching.
Should contain one question mark for each argument that is used.
-
query_args()[source]
Return the arguments used for the query. The number of arguments should
be equal to the number of question marks returned by query_string.
-
class orsopy.slddb.comparators.ExactString(value, key=None)[source]
Bases: Comparator
Perform an exact string comparison.
-
query_string()[source]
Return the SQL query string used when searching.
Should contain one question mark for each argument that is used.
-
query_args()[source]
Return the arguments used for the query. The number of arguments should
be equal to the number of question marks returned by query_string.
-
class orsopy.slddb.comparators.FormulaComparator(value, key=None)[source]
Bases: Comparator
Compare to formula string.
-
query_string()[source]
Return the SQL query string used when searching.
Should contain one question mark for each argument that is used.
-
query_args()[source]
Return the arguments used for the query. The number of arguments should
be equal to the number of question marks returned by query_string.
-
class orsopy.slddb.comparators.FuzzyFloat(value, key=None)[source]
Bases: Comparator
Compare a float value against a range or +/-10% of given value.
-
query_string()[source]
Return the SQL query string used when searching.
Should contain one question mark for each argument that is used.
-
query_args()[source]
Return the arguments used for the query. The number of arguments should
be equal to the number of question marks returned by query_string.