This project analyzes blood donation data and generates visualizations to understand trends and retention rates.
- Python 3.x
- Install required modules by running:
pip install -r requirements.txt
script.py
: Main Python script for analyzing blood donation data.requirements.txt
: List of required Python modules.README.md
: Project overview and instructions.
-
Clone the repository:
git clone https://github.com/your-username/blood-donation-project.git
-
Navigate to the project directory:
cd blood-donation-project
-
Install the required modules:
pip install -r requirements.txt
-
Run the script:
python script.py
Follow these steps to set up a Telegram bot for this project:
-
Create a Telegram bot:
- Open Telegram and search for the "BotFather" bot.
- Start a chat with BotFather and use the
/newbot
command to create a new bot. - Follow the instructions to choose a name and username for your bot. BotFather will provide you with a token for your new bot.
-
Obtain your Telegram Group ID:
- Create a group on Telegram (or use an existing one).
- Add your bot to the group.
- Send any message to the group.
- Open a web browser and go to
https://api.telegram.org/bot<YourBotToken>/getUpdates
(replace<YourBotToken>
with your actual bot token). - Look for the
chat
object and find theid
value. This is your Telegram Group ID.
-
Set up environment variables:
- Create a
.env
file in your project directory. - Add the following lines to the
.env
file:ReplaceTELEGRAM_TOKEN=your_bot_token TELEGRAM_GROUP_ID=your_group_id
your_bot_token
with the token obtained from BotFather andyour_group_id
with the Telegram Group ID.
- Create a
-
Run the script and send plots to Telegram:
- Run your script (
python script.py
). - The script will send plots to the specified Telegram group.
- Run your script (
To schedule the script to run daily at 9 am using cron, follow these steps:
-
Open the crontab file for editing:
crontab -e
-
Check the path to your Python 3 interpreter:
which python3
-
Check the absolute path of your script:
realpath your_script.py
-
Add the following line to schedule the script to run at 9 am every day:
0 9 * * * /path/to/python3 /path/to/script.py ``