https://github.com/audrbar/py_site
Website for displaying Data Science Projects build on Streamlit
https://github.com/audrbar/py_site
matplotlib numpy pandas python3 requests streamlit
Last synced: 2 months ago
JSON representation
Website for displaying Data Science Projects build on Streamlit
- Host: GitHub
- URL: https://github.com/audrbar/py_site
- Owner: audrbar
- License: mit
- Created: 2024-06-29T15:04:09.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-16T18:21:27.000Z (over 1 year ago)
- Last Synced: 2025-03-16T19:37:00.682Z (over 1 year ago)
- Topics: matplotlib, numpy, pandas, python3, requests, streamlit
- Language: Python
- Homepage:
- Size: 65.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README



# Data Science Multi-Page Application
Hi :wave:, and welcome to the Data Science Website built with Streamlit.
## Description
Application is built with **Python**, hosted on **Streamlit Community Cloud** and its data is stored in **PostgreSQL**, hosted on _Supabase_. The project uses modern **UV package manager** for fast dependency management.
## Features
- ๐ Interactive data exploration from CSV files
- ๐๏ธ PostgreSQL-based project management system
- ๐ฐ Mortgage calculator with visualization
- ๐จ Demonstration of various Streamlit UI elements
- ๐ค AI-powered PDF question answering with LangChain & OpenAI
## Pages
These are the main pages of the application:
| File Name | Description | Link |
| --------------------- | -------------------------------------------------------------------- | --------------------------------------- |
| Data_Explorer.py | Explores datasets read from .csv files provided by user | [LINK](./pages/1_Data_Explorer.py) |
| Project_Management.py | Executes project management tasks, reads and writes data to database | [LINK](./pages/2_Project_management.py) |
| mortgage_calc.py | Interactive mortgage calculator with payment schedule visualization | [LINK](./pages/3_mortgage_calc.py) |
| Various_Elements.py | Explores different built-in Streamlit UI possibilities | [LINK](./pages/4_Various_Elements.py) |
| Langchain_PDF.py | AI assistant that answers questions about uploaded PDF documents | [LINK](./pages/5_Langchain_PDF.py) |
## Installation
### Prerequisites
- Python 3.12 or higher
- UV package manager (recommended) or pip
### Using UV (Recommended)
UV is a fast Python package manager. Install it first:
```bash
# On macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```
Then set up the project:
```bash
# Clone the repository
git clone
cd py_site
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate # On macOS/Linux
.venv\Scripts\activate # On Windows
# Install dependencies
uv pip install -e .
```
### Using pip (Alternative)
```bash
# Install dependencies from requirements.txt
pip install -r requirements.txt
```
## Configuration
### Database Setup
Create a `.streamlit/secrets.toml` file with your database credentials:
```toml
[connections.postgresql]
dialect = "postgresql"
host = "your-host.supabase.com"
port = "5432"
database = "postgres"
username = "your-username"
password = "your-password"
[openai]
api_key = "your-openai-api-key"
```
## Running the Application
```bash
# Make sure virtual environment is activated
streamlit run Home.py
```
The application will open in your default browser at `http://localhost:8501`
## Project Structure
```
py_site/
โโโ Home.py # Main entry point
โโโ pages/ # Multi-page application pages
โโโ src/ # Database connection and table classes
โโโ data/ # Sample data and diagrams
โโโ style/ # Custom CSS
โโโ images/ # Static images
โโโ tests/ # Test files
โโโ pyproject.toml # UV/pip dependencies
โโโ requirements.txt # Pip requirements (legacy)
โโโ README.md # This file
```
## Data Sources
For testing purposes, the following initial data sets are available:
| File Name | Source | Source Link |
| --------------- | -------------------------------- | ----------------------------- |
| movies.csv | Demo Data for Data Explorer | [LINK](./data/movies.csv) |
| initial_data.py | Demo Data for Project Management | [LINK](./src/initial_data.py) |
## Database Diagram
Database diagram used to construct the database structure:

## Technology Stack
- **Framework**: Streamlit 1.37+
- **Language**: Python 3.12+
- **Package Manager**: UV
- **Database**: PostgreSQL (Supabase)
- **ORM**: SQLAlchemy 2.0+
- **AI/ML**: LangChain, OpenAI, FAISS
- **Data Processing**: Pandas, NumPy
- **Visualization**: Matplotlib, Seaborn
## Dependencies
Core dependencies are managed in `pyproject.toml`:
- streamlit, pandas, numpy (core)
- psycopg2-binary, SQLAlchemy (database)
- langchain, openai, faiss-cpu (AI/ML)
- matplotlib, seaborn (visualization)
See [pyproject.toml](./pyproject.toml) for complete list.
## ๐งช Running Tests
Tests are available in the [tests directory](./tests/). Run them with pytest:
```bash
pytest
```
## ๐
Authors
Audrius: [Github](https://github.com/audrbar)
## โ ๏ธ License
Distributed under the MIT License. See [LICENSE](./LICENSE) for more information.
## ๐ Resources
- [Streamlit Documentation](https://docs.streamlit.io/)
- [LangChain Documentation](https://python.langchain.com/)
- [UV Package Manager](https://github.com/astral-sh/uv)
- [Langchain PDF Tutorial](https://www.youtube.com/watch?v=wUAUdEw5oxM)
- [Ask Book](https://bennycheung.github.io/ask-a-book-questions-with-langchain-openai)