dj_angles.evaluator =================== .. py:module:: dj_angles.evaluator Module Contents --------------- .. py:data:: logger .. py:class:: EvaluatedFunction .. py:attribute:: function_name :type: str .. py:attribute:: args :type: list :value: [] .. py:attribute:: kwargs :type: dict .. py:class:: Portion(name: str) .. py:attribute:: name :type: str .. py:attribute:: args :type: list :value: [] .. py:attribute:: kwargs :type: dict .. py:class:: ParsedFunction(function_name: str) .. py:attribute:: function_name :type: str .. py:attribute:: portions :type: list[Portion] :value: [] .. py:method:: parse_function() .. py:class:: TemplateVariable(name: ast.Name) .. py:attribute:: name :type: str .. py:attribute:: portions :type: list[Portion] :value: [] .. py:function:: eval_value(value) Uses `ast.literal_eval` to parse strings into an appropriate Python primitive. Also returns an appropriate object for strings that look like they represent datetime, date, time, duration, or UUID. .. py:function:: eval_function(function_string: str) -> EvaluatedFunction Parses the method name from a string into a set of parameters to pass to a method. :param param function_string: String representation of a method name with parameters, e.g. "set_name('Bob')" :returns: Tuple of method_name, a list of arguments and a dict of keyword arguments.