Skip to content

Commit

Permalink
fixes: 1. added GUI for better workability with the app
Browse files Browse the repository at this point in the history
2. added screenshots of GUI app
3. few other bug fixes and improvement
  • Loading branch information
divagicha committed May 27, 2021
1 parent d99f983 commit b453a8e
Show file tree
Hide file tree
Showing 10 changed files with 1,015 additions and 55 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['buymeacoffee.com/divagicha']
212 changes: 186 additions & 26 deletions CovidVaccineChecker/__init__.py

Large diffs are not rendered by default.

45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
# Table of Contents
- [About The Project](#about-the-project)
- [Customizable Options in the Program](#customizable-options-in-the-program)
- [Screenshots](#screenshots)
- [Screenshots of GUI App](#screenshots-of-gui-app) ![for windows users only](https://img.shields.io/badge/Operating%20System-Windows-green?style=plastic)
- [Screenshots of Console App](#screenshots-of-console-app)
- [Prerequisites](#prerequisites)
- [Installation (via ZIP file)](#installation-via-zip-file)
- [Installation (via EXE file)](#installation-via-exe-file) ![for windows users only](https://img.shields.io/badge/Operating%20System-Windows-green?style=plastic)
- [Important Points to Keep In Mind](#important-points-to-keep-in-mind)
- [Contributing](#contributing)
- [Contact](#contact)


<!-- ABOUT -->
Expand All @@ -74,8 +75,23 @@ As it's a difficult task to schedule an appointment for CoVid-Vaccine with only
10. Min Age Limit *(minimum age limit of the selected beneficiaries. All selected beneficiaries must belong to the same minimum age group, either 18+ or 45+)*


<a name="screenshots"></a>
## Screenshots
<a name="screenshots-of-gui-app"></a>
## Screenshots of GUI App

![](./images/screenshots/7.png)


![](./images/screenshots/8.png)


![](./images/screenshots/9.png)


![](./images/screenshots/10.png)


<a name="screenshots-of-console-app"></a>
## Screenshots of Console App

![](./images/screenshots/1.png)

Expand Down Expand Up @@ -134,12 +150,21 @@ As it's a difficult task to schedule an appointment for CoVid-Vaccine with only
<a name="installation-via-exe-file"></a>
### Installation (via EXE file)

1. Navigate to the **'dist'** directory for the setup file or click [here](https://github.com/DivAgicha/CoWIN-Vaccine-Appointment-Booking/raw/master/dist/CovidVaccinationAppointmentScheduler-Setup-v1.2.2.exe) to download the same for Windows.
1. Navigate to the **'dist'** directory for the setup file or click [here](https://github.com/DivAgicha/CoWIN-Vaccine-Appointment-Booking/raw/master/dist/CovidVaccinationAppointmentScheduler-Setup-v2.0.exe) to download the same for Windows.
2. Double-click the installer file and follow the instructions to install the program.
3. Upon successful installation you will find `Covid Vaccination Appointment Scheduler` folder in your `C:\Program Files (x86)\` directory.
4. Open the folder and run `schedule_vaccination_appointment.exe` file.


<!-- IMPORTANT -->
<a name="important-points-to-keep-in-mind"></a>
## Important Points to Keep In Mind
- This is a proof of concept project. I do NOT endorse or condone, in any shape or form, automating any monitoring/booking tasks. **Developed for Educational Purpose; USE IT AT YOUR OWN RISK. I SHOULD NOT BE DEEMED RESPONSIBLE FOR ANY LEGAL CONCERNS.**
- This goes without saying but, once you get your shot, please do help out any underprivileged people around you who may not have a laptop or the know-how. For instance any sort of domestic help, or the staff in your local grocery store, or literally the thousands of people who don't have the knowledge or luxury we do.
- If you accidentally book a slot, don't worry. You can always login to the [Official portal](https://selfregistration.cowin.gov.in/) and cancel or re-schedule the booking. There is no option available for rescheduling or cancellation of Booking Slot in the Application. There will be an X symbol on the right-top corner for each beneficiary to cancel from CoWIN Portal.
- There is no option to register new mobile or add beneficiaries. This can be used only after beneficiary has been added through the Official WebApp of [CoWIN](https://cowin.gov.in/).



<!-- CONTRIBUTING -->
<a name="contributing"></a>
Expand All @@ -155,16 +180,6 @@ Contributions are what make the open source community such an amazing place to l



<!-- CONTACT -->
<a name="contact"></a>
## Contact

Name - Divyansh Agicha - [div.agicha@gmail.com](mailto:div.agicha@gmail.com)

Project Link: [https://github.com/DivAgicha/CoWIN-Vaccine-Appointment-Booking](https://github.com/DivAgicha/CoWIN-Vaccine-Appointment-Booking)



<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/DivAgicha/CoWIN-Vaccine-Appointment-Booking.svg?style=for-the-badge
Expand Down
Binary file not shown.
Binary file added images/screenshots/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshots/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 21 additions & 14 deletions schedule_vaccination_appointment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from CovidVaccineChecker import TextColors, CoWINAPI


os.system("color FF") # to get screen colors when running script on shell / CMD
os.system("color 0F") # to get screen colors when running script on shell / CMD

print(f"""
.oooooo. oooooo oooooo oooo ooooo ooooo ooo .o. ooooooooo. ooooo
Expand Down Expand Up @@ -58,13 +58,10 @@
break
elif answer.lower().strip() == 'c':
cowinAPI.changeAppointmentDate(user_config_file)
break
elif answer.lower().strip() == 's':
cowinAPI.changeSearchCriteria(user_config_file)
break
elif answer.lower().strip() == 't':
cowinAPI.changeSlotPreference(user_config_file)
break
elif answer.lower().strip() == 'q':
print(f"\nExiting program...")
exit(0)
Expand Down Expand Up @@ -120,19 +117,19 @@
reference_ids = ids_input.strip().replace(" ", "").split(",")

if ids_input.strip().lower() != '0':
beneficiary_index_pattern = re.compile("^[1-4]$")
areValidIds = [bool(beneficiary_index_pattern.match(id)) for id in reference_ids]
# beneficiary_index_pattern = re.compile("^[1-4]$")
areValidIds = [bool(0 < int(id) <= len(beneficiaries)) for id in reference_ids if id != '']
if False in areValidIds:
print(f"\n{TextColors.FAIL}Please enter correct indexes to proceed to booking{TextColors.ENDC}")
continue

if not isinstance(reference_ids[0], int):
reference_ids = [int(id) for id in reference_ids]
reference_ids = [int(id) for id in reference_ids if id != '']
if reference_ids[0] == 0:
reference_ids = [beneficiary['beneficiary_reference_id'] for beneficiary in beneficiaries]
break
else:
correct_ids_entered_flag = True
# correct_ids_entered_flag = True
reference_ids = [id-1 for id in reference_ids if 0 < id <= len(beneficiaries)]
reference_ids = [beneficiary['beneficiary_reference_id'] for idx, beneficiary in enumerate(beneficiaries) if idx in reference_ids]

Expand Down Expand Up @@ -180,8 +177,9 @@
print(f"{TextColors.FAIL}No Centre Found{TextColors.ENDC} (Either all centres are fully booked for the selected appointment date or "
f"slots aren't opened yet. You can continue with the same configuration or try changing date or search criteria)")

print(f"\n{TextColors.BOLD}Note: Continue with existing configuration only if you are sure that slots are gonna open "
f"in few minutes!{TextColors.ENDC}")
while True:
print(f"\n{TextColors.BOLD}Note: Continue with existing configuration only if you are sure that slots are gonna open in few minutes!{TextColors.ENDC}")
answer = input(f"\n-->\tEnter choice {TextColors.WARNING}(Continue with existing configuration (y) / "
f"Change appointment date (c) / Change search criteria (s)){TextColors.ENDC}: ")

Expand All @@ -191,12 +189,12 @@
break
elif answer.lower().strip() == 'c':
cowinAPI.changeAppointmentDate(user_config_file, load_values_from_existing_config_first=False)
print(f"\n{TextColors.WARNING}[+]{TextColors.ENDC} Appointment date changed successfully", end="")
break
print(f"\n{TextColors.WARNING}[+]{TextColors.ENDC} Appointment date changed successfully")
# break
elif answer.lower().strip() == 's':
cowinAPI.changeSearchCriteria(user_config_file, load_values_from_existing_config_first=False)
print(f"\n{TextColors.WARNING}[+]{TextColors.ENDC} Search criteria changed successfully", end="")
break
print(f"\n{TextColors.WARNING}[+]{TextColors.ENDC} Search criteria changed successfully")
# break
else:
print(f"\n{TextColors.FAIL}Invalid input! Please enter a valid option to continue{TextColors.ENDC}")
else:
Expand All @@ -209,6 +207,7 @@
print(f"\n{TextColors.BLACKONGREY}Total Centres Found: {len(all_centres)}{TextColors.ENDC}", end="")

attempts = 0
appointment_booked_flag = False

while True:
try:
Expand Down Expand Up @@ -241,4 +240,12 @@
exit(1)

if not appointment_booked_flag:
print(f"\n{TextColors.FAIL}FAILED: Appointment could not be booked, as no valid slot found to be available. Please try again after 1 minute.{TextColors.ENDC}")
print(f"\n{TextColors.FAIL}FAILED: Appointment could not be scheduled, as no valid slot found to be available. Please try again after 1 minute.{TextColors.ENDC}")
else:
print(f"\n{TextColors.SUCCESS}Hurray!! Your appointment has been successfully scheduled. Following are the details:\n\n"
f"Apt. ID: {appointment_id}\n"
f"Centre: {cowinAPI.appointment_centre_booked}\n"
f"Date: {cowinAPI.appointment_date}\n"
f"Slot: {cowinAPI.appointment_slot_selected}{TextColors.ENDC}")
input("\nPress any key to exit...")
exit(1)
Loading

0 comments on commit b453a8e

Please sign in to comment.