I do this in fast api and then pass get_whatever as a dependency to an endpoint