Base
Base classes for all processors in this module. Also contains decorators for use in implementations.
Classes:
Generic base class for processors |
|
Processor that gets user input as part of it processing. |
|
|
Decorator for methods on a class decorated with the |
|
Base class for implementations with |
|
Base class for filtering down values based on some settings |
|
Composite filter which filters based on many |
- class musify.processors.base.Processor
Bases:
PrettyPrinterGeneric base class for processors
- class musify.processors.base.InputProcessor
Bases:
ProcessorProcessor that gets user input as part of it processing.
Contains methods for getting user input and printing formatted options text to the terminal.
Attributes:
The
MusifyLoggerfor this object-
logger:
MusifyLogger The
MusifyLoggerfor this object
-
logger:
- class musify.processors.base.dynamicprocessormethod(*args)
Bases:
objectDecorator for methods on a class decorated with the
processor()decoratorThis assigns the method a processor method which can be dynamically called by the processor class. Optionally, provide a list of alternative names from which this processor method can also be called.
- class musify.processors.base.DynamicProcessor(*_, **__)
Bases:
ProcessorBase class for implementations with
dynamicprocessormethod()methods.Classes that implement this base class have a
__processormethods__class attribute which is a list of strings of all the processor methods this class contains. If adynamicprocessormethod()has alternative method names, these names will be added to the class’__dict__as callable methods which point to the decorated method.Optionally, you may also define a
_processor_method_fmtclass method which applies some transformation to all method names. The transformed method name is then appended to the class’__dict__. The transformation is always applied before extending the class with any given alternative method names.Attributes:
String representation of all available processor names of this object
- property processor_methods: frozenset[str]
String representation of all available processor names of this object
- class musify.processors.base.Filter
Bases:
Processor,GenericBase class for filtering down values based on some settings
Attributes:
Does this filter have valid settings and can process values
Transform the input
valueto the value that should be used when comparing against this filter's settings Simply returns the givenvalueat baseline unless overridden.Methods:
process(values, *args, **kwargs)Apply this filter's settings to the given values
- abstract property ready: bool
Does this filter have valid settings and can process values
- abstractmethod process(values, *args, **kwargs)
Apply this filter’s settings to the given values
- Return type:
Collection[TypeVar(T)]
- property transform: Callable[[Any], Any]
Transform the input
valueto the value that should be used when comparing against this filter’s settings Simply returns the givenvalueat baseline unless overridden.
- class musify.processors.base.FilterComposite(*filters, **__)
Bases:
Filter,Collection[Filter],GenericComposite filter which filters based on many
FilterobjectsAttributes:
Does this filter have valid settings and can process values
Transform the input
valueto the value that should be used when comparing against this filter's settings Simply returns the givenvalueat baseline unless overridden.The filters to use when processing
- property ready
Does this filter have valid settings and can process values
- property transform: Callable[[Any], Any]
Transform the input
valueto the value that should be used when comparing against this filter’s settings Simply returns the givenvalueat baseline unless overridden.
- filters
The filters to use when processing