Historify is a professional-grade web application for downloading, managing, and visualizing historical stock market data. Built with a modern, intuitive admin dashboard interface, it provides comprehensive tools for bulk data operations, real-time monitoring, and advanced charting capabilities.
- Professional Design System: Clean, modern UI inspired by Stripe, Vercel, and Supabase dashboards
- Dark/Light Mode: Seamless theme switching with persistent preferences
- Responsive Layout: Fully responsive design that works on desktop and mobile devices
- Command Palette: Quick access to all features with keyboard shortcuts (Cmd/Ctrl + K)
-
Bulk Symbol Import:
- CSV and Excel file support with drag-and-drop interface
- Paste data directly from clipboard
- Manual entry with auto-complete
- Real-time validation and duplicate detection
- Exchange auto-detection with manual override
-
Bulk Data Export:
- Multiple export formats (Individual CSV, Combined CSV, ZIP archives)
- Custom date range selection with presets
- Configurable intervals (1m, 5m, 15m, 30m, 1h, daily)
- Background processing for large exports
- Export queue management with progress tracking
-
Bulk Download:
- One-click download for entire watchlist
- Smart scheduling with API rate limit respect
- Resume capability for interrupted downloads
- Parallel processing with thread pool management
- Real-time progress tracking with ETA
- Multiple Exchange Support: NSE, BSE, NFO, MCX, CDS and more
- Dynamic Watchlist: Real-time quotes with auto-refresh
- TradingView Charts: Professional-grade charting with technical indicators
- Technical Indicators: EMA, RSI with customizable parameters
- Incremental Updates: Checkpoint system for efficient data updates
- Data Quality Monitoring: Track data completeness and quality metrics
- Automated Data Downloads: Schedule downloads at specific times in IST
- Flexible Scheduling Options:
- Daily schedules at specific times
- Interval-based schedules (every N minutes)
- Pre-configured market close (3:35 PM IST) and pre-market (8:30 AM IST) schedules
- Job Management: Pause, resume, delete, or run jobs immediately
- Background Processing: Non-blocking scheduled downloads
- Watchlist Integration: Automatically download all watchlist symbols
- Custom Symbol Selection: Schedule downloads for specific symbols
-
Clone the repository:
git clone https://github.com/marketcalls/historify.git cd historify/historify -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Note: The scheduler feature requires APScheduler which is included in requirements.txt
-
Configure environment:
cp .env.sample .env # Edit .env with your API keys and settings -
Run the application:
python run.py
-
Access the dashboard: Open
http://localhost:5001in your browser
historify/
βββ app/
β βββ models/ # Database models
β βββ routes/ # API and page routes
β βββ static/
β β βββ css/ # Stylesheets and design system
β β βββ js/ # JavaScript modules
β β βββ image/ # Static images
β βββ templates/ # Jinja2 templates
β βββ utils/ # Utility functions
βββ instance/ # Instance-specific data
βββ requirements.txt # Python dependencies
βββ run.py # Application entry point
The application features a comprehensive design system with:
- Color Palette: Semantic colors for success, warning, error, and info states
- Typography: Inter font family with clear hierarchy
- Components: Reusable buttons, cards, tables, modals, and form elements
- Animations: Smooth transitions and loading states
- Icons: FontAwesome integration for consistent iconography
POST /api/download- Download historical dataPOST /api/import-symbols- Import symbols to watchlistPOST /api/export- Export data in various formatsGET /api/export/queue- Check export queue statusGET /api/export/download/<export_id>- Download exported CSV file
GET /api/symbols- Get available symbolsGET /api/quotes- Fetch real-time quotesGET /watchlist/items- Manage watchlist
GET /charts/api/chart-data/<symbol>/<exchange>/<interval>/<ema>/<rsi>- Chart data with indicators
GET /api/scheduler/jobs- Get all scheduled jobsPOST /api/scheduler/jobs- Create a new scheduled jobDELETE /api/scheduler/jobs/<job_id>- Delete a scheduled jobPOST /api/scheduler/jobs/<job_id>/pause- Pause a scheduled jobPOST /api/scheduler/jobs/<job_id>/resume- Resume a paused jobPOST /api/scheduler/jobs/<job_id>/run- Run a job immediatelyPOST /api/scheduler/test- Create a test job
- Backend: Flask, SQLAlchemy, SQLite, APScheduler
- Frontend:
- Tailwind CSS + DaisyUI for styling
- TradingView Lightweight Charts 5.0.0
- Vanilla JavaScript with modern ES6+
- Data Processing: Pandas, NumPy for technical analysis
- API Integration: OpenAlgo API for market data
- Task Scheduling: APScheduler with IST timezone support
# API Configuration
OPENALGO_API_KEY=your_api_key_here
OPENALGO_API_URL=http://127.0.0.1:5000
# Database
DATABASE_URI=sqlite:///historify.db
# App Settings
SECRET_KEY=your_secret_key_here
DEBUG=FalseAdd to your OpenAlgo .env:
CORS_ALLOWED_ORIGINS = 'http://127.0.0.1:5000,http://127.0.0.1:5001'- Navigate to Import page from sidebar
- Choose import method:
- File Upload: Drag & drop CSV/Excel files
- Paste Data: Copy/paste from spreadsheets
- Manual Entry: Type symbols with auto-complete
- Map columns and validate data
- Review validation results
- Import valid symbols
- Go to Export page
- Select symbols (use search/filters)
- Choose date range and interval
- Select export format
- Configure options (headers, metadata)
- Start export (background processing for large datasets)
- Access Download page
- Select symbols or use watchlist
- Configure intervals and date ranges
- Choose download mode (fresh/continue)
- Monitor real-time progress
- Handle failures with automatic retry
- Navigate to Scheduler page from sidebar
- Quick setup options:
- Market Close Download: Automatically download at 3:35 PM IST
- Pre-Market Download: Download before market opens at 8:30 AM IST
- Test Scheduler: Run a test job in 10 seconds
- Custom schedules:
- Daily Schedule: Set specific time in IST
- Interval Schedule: Run every N minutes
- Configure data interval (1m, 5m, 15m, daily, etc.)
- Select all watchlist symbols or specific symbols
- Manage jobs:
- View next run time and status
- Pause/resume jobs as needed
- Run jobs immediately
- Delete unwanted schedules
- Batch Processing: Symbols processed in configurable batches
- Rate Limiting: Respects API rate limits (10 symbols/second)
- Database Optimization: Dynamic table creation per symbol-interval
- Lazy Loading: Virtual scrolling for large datasets
- Background Jobs: Queue system for long-running operations
- Efficient Export: Streams CSV data directly without loading entire dataset in memory
- Scheduled Downloads: Non-blocking background processing for automated downloads
- Input Validation: Comprehensive validation for all user inputs
- Session Management: Secure session handling for export operations
- Environment Variables: Sensitive data in .env files
- SQL Injection Prevention: SQLAlchemy ORM queries
- XSS Protection: Template auto-escaping
- Safe Dynamic Table Creation: Sanitized table names for symbol-interval combinations
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- Fixed: Export was returning only 1 record with incorrect dates
- Solution: Implemented proper database querying and CSV generation from dynamic tables
- v1.2.0: Added Scheduler Manager for automated downloads
- v1.1.5: Fixed data export functionality with proper date handling
- v1.1.0: Upgraded to TradingView Charts 5.0.0
This project is licensed under the AGPLv3 License - see the LICENSE file for details.
- TradingView for the excellent charting library
- OpenAlgo for market data API
- APScheduler for robust task scheduling
- The Flask and SQLAlchemy communities
For issues and feature requests, please use the GitHub issue tracker.