fastapp.app package
Submodules
fastapp.app.base module
Inheritance and Wrapper Classes for FastApp
- class fastapp.app.base.FastApp(debug: bool = True, title: str = 'FastApp', description: str = 'Example ML Server with FastAPI', version: str = '0.1.7', **kwargs: Any)[source]
Bases:
FastAPI
FastApp FastAPI Class
- class fastapp.app.base.FastAppRouter(*, prefix: str = '', tags: ~typing.Optional[~typing.List[~typing.Union[str, ~enum.Enum]]] = None, dependencies: ~typing.Optional[~typing.Sequence[~fastapi.params.Depends]] = None, default_response_class: ~typing.Type[~starlette.responses.Response] = <fastapi.datastructures.DefaultPlaceholder object>, responses: ~typing.Optional[~typing.Dict[~typing.Union[int, str], ~typing.Dict[str, ~typing.Any]]] = None, callbacks: ~typing.Optional[~typing.List[~starlette.routing.BaseRoute]] = None, routes: ~typing.Optional[~typing.List[~starlette.routing.BaseRoute]] = None, redirect_slashes: bool = True, default: ~typing.Optional[~typing.Callable[[~typing.MutableMapping[str, ~typing.Any], ~typing.Callable[[], ~typing.Awaitable[~typing.MutableMapping[str, ~typing.Any]]], ~typing.Callable[[~typing.MutableMapping[str, ~typing.Any]], ~typing.Awaitable[None]]], ~typing.Awaitable[None]]] = None, dependency_overrides_provider: ~typing.Optional[~typing.Any] = None, route_class: ~typing.Type[~fastapi.routing.APIRoute] = <class 'fastapi.routing.APIRoute'>, on_startup: ~typing.Optional[~typing.Sequence[~typing.Callable[[], ~typing.Any]]] = None, on_shutdown: ~typing.Optional[~typing.Sequence[~typing.Callable[[], ~typing.Any]]] = None, deprecated: ~typing.Optional[bool] = None, include_in_schema: bool = True, generate_unique_id_function: ~typing.Callable[[~fastapi.routing.APIRoute], str] = <fastapi.datastructures.DefaultPlaceholder object>)[source]
Bases:
APIRouter
Base API Router Class for FastApp
- fastapp.app.base.mount_static_app(fastapp_app: FastApp) FastApp [source]
Mount the fastapp internal static directory to an app
- async fastapp.app.base.ping() PingResponse [source]
Return a Health Response
fastapp.app.example module
FastApp Example FastAPI App
pip install fastapp[example]
fastapp.app.machine_learning module
FastAPI Backend
- fastapp.app.machine_learning.get_most_similar(body: GensimRequest) List[List[Union[str, float]]] [source]
Get a Gensim gensim.most_similar response
- fastapp.app.machine_learning.get_sentiment(text: SentimentRequest) List[SentimentResponse] [source]
Get a SentimentIntensityAnalyzer polarity_scores response
fastapp.app.utils module
FastAPI Backend
- async fastapp.app.utils.generic_request(body: RequestBody) RequestBody [source]
Example Post Request with Expected Data
Module contents
FastApp FastAPI App
- class fastapp.app.FastApp(debug: bool = True, title: str = 'FastApp', description: str = 'Example ML Server with FastAPI', version: str = '0.1.7', **kwargs: Any)[source]
Bases:
FastAPI
FastApp FastAPI Class
- class fastapp.app.FastAppRouter(*, prefix: str = '', tags: ~typing.Optional[~typing.List[~typing.Union[str, ~enum.Enum]]] = None, dependencies: ~typing.Optional[~typing.Sequence[~fastapi.params.Depends]] = None, default_response_class: ~typing.Type[~starlette.responses.Response] = <fastapi.datastructures.DefaultPlaceholder object>, responses: ~typing.Optional[~typing.Dict[~typing.Union[int, str], ~typing.Dict[str, ~typing.Any]]] = None, callbacks: ~typing.Optional[~typing.List[~starlette.routing.BaseRoute]] = None, routes: ~typing.Optional[~typing.List[~starlette.routing.BaseRoute]] = None, redirect_slashes: bool = True, default: ~typing.Optional[~typing.Callable[[~typing.MutableMapping[str, ~typing.Any], ~typing.Callable[[], ~typing.Awaitable[~typing.MutableMapping[str, ~typing.Any]]], ~typing.Callable[[~typing.MutableMapping[str, ~typing.Any]], ~typing.Awaitable[None]]], ~typing.Awaitable[None]]] = None, dependency_overrides_provider: ~typing.Optional[~typing.Any] = None, route_class: ~typing.Type[~fastapi.routing.APIRoute] = <class 'fastapi.routing.APIRoute'>, on_startup: ~typing.Optional[~typing.Sequence[~typing.Callable[[], ~typing.Any]]] = None, on_shutdown: ~typing.Optional[~typing.Sequence[~typing.Callable[[], ~typing.Any]]] = None, deprecated: ~typing.Optional[bool] = None, include_in_schema: bool = True, generate_unique_id_function: ~typing.Callable[[~fastapi.routing.APIRoute], str] = <fastapi.datastructures.DefaultPlaceholder object>)[source]
Bases:
APIRouter
Base API Router Class for FastApp