/pycoa

pycoa Python source code

Primary LanguageJupyter NotebookMIT LicenseMIT

PyCoA release v2.21

forthebadge made-with-python Made withJupyter GitHub last commit GitHub

April 2020 / October 2023

UK flag English version / FR flag Version française

PyCoA (Python Covid Analysis) is a Python™ framework which provides:

  • a simple access to common Covid-19 databases;
  • tools to represent and analyse Covid-19 data such as time series plots, histograms and maps.
Time serie (cumulative) Time series (G20)
MAP (OECD) Histogram (World
PIE (EU) Histogram by value (Asia)
Spiral plot (USA) Yearly plot (France)

It is designed to be accessible to non-specialists: teenagers learning Python™, students, science journalists, even scientists who are not familiar in data access methods. A simple analysis can be performed out of the box, as well as a more complex analysis for people familiar with Python™ programming. As an example, after installing pycoa to your framework, the following few lines of code produce the four figures introducing this short documentation.

import coa.front as pycoa 

pycoa.setwhom('jhu')
pycoa.plot(option='sumall') # default is 'deaths', for all countries
pycoa.plot(where='g20') # managing region
pycoa.map(where='oecd',what='daily',when='01/05/2023',which='tot_confirmed')

pycoa.setwhom('owid') # changing database to OWID
pycoa.hist(which='total_vaccinations') # default is for all countries
pycoa.hist(which='cur_icu_patients',typeofhist='pie',where='european union')
pycoa.hist(which='total_people_fully_vaccinated_per_hundred',typeofhist='byvalue',where='asia')
pycoa.plot(where='usa',which='total_people_fully_vaccinated',what='weekly',typeofplot='spiral')

pycoa.setwhom('insee')
pycoa.plot(typeofplot='yearly', what='daily', when="01/01/2019:31/12/2022", option=['smooth7','sumall'], title='Deces quotidiens totaux en France')

Since the v2.0 version, PyCoA manages also local data :

Then we get plots like the ones just below. Other databases has been added for Italy or India.

SPF data JHU-USA data
cf.setwhom('spf') # Santé Publique France database
cf.map(which='tot_vacc',tile='esri') # Vaccinations, map view optional tile

cf.setwhom('jhu-usa') # JHU USA database
cf.map(visu='folium') # deaths, map view with folium visualization output

PyCoA works currently inside Jupyter notebook, over a local install or on online platforms such as Google Colab.

A basic demo code is available as a notebook on GitHub logo GitHub, on Google colab logo Google Colab, or on NbViewer logo Jupyter NbViewer. Other notebooks are provided in our coabook page.

Full documentation is on the Wiki.

Authors


ⓒpycoa.fr       Twitter    GitHub    GitLab    User manual    Core documentation    MyBinder launch