Cowin Vaccine Tracker
Python API wrapper for vaccine availability by Pincode, DistrictId for 1 week and get detailed list of all states, Districts.
India's digital platform launched by the govt. to help citizens register themselves for the vaccination drive by booking an appointment at the nearby available vaccination centres.
The process to search for available slots to take the vaccine is tedious as you need to log in to the portal every time.
This wrapper API enables folks to build their own versions of a system to lookup for vaccine availablity either in a district or in a particular pin code.
Example:
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
states = cowin.get_states_table()
print(states)
Installation
pip install cowinapi_by_ishaan
Usage
This wrapper currently covers nine endpoints used by the CoWin portal specified below.
Initialize
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
Get All States In Tabular Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
states = cowin.get_states_table()
print(states)
Get All States In List Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
states = cowin.get_states_list()
print(states)
Get All States In Dictionary Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
states = cowin.get_states_dict()
print(states)
Get All Districts In Tabular Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
districts = cowin.get_districts_tables()
print(districts)
Get All Districts In List Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
districts = cowin.get_districts_list()
print(districts)
Get All Districts In Dictionary Form
from cowinapi_by_ishaan import FetchData
cowin = FetchData()
districts = cowin.get_districts_dict()
print(districts)
Detailed Availability By Pincode for a week
from cowinapi_by_ishaan import FetchData
pin_code = "110001"
cowin = FetchData()
#pass number of days in method to get data for next specified days or 7 days is taken as default
available_centers = cowin.get_availability_by_pincode(pin_code)
print(available_centers)
available_centers_by_days = cowin.get_availability_by_pincode(pin_code,5)
print(available_centers_by_days)
Detailed Availability By DistrictID for a week
from cowinapi_by_ishaan import FetchData
district_id = "394"
cowin = FetchData()
#pass number of days in method to get data for next specified days or 7 days is taken as default
available_centers = cowin.get_centers_by_districtId(district_id)
print(available_centers)
available_centers_by_days = cowin.get_centers_by_districtId(district_id,5)
print(available_centers_by_days)
Simple Availability By Pincode for a week
from cowinapi_by_ishaan import FetchData
pin_code = "110001"
cowin = FetchData()
#pass number of days in method to get data for next specified days or 7 days is taken as default
available_centers = cowin.get_availability_by_pincode(pin_code)
print(available_centers)
available_centers_by_days = cowin.get_availability_by_pincode(pin_code,5)
print(available_centers_by_days)
Notes:
The CoWIn API's sometimes return a 401 Unauthorized response. Please wait for a few minutes before trying again.
Please try not to spam the CoWin servers and try to keep a timeout between subsequent requests if you are polling at a fixed interval
Contributions
Contributions are always welcome!
License
© 2021 Ishaan Gupta
This repository is licensed under the Apache License 2.0. See LICENSE for details.
Change Log
0.0.1 (02/05/2021)
- First Release
0.0.2 (13/05/2021)
- Second Release
0.0.3 (14/05/2021)
- Third Release
Metadata
Release files for cowinapi-by-ishaan 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cowinapi_by_ishaan-0.0.3.tar.gz | 9.1 kB | Without provenance | Details |
Release files / cowinapi_by_ishaan-0.0.3.tar.gz
| Download URL | cowinapi_by_ishaan-0.0.3.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3561ad9d92eca5f6cce3867d54977d53425569a26ecbe43f64ada79a415d7d81
|
|
BLAKE2b-256 checksum How to use checksums |
f63930e86c9a9bf2439286ef8b918223731455eb3bbcd7871198ab7250cb71fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.4
|
Security for cowinapi-by-ishaan 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.