An ipython shell for fastapi which automatically imports code and optionally opens a database connection
Table of Contents
pip install fastapi-shell
Begin a fastapi-shell session with default import rules:
python -m fastapi_shell
Exclude sandbox
and tests
modules from session imports:
python -m fastapi_shell --exclude sandbox tests
Only include app
modules in session imports:
python -m fastapi_shell --include app
Include app
modules except for tests
in session imports:
python -m fastapi_shell --include app --exclude tests
Run code during session initialization:
python -m fastapi_shell --run-code "import db; db.connect()"
fastapi-shell
is distributed under the terms of the MIT license.