bhattbhavesh91 / cowin-vaccination-slot-availability Goto Github PK
View Code? Open in Web Editor NEWScript to check the available slots for Covid-19 Vaccination Centers from CoWIN API in India.
License: Apache License 2.0
Script to check the available slots for Covid-19 Vaccination Centers from CoWIN API in India.
License: Apache License 2.0
Getting this error.
File "/app/.heroku/python/lib/python3.9/site-packages/streamlit/script_runner.py", line 337, in _run_script
exec(code, module.dict)
File "/app/app.py", line 81, in
if (len(final_df)) and (final_df is not None):
please add the time also as it changes with time as the hospitals get it and add a notifier
I faced same issue with the exposed APIs. Please add headers to safeguard.
I made a project to fix this. You can refer -
https://github.com/RohitNinja/cowin_slots
I cloned the git repository, Build the Dockerfile and run the docker image. After the image starts running, it gives the below message, but Streamlit is not available on any of the URL.
`You can now view your Streamlit app in your browser.
Network URL: http://172.17.0.2:8501
External URL: http://122.175.181.225:8501`
Dead issue
Is there any way by which we can find the rough time when slots open for a particular centre. This time data can be saved and by going through the trends, we can figure out the approximate time at which one can open the portal and book the slot.
### Traceback (most recent call last):
File "c:\users\intel\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\intel\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\INTEL\AppData\Local\Programs\Python\Python39\Scripts\streamlit.exe_main.py", line 4, in
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit_init.py", line 46, in
from streamlit import logger as logger
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\logger.py", line 21, in
from streamlit import config
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\config.py", line 28, in
from streamlit import config_util
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\config_util.py", line 4, in
import click
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\click_init.py", line 7, in
PS C:\Users\INTEL\Desktop\Coding\cowin-vaccination-slot-availability-main> streamlit run app.py
Traceback (most recent call last):
File "c:\users\intel\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\intel\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\INTEL\AppData\Local\Programs\Python\Python39\Scripts\streamlit.exe_main.py", line 4, in
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit_init.py", line 46, in
from streamlit import logger as logger
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\logger.py", line 21, in
from streamlit import config
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\config.py", line 28, in
from streamlit import config_util
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\streamlit\config_util.py", line 4, in
import click
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\click_init.py", line 7, in
from .core import Argument
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 9, in
from .compat import isidentifier
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\click_compat.py", line 685, in
import colorama
File "c:\users\intel\appdata\local\programs\python\python39\lib\site-packages\colorama_init.py", line 2, in
from .initialise import init, deinit, reinit, colorama_text
ValueError: source code string cannot contain null bytes
it shows all this as errors
Hello,
Seems to be this code is not working or needs to update.
After checking found that the API url is changed. In addition to that the JSON structure is also have changed/additions.
Api which you are using gives cached data not real time data.
Hello @bhattbhavesh91, I saw your cowin-vaccination-slot-availability script. I had the same problem of booking for slots. Whenever I saw that a slot of our nearest center was empty, and went to ArogyaSetu to book it, I ran out of time and it was booked.
The main problem was that we had to refresh the page at www.cowin.gov.in an select the state and city every time to see the updated available slots. And this action, probably took some time. Then after that getting and OTP, and the typing it in, this wasted time and therefore, empty slots were booked before I book them.
This continued for 2 days after then I searched on Google to find a solution for quickly booking slots. I found some sites like vaccinateme and getjab, and many more like that which would WhatsApp or Email me whenever an empty slot was found in my area. I was really amazed and curious about how these did it. (BTW, it didn't send me any email or WhatsApp me yet, I did this 4 days before)
Then I searched how to track empty slots in Python, I got some github results, and the first was, obviously, yours. One thing I was really amazed by was the API of Cowin. I tried it, and it really worked (but after a bunch of trials and errors). Then finally, using requests (for, I suppose you know why) and rich (for coloured and pretty printing in console) libraries. Using my laptop every time just to check empty slots wasn't possible for me, so I am using Pydroid app for android to run Python scripts.I really got information about the centers near me and their available capacity. I furthed filtered it down to
if min_age == 18 and if available_capacity > 0 and also if name in LIST_OF_PREFERRED_CENTERS
to match my needs and see only data what I need.
And this really helped me and on 3rd day, I booked it.
I saw your Readme and came to know that you are going to implement certificate downloading and Booking via script. But I saw on API description that the booking one is protected API and the certificate one needed to verify OTP. I did not understand both of them.
So, if you have idea how to do that, or if you are going to implement these, please let me know, or more helpful, explain me if possible.
Thanks,
Harsh
Please Update readme.md for Beginners so that they also can use this amazing piece you guys have prepared for us. Actually what happens is no one can directly use this master piece as a beginner. So what I wanna convey is Please add some * 1. , * 2. Points like this so that people can understand how to implement and take benefit.
Issue in running streamlit on linux. Attribute Error occur
Jalukbari Girls High School of kamrup metropolitan district of assam is not getting displayed
Hello Sir;
I have a suggestion, The script is fine. I am running it and it is working flawlessly. Can we automate the process by setting a time interval? Say every 2 minutes or 15 minutes?
The shortcut is fine. When I press R on the keyboard it is getting executed. Whenever a slot is available a beep notification can be given as well.
Your webapp cowin-vaccination-appointment.herokuapp.com is very helpful and you have already provided the code but I am not a programmer, I would suggest you to add some filters like. Minimum age, Availability and date etc. since you already have the data and code ready. the filters shouldn't be a big deal for you to add.
Thank you
facing this issue while running the script
Traceback:
File "c:\programdata\anaconda3\lib\site-packages\streamlit\script_runner.py", line 337, in _run_script
exec(code, module.dict)
File "C:\Users\Lenovo\cowin-vaccination-slot-availability-main\app.py", line 28, in
mapping_df = load_mapping()
File "c:\programdata\anaconda3\lib\site-packages\streamlit\caching.py", line 573, in wrapped_func
return get_or_create_cached_value()
File "c:\programdata\anaconda3\lib\site-packages\streamlit\caching.py", line 555, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "C:\Users\Lenovo\cowin-vaccination-slot-availability-main\app.py", line 16, in load_mapping
df = pd.read_csv("district_mapping.csv")
import requests
import datetime
import json
import pandas as pd
for state_code in range(1,40):
print("State code: ", state_code)
response = requests.get("https://cdn-api.co-vin.in/api/v2/admin/location/districts/{}".format(state_code))
json_data = json.loads(response.text)
print (json_data)
#for i in json_data["districts"]:
#print(i["district_id"],'\t', i["district_name"])
#print("\n")
Output:
State code: 1
{'message': 'Forbidden'}
State code: 2
{'message': 'Forbidden'}
State code: 3
{'message': 'Forbidden'}
State code: 4
{'message': 'Forbidden'}
State code: 5
{'message': 'Forbidden'}
State code: 6
{'message': 'Forbidden'}
State code: 7
{'message': 'Forbidden'}
.
.
.
.
Hi,
I am using following code
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import requests
import datetime
import json
import pandas as pd
for state_code in range(1,40):
print("State code: ", state_code)
response = requests.get("https://cdn-api.co-vin.in/api/v2/admin/location/districts/{}".format(state_code))
#json_data = json.loads(response.text)
print (response)
#for i in json_data["districts"]:
#print(i["district_id"],'\t', i["district_name"])
#print("\n")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Result is not coming . It is giving <Response [403]> . Whereas same api is working in web browser.
Hello,
If you could include a feature to search an entire state, and also display the availability for a selection of districts instead of selecting one by one, that would be amazing. Thank you for all your efforts!
_Traceback (most recent call last):
File "c:\users\rishu\appdata\local\programs\python\python37\lib\runpy.py", line 192, in _run_module_as_main
return run_code(code, main_globals, None, "main", mod_spec)
File "c:\users\rishu\appdata\local\programs\python\python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\rishu\AppData\Local\Programs\Python\Python37\Scripts\streamlit.exe_main.py", line 4, in
File "c:\users\rishu\appdata\local\programs\python\python37\lib\site-packages\streamlit_init.py", line 49, in
from streamlit.proto.RootContainer_pb2 import RootContainer
File "c:\users\rishu\appdata\local\programs\python\python37\lib\site-packages\streamlit\proto\RootContainer_pb2.py", line 22, in
create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute 'internal_create_key'
I'm getting this error. can you please help me with it?
I've installed all the requirements and followed all the steps. I also have anaconda.
I'm running this command "streamlit run app.py" on powershell.
URL = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id={}&date={}".format(district_id, INP_DATE)
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'}
response = requests.get(URL,headers = headers)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.