Skip to content

Commit f2d4290

Browse files
committed
Building data pipeline
0 parents  commit f2d4290

24 files changed

Lines changed: 2348 additions & 0 deletions

.github/workflows/ci.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
name: Test & Quality Checks
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.13"]
22+
23+
steps:
24+
# -------------------------------------------------
25+
# Checkout
26+
# -------------------------------------------------
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
# -------------------------------------------------
31+
# Python setup
32+
# -------------------------------------------------
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
# -------------------------------------------------
39+
# Cache dependencies (speed)
40+
# -------------------------------------------------
41+
- name: Cache pip
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.cache/pip
45+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
46+
restore-keys: |
47+
${{ runner.os }}-pip-${{ matrix.python-version }}-
48+
49+
# -------------------------------------------------
50+
# Install dependencies
51+
# -------------------------------------------------
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r requirements.txt
56+
pip install pytest flake8 black isort
57+
58+
# -------------------------------------------------
59+
# Lint (code quality)
60+
# -------------------------------------------------
61+
- name: Lint with flake8
62+
run: |
63+
flake8 src --max-line-length=100
64+
65+
# -------------------------------------------------
66+
# Format check
67+
# -------------------------------------------------
68+
- name: Check formatting (black)
69+
run: |
70+
black --check src
71+
72+
# -------------------------------------------------
73+
# Import sorting check
74+
# -------------------------------------------------
75+
- name: Check imports (isort)
76+
run: |
77+
isort --check-only src
78+
79+
# -------------------------------------------------
80+
# Run tests
81+
# -------------------------------------------------
82+
- name: Run tests
83+
env:
84+
PYTHONPATH: .
85+
run: |
86+
pytest -v
87+
88+
# -----------------------------------------------------
89+
# Optional: Security scan
90+
# -----------------------------------------------------
91+
security:
92+
name: Security Scan
93+
runs-on: ubuntu-latest
94+
needs: test
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
100+
- name: Install security tools
101+
run: |
102+
pip install bandit
103+
104+
- name: Run Bandit
105+
run: |
106+
bandit -r src

.gitignore

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# ---------------------------
2+
# Python
3+
# ---------------------------
4+
__pycache__/
5+
*.pyc
6+
*.pyo
7+
*.pyd
8+
*.so
9+
*.egg
10+
*.egg-info/
11+
dist/
12+
build/
13+
.eggs/
14+
15+
# ---------------------------
16+
# Virtual Environments
17+
# ---------------------------
18+
venv/
19+
env/
20+
.venv/
21+
ENV/
22+
env.bak/
23+
24+
# ---------------------------
25+
# Environment Variables
26+
# ---------------------------
27+
.env
28+
.env.*
29+
*.env
30+
31+
# ---------------------------
32+
# Logs
33+
# ---------------------------
34+
*.log
35+
logs/
36+
37+
# ---------------------------
38+
# Jupyter Notebooks
39+
# ---------------------------
40+
.ipynb_checkpoints/
41+
42+
# ---------------------------
43+
# Data Files
44+
# ---------------------------
45+
data/raw/
46+
data/processed/
47+
48+
# ---------------------------
49+
# Vector Databases
50+
# ---------------------------
51+
vector_store/
52+
faiss_index/
53+
chroma_db/
54+
55+
# ---------------------------
56+
# Model Files
57+
# ---------------------------
58+
models/*.bin
59+
models/*.pt
60+
models/*.gguf
61+
models/*.safetensors
62+
models/checkpoints/
63+
64+
# ---------------------------
65+
# HuggingFace Cache
66+
# ---------------------------
67+
.cache/
68+
huggingface/
69+
hf_cache/
70+
71+
# ---------------------------
72+
# Streamlit
73+
# ---------------------------
74+
.streamlit/secrets.toml
75+
76+
# ---------------------------
77+
# OS Files
78+
# ---------------------------
79+
.DS_Store
80+
Thumbs.db
81+
82+
# ---------------------------
83+
# IDE
84+
# ---------------------------
85+
.vscode/
86+
.idea/
87+
*.swp
88+
*.swo
89+
90+
# ---------------------------
91+
# Temporary Files
92+
# ---------------------------
93+
tmp/
94+
temp/
95+
*.tmp
96+
97+
# ---------------------------
98+
# Coverage / Testing
99+
# ---------------------------
100+
.coverage
101+
htmlcov/
102+
.pytest_cache/
103+
104+
# ---------------------------
105+
# Local experiment notebooks
106+
# ---------------------------
107+
notebooks/output/

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.10
2+
3+
WORKDIR /app
4+
COPY . /app
5+
RUN pip install --no-cache-dir -r requirements.txt
6+
7+
EXPOSE 8000
8+
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
install:
2+
pip install -r requirements.txt
3+
4+
run-api:
5+
uvicorn api.main:app --reload
6+
7+
run-ui:
8+
streamlit run app/streamlit_app.py

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# TenaBot: AI-Powered Personalized Medication Advisor
2+
3+
## Overview
4+
TenaBot is a smart AI assistant that helps patients understand and follow medication instructions. It focuses on the Ethiopian context, translating drug information into local languages and providing guidance in a simple, user-friendly format.
5+
6+
## Key Features
7+
- Generates easy-to-understand medication instructions.
8+
- Supports multiple Ethiopian languages.
9+
- Offers dosage guidance, warnings, and side-effect info.
10+
- Conversational chatbot interface for patient queries.
11+
- Optional voice guidance with text-to-speech.
12+
13+
## Installation Instructions
14+
1. Clone the repository:
15+
```bash
16+
git clone https://github.com/epythonlab2/TenaBot.git
17+
cd TenaBot
18+
```
19+
20+
2. Set up a virtual environment (recommended):
21+
```bash
22+
python -m venv venv
23+
source venv/bin/activate # Windows: venv\Scripts\activate
24+
```
25+
26+
3. Install dependencies:
27+
```bash
28+
pip install -r requirements.txt
29+
```
30+
31+
## Project Structure
32+
```
33+
TenaBot/
34+
├── data/ # Raw and processed medicine data
35+
├── notebooks/ # Data analysis and AI prompt experiments
36+
├── src/ # Source code: ingestion, preprocessing, AI, API
37+
├── models/ # Saved models or embeddings
38+
├── app/ # Frontend application
39+
├── tests/ # Unit and integration tests
40+
├── docs/ # Documentation and diagrams
41+
├── README.md
42+
└── requirements.txt
43+
```
44+
45+
## Usage
46+
### Start API Backend
47+
```bash
48+
cd src/api
49+
uvicorn app:app --reload
50+
```
51+
Access endpoints at `http://127.0.0.1:8000`.
52+
53+
### Run Frontend (Optional)
54+
If using Streamlit:
55+
```bash
56+
cd app
57+
streamlit run app.py
58+
```
59+
60+
## Contributing
61+
1. Fork the repository.
62+
2. Create a branch: `git checkout -b feature/YourFeature`
63+
3. Commit changes: `git commit -m 'Add feature'
64+
4. Push branch: `git push origin feature/YourFeature`
65+
5. Open a pull request.
66+
67+
## License
68+
MIT License
69+
70+
## Contact
71+
Email: asibeh.tenager@gmail.com

0 commit comments

Comments
 (0)