Git Product home page Git Product logo

doctoshotgun's Introduction

DOCTOSHOTGUN

This script lets you automatically book a vaccine slot on Doctolib for today or tomorrow, following rules from the French Government.

Python dependencies

  • woob
  • cloudscraper
  • dateutil
  • termcolor
  • playsound

How to use it

Install dependencies:

pip install -r requirements.txt

Run:

./doctoshotgun.py <city> <email> [password]

Optional arguments:

--center "<center_name>" [--center "<other_center>" …]  : filter centers to only choose one from the provided list
--patient <index>                                       : select patient for which book a slot
--pfizer                                                : looking only for a Pfizer vaccine
--moderna                                               : looking only for a Moderna vaccine
--debug                                                 : display debug information
--time-window <days>                                    : set how many next days the script look for slots

With Docker

Build the image:

docker build . -t doctoshotgun

Run the container:

docker run doctoshotgun <city> <email> [password]

Multiple cities

You can also look for slot in multiple cities at the same time. Cities must be separated by commas:

$ ./doctoshotgun.py <city1>,<city2>,<city3> <email> [password]

Filter on centers

You can give name of centers in which you want specifictly looking for:

$ ./doctoshotgun.py paris [email protected] \
      --center "Centre de Vaccination Covid 19 - Ville de Paris" \
      --center "Centre de Vaccination du 7eme arrondissement de Paris - Gymnase Camou"

Select patient

For doctolib accounts with more thant one patient, you can select patient just after launching the script:

$ ./doctoshotgun.py paris [email protected] PASSWORD
Available patients are:
* [0] Roger Philibert
* [1] Luce Philibert
For which patient do you want to book a slot?

You can also give the patient id as argument:

$ ./doctoshotgun.py paris [email protected] PASSWORD -p 1
Starting to look for vaccine slots for Luce Philibert in 1 next day(s)...

Set time window

By default, the script looks for slots between now and next day at 23:59:59. If you belong to a category of patients that is allowed to book a slot in a more distant future, you can expand the time window. For exemple, if you want to search in the next 5 days :

$ ./doctoshotgun.py paris [email protected] -t 5
Password: 
Starting to look for vaccine slots for Roger Philibert in 5 next day(s)...
This may take a few minutes/hours, be patient!

Filter by vaccine

The Pfizer vaccine is the only vaccine allowed in France for people between 16 and 18. For this case, you can use the -z option.

$ ./doctoshotgun.py paris [email protected] PASSWORD -z
Starting to look for vaccine slots for Luce Philibert...
Vaccines: Pfizer
This may take a few minutes/hours, be patient!

It is also possible to filter on Moderna vaccine with the -m option.

Development

Running tests

 $ pip install -r requirements-dev.txt
 $ pytest test_browser.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.