flexget.utils.database module#

class flexget.utils.database.CaseInsensitiveWord(word)[source]#

Bases: Comparator

Hybrid value representing a string that compares case insensitively.

Parameters:

word (str | CaseInsensitiveWord)

lower()[source]#
Return type:

str

operate(op, other)[source]#

Operate on an argument.

This is the lowest level of operation, raises NotImplementedError by default.

Overriding this on a subclass can allow common behavior to be applied to all operations. For example, overriding ColumnOperators to apply func.lower() to the left and right side:

class MyComparator(ColumnOperators):
    def operate(self, op, other, **kwargs):
        return op(func.lower(self), func.lower(other), **kwargs)
Parameters:
  • op – Operator callable.

  • *other – the ‘other’ side of the operation. Will be a single scalar for most operations.

  • **kwargs – modifiers. These may be passed by special operators such as ColumnOperators.contains().

_adapt_to_entity#
_parententity#
prop#
flexget.utils.database.entry_synonym(name)[source]#

Use serialization system to store Entries in db.

Parameters:

name (str)

Return type:

SynonymProperty

flexget.utils.database.ignore_case_property(text_attr)[source]#
flexget.utils.database.json_synonym(name)[source]#

Use json to serialize python objects for db storage.

Parameters:

name (str)

Return type:

SynonymProperty

flexget.utils.database.pipe_list_synonym(name)[source]#

Convert pipe separated text into a list.

Parameters:

name (str)

Return type:

SynonymProperty

flexget.utils.database.quality_property(text_attr)[source]#
flexget.utils.database.quality_requirement_property(text_attr)[source]#
flexget.utils.database.text_date_synonym(name)[source]#

Convert Y-M-D date strings into datetime objects.

Parameters:

name (str)

Return type:

SynonymProperty

flexget.utils.database.with_session(*args, **kwargs)[source]#

Use as a decorator which creates a new session if one was not passed via keyword argument to the function.

Automatically commits and closes the session if one was created, caller is responsible for commit if passed in.

If arguments are given when used as a decorator, they will automatically be passed to the created Session when one is not supplied.

flexget.utils.database.year_property(date_attr)[source]#