r/Python • • May 06 '21

Beginner Showcase I created a Python Script to send automated email on availability of COVID-19 Vaccine in India

COVID-19 is on rise in India and the second wave has hit us hard. Though the government has initiated the vaccination for the Age Group 18-45, the vaccine is not available in most of the parts of the country.

After tirelessly searching for vaccine every day on the CoWin portal. I decided to create a Python Script which automatically checks for the desired pincodes (ZIP Codes) and send you the email if the vaccine is available.

The GitHub repo for the Script

The detailed blog on how to use it.

81 Upvotes

19 comments sorted by

7

u/_Rj__ May 06 '21

Heyy, I created a similar thing, except I run it on my own pc and use this Google form to get people to add themselves to the mailing list.

Here's the link the to GitHub Repo

I was hesitant to post it here earlier but your post gives me confidence xD

(I've posted it on r/Delhi to see how much load can I handle)

2

u/SunInLeo May 06 '21

Noticed few improvements that can be made.

I tried this script in my local but for the pincode I enter, I only get a header field in the email. Probably the header should be ignored and a proper error messages should be sent in the email.

Also if I invoke the script multiple times, I get the same header repeated that many times in the email.

Since this script is using python 3.9, it cannot be hosted in python anywhere.com as there is no support for above python3.8.

1

u/uditvashisht May 07 '21

I dont think that one would get just the header, because the df is created only in the case of availability.

1

u/SunInLeo May 07 '21

Ok. I tried with the pin code 560066, they are completely booked and availability is 0(found by debugging that there are results). May be for this specific case it just returns the header.

1

u/uditvashisht May 07 '21

Try deleting the .txt file generated in the folder. Delete it and then run. It shouldn’t be the case. I will check .

4

u/[deleted] May 06 '21

Oh post this on r/IndiaSpeaks and r/chodi, they'll help spread this. I'll spread this too and maybe even try to contribute (although I'm not a professional lol)!

6

u/uditvashisht May 06 '21

Couldn’t post in r/IndiaSpeaks as dont have the comment karma

4

u/[deleted] May 06 '21

Oh. May I xpost this on the sub then?

1

u/uditvashisht May 06 '21

Sure thanks

3

u/nickbernstein May 06 '21

It's pretty crazy that they don't do that already. Stay safe and good luck with getting a vaccine soon.

5

u/uditvashisht May 06 '21

With a population 137+ crores it is not possible for the government to send the notifications to everyone. Even the portal itself crashed on the very first day of registration for vaccination. These are scary times. But this too shall pass. Thanks

4

u/nickbernstein May 06 '21

It's not that many at the same time. It's how many doses are available, but I can understand that there are challenges there.

11

u/[deleted] May 06 '21

Also you can change your min python version required from 3.9 to 3.6 since f-strings were introduced in 3.6

0

u/[deleted] May 06 '21

[deleted]

3

u/uditvashisht May 06 '21

Great work

3

u/[deleted] May 06 '21

[removed] — view removed comment

1

u/uditvashisht May 06 '21

You are welcome!!!

0

u/[deleted] May 07 '21

[deleted]