Skip to content

recursivezero/rz-sample

RZ-Sample

PyPI - Python Version pypi License Publish

poetry + streamlit + fast api boilerplate for python development.

Installation Guide

Prerequisites

  • Python ≥ 3.11
  • Poetry ≥ 2.2.1
  • Streamlit ≥ 1.49.1

Getting Started

Poetry Setup

curl -sSL https://install.python-poetry.org | python3 -
# OR
pip install poetry>=2.2.1

Virtual Environment Configuration

poetry config virtualenvs.path /your/desired/path

Ensure below files are configured (create if not exist) properly to run the project;

  • .env.development
  • .env.production

Install Dependencies

poetry lock --no-cache --regenerate
poetry install  --all-extras --with dev

Or manually

make install

How to Run

Configure ENVIRONMENT

setup .env.development and .env.production in project root

  # for local configuration(linux)
  export ENV=development
  # for production(linux)
  export ENV=production

Run Streamlit App

make 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 1234

Run FastAPI Server

make api
# OR with custom port
poetry run sample api --port 5000

Access: http://127.0.0.1:5000

🧹 Linting & Code Quality

Pre-commit hooks are enabled. If commits fail, run:

make lint

or run individual

poetry run black .
poetry run flake8 .
poetry run mypy .
poetry run ruff check .

CLI Shortcuts

make dev → Launch Streamlit UI

make api → Launch FastAPI

current version will be printed on start of above commands.

Troubleshooting

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>

License

MIT

References

About

Kickstart your Python projects with a minimal Poetry + Streamlit + FastAPI setup — simple, clean, and ready to extend.

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE-PYTHON

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors