Coder Social home page Coder Social logo

gydytojas's Introduction

gydytojas

Gydytojas is a command line tool for searching for available Medicover visits. It also supports periodic retries if no visits are found and automatic booking.

Usage examples

Assuming we'd like to find available internist visits in Kraków:

gydytojas.py --region 'Kraków' --username 888888 --password secret 'Internista'

In some cases it can be useful to specify multiple specializations, e.g.:

gydytojas.py --region 'Kraków' --username 888888 --password secret 'Internista' 'Medycyna Rodzinna -- dorośli'

Searching for visits might give too many results, so we can additionally narrow down the search to a date range:

gydytojas.py --region 'Kraków' --username 888888 --password secret --start 2019-01-10 --end 2019-01-12 'Internista'

The time boundaries are inclusive -- in the example above the script will try to find visits from 2019-01-10 00:00 to 2019-01-12 23:59. The --start and --end switches accept dates and times in ISO format (e.g. 2019-01-10, 2019-01-10T10:00:00, 2019-01-10 10:00:00 and 2019-01-10 10:00 are all fine). Of course, only one time boundary can be specified (--start xor --end).

If there's to many search constraints, a visit may not be available. In these cases it's worth using the --keep-going switch to make the script retry until a visit is found. Additionally, the first available visit can be booked automatically by using --autobook:

gydytojas.py --username 888888 --password secret --end 2019-01-12 --keep-going --autobook 'Internista'

Full help

usage: gydytojas.py [-h] [--region REGION] [--username USERNAME] [--password PASSWORD] [--doctor DOCTOR] [--clinic CLINIC] [--after start time] [--before end time] [--margin margin] [--autobook] [--reschedule]
                    [--keep-going] [--diagnostic-procedure] [--interval INTERVAL] [--time TIME]
                    specialization [specialization ...]

Check Medicover visit availability

positional arguments:
  specialization        desired specialization, multiple can be given

optional arguments:
  -h, --help            show this help message and exit
  --region REGION, -r REGION
                        Region
  --username USERNAME, --user USERNAME, -u USERNAME
                        user name used for login
  --password PASSWORD, --pass PASSWORD, -p PASSWORD
                        password used for login
  --doctor DOCTOR, --doc DOCTOR, -d DOCTOR
                        desired doctor, multiple can be given
  --clinic CLINIC, -c CLINIC
                        desired clinic, multiple can be given
  --after start time, -A start time
                        search period start time.
  --before end time, -B end time
                        search period end time
  --margin margin, -m margin
                        minimum time from now till the visit
  --autobook, --auto, -a
                        automatically book the first available visit
  --reschedule, -R      reschedule existing appointments if needed when autobooking
  --keep-going, -k      retry until a visit is found or booked
  --diagnostic-procedure
                        search for diagnostic procedures instead of consultations
  --interval INTERVAL, -i INTERVAL
                        interval between retries in seconds, use negative values to sleep random time up to the given amount of seconds
  --time TIME           acceptable visit time range

Running with Docker

The script can be run using Docker. The image can be built locally the usual way or pulled from the GitHub Container registry:

docker run --rm ghcr.io/mlesniew/gydytojas

Known bugs

  • When -k is used, the session can eventually time out causing an unhandled exception

Credits

The steps required to login to the Medicover system were copied from the excellent Medihunter project.

gydytojas's People

Contributors

dependabot[bot] avatar fastman avatar mlesniew avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gydytojas's Issues

Script params

Can you please add support for passing user, pass and all others variables as script params?

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.