A TikTok-themed web app that analyzes your content consumption patterns with animated results.
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install packages
pip install -r requirements.txtCreate a .env file for API access (app works without it):
OPENAI_API_BASE=https://api.openai.com/v1
OPENAI_API_KEY=your_key_herepython app.pyOpen: http://127.0.0.1:5000/
- Upload CSV: Click "Browse" and select
test_data.csv(included in project) - Click "Analyze": Watch the animated results appear
- View Results: 5 cards will appear sequentially with animations
Required columns:
type- Content type (e.g., "content_view")category- Category name (e.g., "history", "science")duration_sec- Duration in seconds (number)completion- Completion rate 0.0-1.0 (number)
Example (test_data.csv):
type,category,duration_sec,completion
content_view,history,90,0.95
content_view,science,120,0.85python test_analyze.pyOr with curl:
curl -X POST http://127.0.0.1:5000/analyze -F "file=@test_data.csv"- Error messages: Check the terminal where
python app.pyis running - Missing dependencies: Run
pip install -r requirements.txt - CSV errors: Ensure your CSV has all required columns (see above)
- Port in use: Change port in
app.py:app.run(debug=True, port=5001)