Coder Social home page Coder Social logo

msusicky / ockovani-covid Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 9.0 14.38 MB

Repozitář pro projekt zobrazující statistiky očkování.

Home Page: https://ockovani.opendatalab.cz

License: Apache License 2.0

Python 31.41% HTML 23.87% Shell 0.15% Mako 0.03% Dockerfile 0.04% CSS 0.08% Jupyter Notebook 44.32% JavaScript 0.10%
covid19

ockovani-covid's Introduction

Workflow status
deployment deploy-acceptance deploy-production check-disk-space
acceptance test
production update-data-daily update-data-hourly update-data-monthly clean-db
publication update-web update-web-offers post-tweet

COVID-19 data o očkování (https://ockovani.opendatalab.cz)

Za systémem stojí Jan Staněk (http://jstanek.cz/), Marek Sušický (marek(at)susicky.net) a přátele, kteří poskytli cenné připomínky.

Čtěte!

Tento web poskytuje data, která zobrazují statistiky jednotlivých očkovacích míst. Systém je komplikovaný a pro správná rozhodnutí je nezbytné si přečíst, jak funguje. Nezávazně doporučujeme sledovat, kolik je na daném místě registrovaných lidí, kteří mají a nemají termín, kolik je volných slotů na očkování a kolik vakcín přibližně dostává dané místo. Nedává smysl měnit často registraci, změnou registrace se dostáváte na poslední místo ve stejné věkové kategorii na novém místě.

Starý popis webu - před dostupností opendat od UZIS

Během marné snahy zajistit očkovací místa pro příbuzné jsme si všimli toho, že neexistuje žádný přehled volných míst. Ještě v lednu jsme začali tvořit aplikaci, ale narazili na neexistenci dat. Pak došly vakcíny a nedávalo smysl systém spouštět. Nyní je situace taková, že mnoho lidí čeká na vakcinaci, ale pokud nejsou na tom správném místě, budou čekat dál. Na jiných místech už ale lidé 80+ "došli". S naší mapou se lidé mohou přeregistrovat, dostat vakcinu rychleji a zefektivnit celý proces očkování. Prosím kohokoliv, kdo může přispět ke zveřejnění oficiálních dat o volných kapacitách a distribuci vakcín, aby tak učinil.

Web: https://ockovani.opendatalab.cz

Napsali o nás

Poznámky k fungování

Pro získávání dat využívala metody scrapingu. Nyní využíváme oficiálních dat od UZIS.

Aplikace se skládá z modulu fetcher, pak samotného webu a skriptu, který web stáhne a publikuje na github pages. Tento krok je realizován proto, že nechceme vystavovat veřejně aplikační server a chceme přenést zátěž na prostředky Githubu. Navíc jde o statické stránky, u kterých není problém obsloužit mnoho tisíc lidí současně.

How to run it [ENG]

Quick start with docker-compose

To start the server without fetching recent data use docker-compose up.

The development server (default flask one for the moment) will start at port 5000, you can access the deployment at http://localhost:5000/.

If you want to fetch recent data please set the FETCH_DATA environment variable:

FETCH_DATA=true docker-compose up

Installation without docker-compose

  1. create virtual environment

    python3 -m venv venv

  2. activate virtual environment

    source venv/bin/activate

  3. install requirements

    pip install -r requirements.txt

  4. setup config.py according to the config.sample.py template

  5. setup Flask environment

    export FLASK_ENV=development

  6. execute database migrations

    flask db upgrade

  7. fetch data

    flask fetch-data all

  8. compute metrics

    flask compute-metrics all

  9. start Flask webserver

    flask run

Update web

Old manual way, now it's done automatically using GitHub Actions.

  1. activate venv

    source venv/bin/activate

  2. execute database migration if needed

    flask db upgrade

  3. fetch data

    flask fetch-data all

  4. restart or start webserver if needed

    systemctl start ockovani-prd.service

  5. publish website

    bash tools/manual_publish.sh

ockovani-covid's People

Contributors

ara686 avatar fernflower avatar jan-stanek avatar kokes avatar msusicky avatar vpokorny avatar xnekv03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ockovani-covid's Issues

Add more info to the free slots overview

Overview of free slots in "mista" page should contain info about people in queue, ratio of successful reservations within last week, ...

How to include something similar in okres/kraj/misto pages?

  • People in queue
  • Ratio of new reservations in last week
  • Number of vaccines that arrived in the last 7 days
  • Vaccines needed for the 2nd round - #55

Vaccination center detail

We have more details in object OckovaciMisto than we actually use -> add them to the top of the vaccination center page

Statistics - improve

It is necessary to check how big is the difference between consumption and vaccinated people - mista.
It looks that vaccination is better source, or consumption is D-2.

Create a leaflet map

It will be great to have Leaflet map there.
New link on the top is expected with description Map.
All vaccination places should be there - fetched from opendata from UZIS.

Improve vaccination center detail

  • check data - count of used vaccines can be outdated for some vaccination centers - (it is but, warnign added)
  • thousands separator in numbers
  • add doses to model
  • use doses instead of ampoules
  • compute stats using pandas instead of SQL and plain python
  • create reusable UI component
  • hide overflows of category column - tooltip with whole description

Fetch total capacity

Add "celkem_mista" to VolnaMistaDen and VolnaMistaCas, this info has to be fetched from different API endpoint (TODO)

Dates handling

It is necessary to solve date handling - insert new dates and delete old one ?

Move to the new domain - ockovani.opendatalab.cz

To have better URL we'd decided to move under OpenDataLab (@msusicky is one of the leader)
It is already active, but now only redirecting to old repo.

  • Prepare branch with working menu links etc
  • Have a message on the intro page about move
  • Change github pusher
  • Have both working for 2 days - weekend
  • Do a redirect from the old repo

Load last update time from data

Store time of the source data update to the imports table and print this time instead of the time when fetcher started

Show time of the last web update and time of the last data update

Store min date and max date and compare them if they are all from the same day? - fail if new data are not present

Idea - reservation - compute date of assignment

In data there is a flag if registered person has reservation or not. But there is no date of the assignement. Makes sense to compute it from today and yesterday data and put it as a result. Maybe to realize it with trigger ?

Plus -> see how long does it take to obtain a reservation. -> powerful metric

Add exclamation marks

We have more and more notes and warnings in tooltips which are hardly visible - clean and visible way could be exclamation mark next to the column name and tooltip with description.

Github actions pipeline

  • check if main and develop branches are in sync (merges from develop will not bring conflicts)
  • check if main and develop are protected
  • improve logging and exit code of used scripts
  • implement pipeline for main update - deploy to prd environment and update static pages
  • implement pipeline for develop update - deploy to test environment
  • implement scheduled pipeline for data update

Depends on: #97

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.