A real-time election results dashboard for the 2024 Sri Lankan presidential election, utilizing web scraping and data visualization techniques to display live updates.
The live election data is sourced from the official Sri Lanka Elections Commission Results Website.
- Live Updates: Refreshes data every 60 seconds
- Interactive Chart: Visualizes vote counts and percentages
- Responsive Design: Works on desktop and mobile devices
- Easy to Use: Simple setup and execution
[Insert a screenshot or GIF of your dashboard here]
-
Clone the repository:
git clone https://github.com/govarthenan/live-election-dashboard.git cd live-election-dashboard
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
To run the Live Election Dashboard, ensure you acitvated the virtual environment and then run the following command:
python main.py
Open your web browser and navigate to http://localhost:8050
to view the live dashboard.
You can modify the number of candidates displayed by changing the num_pairs
parameter in the scrape_data()
function call within live-chart.py
:
data = scrape_data(num_pairs=5) # Change this number to scrape more or fewer pairs
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is MIT licensed.
Govarthenan Rajadurai
- GitHub: @govarthenan
- Email: [email protected]
- Dash for the interactive web application framework
- Plotly for the beautiful charts
- Beautiful Soup for web scraping capabilities
Made with ❤️ and Python