Skip to main content

A python boilerplate for fastapi and streamlit projects.

Project description

RZ-Sample

PyPI - Python Version pypi License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rz_sample-2.0.2.tar.gz (111.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rz_sample-2.0.2-py3-none-any.whl (114.1 kB view details)

Uploaded Python 3

File details

Details for the file rz_sample-2.0.2.tar.gz.

File metadata

  • Download URL: rz_sample-2.0.2.tar.gz
  • Upload date:
  • Size: 111.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rz_sample-2.0.2.tar.gz
Algorithm Hash digest
SHA256 fd7aec2e61ac9d6877c8d77e315aa8e0648e67b384b345c1d8601be274099396
MD5 da99d114055f280f95a1505571ad9ddf
BLAKE2b-256 21f47e2cc4089735faea064874fe42edc1906b2e07303b26f5b58ff2ceede46d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rz_sample-2.0.2.tar.gz:

Publisher: publish.yml on recursivezero/rz-sample

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rz_sample-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: rz_sample-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 114.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rz_sample-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 239e406956dc046c594d850a399ab272b3e7435c57e7c0146063bece5d13944d
MD5 0b91da6457709efdb0132593dfaab9b8
BLAKE2b-256 c1c163942fa9d77c4660d593e7402f149c4f554ac12f1fa70e179c1cba51fba4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rz_sample-2.0.2-py3-none-any.whl:

Publisher: publish.yml on recursivezero/rz-sample

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page