downtoearth package¶
Submodules¶
downtoearth.cli module¶
downtoearth creates terraform files from api configuration definitions.
downtoearth.default module¶
Define defaults used in downtoearth.
downtoearth.exceptions module¶
Exceptions for downtoearth.
These are helpers provided so that you can raise proper HTTP code errors from your API.
- Usage:
- from downtoearth.exceptions import NotFoundException raise NotFoundException(‘your princess is in another castle’)
downtoearth.model module¶
downtoearth API model.
downtoearth.router module¶
Router helper for API’s using downtoearth.
-
class
downtoearth.router.
Router
(route_map=None, param_order=None)[source]¶ Bases:
object
Routing object for given route_map.
Parameters: - route_map (optional[dict]) –
map of route to delegate ex.
- map = {
- “GET:/v1/book”: get_all, “POST:/v1/book”: post_book, “GET:/v1/book/{isbn}”: get_book, “PUT:/v1/book/{isbn}”: update_book, “DELETE:/v1/book/{isbn}”: remove_book
}
- param_order (optional[list]) – order of precedence for parameters This should include all three parameter types. ex. [‘path’, ‘querystring’, ‘body’] defaults to [‘path’, ‘body’, ‘querystring’]
-
DEFAULTS
= {'param_order': ['path', 'body', 'querystring']}¶
-
add_full_route
(route, delegate)[source]¶ Add route given route and delegate function.
Parameters: - route (str) – route in format “VERB:route/{variables}”
- delegate (func) – function to call
- route_map (optional[dict]) –
downtoearth.test module¶
downtoearth.version module¶
Package version will be written by setup.py.