MCPcopy Index your code
hub / github.com/zappa/Zappa / import_and_get_function

Function import_and_get_function

zappa/utilities.py:145–152  ·  view source on GitHub ↗

Given a dotted module path to a function (e.g. 'myapp.tasks.my_func'), import that module and return the function.

(dotted_path: str)

Source from the content-addressed store, hash-verified

143
144
145def import_and_get_function(dotted_path: str) -> Any:
146 """
147 Given a dotted module path to a function (e.g. 'myapp.tasks.my_func'),
148 import that module and return the function.
149 """
150 module, function = dotted_path.rsplit(".", 1)
151 app_module = importlib.import_module(module)
152 return getattr(app_module, function)
153
154
155def human_size(num: float, suffix: str = "B") -> str:

Callers 2

import_and_get_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected