poetry + streamlit + fast api boilerplate for python development.
- Python ≥ 3.11
- Poetry ≥ 2.2.1
- Streamlit ≥ 1.49.1
curl -sSL https://install.python-poetry.org | python3 -
# OR
pip install poetry>=2.2.1poetry config virtualenvs.path /your/desired/pathEnsure below files are configured (create if not exist) properly to run the project;
.env.development.env.production
poetry lock --no-cache --regenerate
poetry install --all-extras --with devOr manually
make installsetup .env.development and .env.production in project root
# for local configuration(linux)
export ENV=development
# for production(linux)
export ENV=productionmake dev
# OR with custom port
poetry run sample dev --port 8051
then open UI on : http://localhost:8501
to run on different port use --port option
poetry run sample dev --port 1234make api
# OR with custom port
poetry run sample api --port 5000Access: http://127.0.0.1:5000
Pre-commit hooks are enabled. If commits fail, run:
make lintor run individual
poetry run black .
poetry run flake8 .
poetry run mypy .
poetry run ruff check .make dev → Launch Streamlit UI
make api → Launch FastAPI
current version will be printed on start of above commands.
sometimes there might be chances that virtual environment get corrupted then delete the old virtual environment and start afresh.
poetry env info
# this will provide virtual environment name
poetry env remove <environment-full-name>