The cl-covid19 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-covid19 Reference Manual

This is the cl-covid19 Reference Manual, version 0.1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Nov 04 12:05:05 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Explore COVID-19 data in Common Lisp

The cl-covid19 system provides APIs for exploring and reviewing COVID-19 data in Common Lisp.

The system fetches time-series data from the COVID-19 API, and persists it locally in a SQLite database, so it can be reviewed offline.

COVID-19 Cases in BG with filledcurves

Requirements

Installation

Clone the cl-covid19 repo in your Quicklisp local-projects directory.

git clone https://github.com/dnaeon/cl-covid19.git

Load the system.

CL-USER> (ql:quickload :cl-covid19)

Usage

The following section provides examples to get you started.

Sample database

You can find an already populated database, that you can use in the databases directory of this repo.

Create Database

First, we need to create a connection to the SQLite database.

CL-USER> (defparameter *db-conn*
           (covid19:make-db-conn "covid19.db"))
*DB-CONN*

Next, we need to apply the database migrations, so that the database schema is properly created. Database schema migrations are handled by cl-migratum system.

CL-USER> (covid19:migrate-db *db-conn*)

You should see similar output when applying the database migrations.

 <INFO> [16:01:37] cl-migratum.core core.lisp (apply-pending) -
  Found 3 pending migration(s) to be applied
 <INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
  Applying migration 20200608135822 - create_countries_table
 <INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
  Applying migration 20200611230626 - add_time_series_table
 <INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
  Applying migration 20200611234716 - add_time_series_views

The local SQLite database provides the following tables and views.

| Name | Description | |----------------------------------|----------------------------------------------------| | migration | Contains the applied database migrations | | country | Contains the countries fetched from the remote API | | time_series | Time series for each country and location | | time_series_global | Aggregated global time series | | time_series_per_country | Time series data per country | | time_series_per_country_latest | Latest time series data per country |

Create API Client

In order to fetch data from the COVID-19 API, we need to create an API client.

CL-USER> (defparameter *api-client*
           (covid19:make-api-client))
*API-CLIENT*

Updating local database with latest time series data

Using the API client we've created in the previous step we can now fetch the latest time-series data and persist them locally in our database. In order to do that simply call the COVID19:UPDATE-ALL-DATA function.

CL-USER> (covid19:update-all-data *api-client* *db-conn*)
T

You should probably do that once in a day, since time-series data usually gets updated on daily basis.

Fetching data from the database

The following examples show how to fetch various data from the database.

By default each fetch function will return up to COVID19:*DEFAULT-RESULT-LIMIT* number of items. You can either use the :limit keyword parameter of the fetch function you use, or rebind the above parameter to a value you want.

Another common parameter used by the various fetch functions is :offset, which allows you to skip a given number of items and is useful for retrieving items in pages, when used in combination with the :limit keyword parameter.

The :order keyword parameter, used in some fetching functions controls the order in which items will be returned based on the timestamp column. By default the results will be in descending order (most recent ones). If you need to return items in ascending order (oldest to newest ones), you can use the :asc value for the :order keyword parameter.

Here's how to fetch ten countries using the COVID19:FETCH-COUNTRIES function. You can control the number of results to fetch by using the :limit keyword parameter.

CL-USER> (covid19:fetch-countries *db-conn* :limit 10)
((:|id| 1 :|iso_code| "JE" :|name| "Jersey" :|slug| "jersey")
 (:|id| 2 :|iso_code| "MM" :|name| "Myanmar" :|slug| "myanmar")
 (:|id| 3 :|iso_code| "NA" :|name| "Namibia" :|slug| "namibia")
 (:|id| 4 :|iso_code| "SO" :|name| "Somalia" :|slug| "somalia")
 (:|id| 5 :|iso_code| "AU" :|name| "Australia" :|slug| "australia")
 (:|id| 6 :|iso_code| "GD" :|name| "Grenada" :|slug| "grenada")
 (:|id| 7 :|iso_code| "JP" :|name| "Japan" :|slug| "japan")
 (:|id| 8 :|iso_code| "QA" :|name| "Qatar" :|slug| "qatar")
 (:|id| 9 :|iso_code| "UM" :|name| "US Minor Outlying Islands" :|slug|
  "us-minor-outlying-islands")
 (:|id| 10 :|iso_code| "AG" :|name| "Antigua and Barbuda" :|slug|
  "antigua-and-barbuda"))

You can also use the COVID19:DISPLAY-TABLE function to display a table of the fetched results from your REPL.

CL-USER> (covid19:display-table
          (covid19:fetch-countries *db-conn* :limit 10))
+----+----------+---------------------------+---------------------------+
| id | iso_code | name                      | slug                      |
+----+----------+---------------------------+---------------------------+
|  1 | JE       | Jersey                    | jersey                    |
|  2 | MM       | Myanmar                   | myanmar                   |
|  3 | NA       | Namibia                   | namibia                   |
|  4 | SO       | Somalia                   | somalia                   |
|  5 | AU       | Australia                 | australia                 |
|  6 | GD       | Grenada                   | grenada                   |
|  7 | JP       | Japan                     | japan                     |
|  8 | QA       | Qatar                     | qatar                     |
|  9 | UM       | US Minor Outlying Islands | us-minor-outlying-islands |
| 10 | AG       | Antigua and Barbuda       | antigua-and-barbuda       |
+----+----------+---------------------------+---------------------------+
NIL

In order to get a specific country by either name or ISO code you can use the COVID19:FETCH-COUNTRY function, e.g.

CL-USER> (covid19:fetch-country *db-conn* "BG")
((:|id| 44 :|iso_code| "BG" :|name| "Bulgaria" :|slug| "bulgaria"))

Time series data can be fetched using the COVID19:FETCH-TIME-SERIES function. The results will contain historical records for each country, ordered by timestamp in descending order.

CL-USER> (covid19:display-table
          (covid19:fetch-time-series *db-conn* :limit 10))
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+---------------------+---------------------+------------------+
| timestamp            | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name        | country_slug        | country_iso_code |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+---------------------+---------------------+------------------+
| 2020-06-16T00:00:00Z |       262 |      6 |       179 |     77 |             0 |          0 |             4 |         -4 |          2 | Myanmar             | myanmar             | MM               |
| 2020-06-16T00:00:00Z |        34 |      0 |        18 |     16 |             2 |          0 |             1 |          1 |          3 | Namibia             | namibia             | NA               |
| 2020-06-16T00:00:00Z |      2658 |     88 |       649 |   1921 |            16 |          0 |            27 |        -11 |          4 | Somalia             | somalia             | SO               |
| 2020-06-16T00:00:00Z |      7370 |    102 |      6861 |    407 |            23 |          0 |             5 |         18 |          5 | Australia           | australia           | AU               |
| 2020-06-16T00:00:00Z |        23 |      0 |        22 |      1 |             0 |          0 |             0 |          0 |          6 | Grenada             | grenada             | GD               |
| 2020-06-16T00:00:00Z |     17484 |    934 |     15652 |    898 |            45 |          5 |            85 |        -45 |          7 | Japan               | japan               | JP               |
| 2020-06-16T00:00:00Z |     82077 |     80 |     60461 |  21536 |          1201 |          4 |          1780 |       -583 |          8 | Qatar               | qatar               | QA               |
| 2020-06-16T00:00:00Z |        26 |      3 |        22 |      1 |             0 |          0 |             2 |         -2 |         10 | Antigua and Barbuda | antigua-and-barbuda | AG               |
| 2020-06-16T00:00:00Z |       532 |      9 |       236 |    287 |            49 |          0 |             4 |         45 |         11 | Benin               | benin               | BJ               |
| 2020-06-16T00:00:00Z |      8931 |    212 |      7937 |    782 |            46 |          0 |           109 |        -63 |         12 | Morocco             | morocco             | MA               |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+---------------------+---------------------+------------------+
NIL

If you want to get the time-series data for a given country you can use COVID19:FETCH-TIME-SERIES-FOR-COUNTRY. The following command will return the data for the past 10 days.

CL-USER> (covid19:display-table
          (covid19:fetch-time-series-for-country *db-conn* "Bulgaria" :limit 10))
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
| timestamp            | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name | country_slug | country_iso_code |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
| 2020-06-16T00:00:00Z |      3453 |    181 |      1817 |   1455 |           112 |          5 |            33 |         74 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-15T00:00:00Z |      3341 |    176 |      1784 |   1381 |            51 |          2 |            54 |         -5 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-14T00:00:00Z |      3290 |    174 |      1730 |   1386 |            24 |          2 |             7 |         15 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-13T00:00:00Z |      3266 |    172 |      1723 |   1371 |            75 |          0 |             7 |         68 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-12T00:00:00Z |      3191 |    172 |      1716 |   1303 |           105 |          4 |            28 |         73 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-11T00:00:00Z |      3086 |    168 |      1688 |   1230 |            93 |          1 |            24 |         68 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-10T00:00:00Z |      2993 |    167 |      1664 |   1162 |           104 |          0 |            41 |         63 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-09T00:00:00Z |      2889 |    167 |      1623 |   1099 |            79 |          3 |            36 |         40 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-08T00:00:00Z |      2810 |    164 |      1587 |   1059 |            83 |          4 |            39 |         40 |         44 | Bulgaria     | bulgaria     | BG               |
| 2020-06-07T00:00:00Z |      2727 |    160 |      1548 |   1019 |            16 |          0 |             3 |         13 |         44 | Bulgaria     | bulgaria     | BG               |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
NIL

Latest (most recent) time-series data per country can be fetched using the COVID19:FETCH-TIME-SERIES-LATEST function, e.g.

CL-USER> (covid19:display-table
          (covid19:fetch-time-series-latest *db-conn* :limit 5))
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
| timestamp            | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name | country_slug | country_iso_code |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
| 2020-06-16T00:00:00Z |       262 |      6 |       179 |     77 |             0 |          0 |             4 |         -4 |          2 | Myanmar      | myanmar      | MM               |
| 2020-06-16T00:00:00Z |        34 |      0 |        18 |     16 |             2 |          0 |             1 |          1 |          3 | Namibia      | namibia      | NA               |
| 2020-06-16T00:00:00Z |      2658 |     88 |       649 |   1921 |            16 |          0 |            27 |        -11 |          4 | Somalia      | somalia      | SO               |
| 2020-06-16T00:00:00Z |      7370 |    102 |      6861 |    407 |            23 |          0 |             5 |         18 |          5 | Australia    | australia    | AU               |
| 2020-06-16T00:00:00Z |        23 |      0 |        22 |      1 |             0 |          0 |             0 |          0 |          6 | Grenada      | grenada      | GD               |
+----------------------+-----------+--------+-----------+--------+---------------+------------+---------------+------------+------------+--------------+--------------+------------------+
NIL

In order to fetch the top countries by given column you can use the COVID19:FETCH-TOP-COUNTRIES-BY function. The following example will display the top 5 countries by confirmed cases.

CL-USER> (mapcar (lambda (item)
                   (getf item :|country_name|))
                 (covid19:fetch-top-countries-by *db-conn* :column :confirmed :limit 5))
("United States of America" "Brazil" "Russian Federation" "India"
 "United Kingdom")

The COVID19:FETCH-TIME-SERIES-GLOBAL function returns the aggregated time series on a global scale. The following example will display the stats for the past 10 days.

CL-USER> (covid19:display-table
          (covid19:fetch-time-series-global *db-conn* :limit 10))
+----------------------+-----------+--------+-----------+---------+---------------+---------------+------------+------------+
| timestamp            | confirmed | deaths | recovered | active  | new_confirmed | new_recovered | new_deaths | new_active |
+----------------------+-----------+--------+-----------+---------+---------------+---------------+------------+------------+
| 2020-06-16T00:00:00Z |   8274306 | 451939 |   3954518 | 3867849 |        139803 |         97831 |       6829 |      35143 |
| 2020-06-15T00:00:00Z |   8134503 | 445110 |   3856687 | 3832706 |        133896 |         87626 |       3843 |      42427 |
| 2020-06-14T00:00:00Z |   8000607 | 441267 |   3769061 | 3790279 |        134333 |         71408 |       3365 |      59560 |
| 2020-06-13T00:00:00Z |   7866274 | 437902 |   3697653 | 3730719 |        134598 |         85027 |       4400 |      45171 |
| 2020-06-12T00:00:00Z |   7731676 | 433502 |   3612626 | 3685548 |        118757 |         72581 |       3990 |      42186 |
| 2020-06-11T00:00:00Z |   7612919 | 429512 |   3540045 | 3643362 |        154681 |         85889 |       5290 |      63502 |
| 2020-06-10T00:00:00Z |   7458238 | 424222 |   3454156 | 3579860 |        118483 |         79139 |       4833 |      34511 |
| 2020-06-09T00:00:00Z |   7339755 | 419389 |   3375017 | 3545349 |        124338 |         82260 |       4974 |      37104 |
| 2020-06-08T00:00:00Z |   7215417 | 414415 |   3292757 | 3508245 |        109895 |        152488 |       3825 |     -46418 |
| 2020-06-07T00:00:00Z |   7105522 | 410590 |   3140269 | 3554663 |        118555 |         55087 |       3039 |      60429 |
+----------------------+-----------+--------+-----------+---------+---------------+---------------+------------+------------+
NIL

Executing database queries

If you need to execute a custom query or statement against the database you can use the COVID19:DB-EXECUTE function.

The following example will fetch a country by given ISO code, using a parameterized query.

CL-USER> (covid19:db-execute *db-conn* "SELECT * FROM country WHERE iso_code = ?" "BG")
((:|id| 44 :|iso_code| "BG" :|name| "Bulgaria" :|slug| "bulgaria"))

You can pass the result of COVID19:DB-EXECUTE to COVID19:DISPLAY-TABLE to display the results in a nice table format.

Exporting data to CSV

If you need to export the data in CSV format you can do that by using the COVID19:WRITE-CSV function. This example will export all time series data for a given country.

CL-USER> (with-open-file (out "/tmp/covid19-bg.csv" :direction :output)
           (covid19:write-csv (covid19:fetch-time-series-for-country *db-conn* "BG") :stream out))

Plotting graphs

The following examples assume that you have gnuplot installed already.

In order to plot a graph using the time series data for a given country you can use the COVID19:PLOT-TIME-SERIES-FOR-COUNTRY function. The :limit keyword parameter controls how many rows of data will be fetched from the database.

This example shows how to plot the data for past 90 days for a given country.

CL-USER> (covid19:plot-time-series-for-country *db-conn*
                                               "Bulgaria"
                                               :limit 90)
NIL

This is how the plot looks like at the time of writing this document.

COVID-19 Cases in BG with filledcurves

If you want to use lines, instead of filled curves, which is what above plot generated you can specify an alternative template to be used when plotting the graph, e.g.

CL-USER> (covid19:plot-time-series-for-country *db-conn*
                                               "Bulgaria"
                                               :limit 90
                                               :template covid19:*gnuplot-time-series-with-lines-template*)
NIL

The generated graph looks like this.

COVID-19 Cases in BG with lines

Another plot function that can be used is COVID19:PLOT-TIME-SERIES-GLOBAL.

CL-USER> (covid19:plot-time-series-global *db-conn* :limit 90)
NIL

The generated graph on a global scale looks like this.

COVID-19 Cases Global with filledcurves

The COVID19:PLOT-TOP-COUNTRIES-BY function can be used to plot countries by sorting them first on a given column. Here's an example to plot a histogram per each country based on the latest data from the confirmed column.

CL-USER> (covid19:plot-top-countries-by *db-conn* :column :confirmed :limit 10)
NIL

An example generated graph looks like this.

COVID-19 Top Countries By column

Another set of useful templates which show the new cases per country or on global scale are COVID19:*GNUPLOT-TIME-SERIES-WITH-FILLED-CURVES-NEW-CASES* and COVID19:*GNUPLOT-TIME-SERIES-WITH-LINES-NEW-CASES*.

CL-USER> (covid19:plot-time-series-for-country *db-conn*
                                               "Italy"
                                               :limit 100
                                               :template covid19:*gnuplot-time-series-with-filled-curves-new-cases-template*)
NIL

The graph generated looks like this, which plots the new cases on daily basis.

COVID-19 Cases in IT with lines

The COVID19:PLOT-TIME-SERIES-GLOBAL-ANIMATION function creates an animation of the cases using the global time series data. When creating an animation you need to specify the destination, where the animation will be stored at. The :limit keyword parameter in the example below specifies the number of time series records in ascending order.

CL-USER> (covid19:plot-time-series-global-animation *db-conn*
                                                    #P"/tmp/covid19-global.gif"
                                                    :limit 200)
NIL

The generated animation looks like this.

COVID-19 Global Cases Animation

Another function, which creates animations from time-series data is the COVID19:PLOT-TIME-SERIES-FOR-COUNTRY-ANIMATION.

CL-USER> (covid19:plot-time-series-for-country-animation *db-conn*
                                                         "Italy"
                                                         #P"/tmp/covid19-it.gif"
                                                         :limit 200)
NIL

The generated animation for a given country looks like this.

COVID-19 IT Cases Animation

The :delay, :height, :width and :line-width keyword parameters can be used to further customize the resulting animation.

You could also render any of the existing gnuplot(1) templates defined in the COVID19.GNUPLOT-TEMPLATE package and customize them further, if needed.

In order to do that you need to pass at least two arguments to the template while rendering it - one for the title of the graph, and another one which points to the path containing data points.

The following example shows how to export the data points for a given country to a file, and then renders a template using that file.

CL-USER> (let ((csv-file #P"/tmp/covid19-bg.csv")
               (data-points (covid19:fetch-time-series-for-country *db-conn* "Bulgaria" :limit 90)))
           (with-open-file (out csv-file :direction :output)
             (covid19:write-csv data-points :stream out))
           (covid19:render-gnuplot-template covid19:*gnuplot-time-series-with-filled-curves-template*
                                            :title "Bulgaria"
                                            :datafile (namestring csv-file)))
"#
# gnuplot(1) template for plotting time series with filledcurves
#

set title 'Covid19 Cases - Bulgaria'
set grid
set xdata time
set timefmt '%Y-%m-%dT%H:%M:%S+00:00Z'
set format x '%Y-%m-%d'
set xtics rotate by 45 right
set xlabel 'Time'
set ylabel 'Cases'
set key outside right center
set datafile separator ','
set autoscale fix
set style fill transparent solid 0.3
plot '/tmp/covid19-bg.csv' using 1:2:(0) title 'Confirmed' with filledcurves, \\
     '' using 1:3:(0) title 'Deaths' with filledcurves, \\
     '' using 1:4:(0) title 'Recovered' with filledcurves, \\
     '' using 1:5:(0) title 'Active' with filledcurves
"

Debug logging

The cl-covid19 system uses log4cl for logging purposes.

If you need to adjust the logging level (e.g. set it to debug level), simply evaluate the following expression.

CL-USER> (log:config :debug)

API Client Usage

This section provides some examples on how to use the API client for interfacing with the COVID-19 API.

The COVID19.API package exports functionality for creating an API client and fetching data from the remote API endpoint, most of these symbols are re-exported by the COVID19 package.

First, create an API client.

CL-USER> (defparameter *api-client*
           (covid19:make-api-client))
*API-CLIENT*

If you experience timeout issues, you can also change the timeout settings of the HTTP client, e.g.

(setf dexador:*default-connect-timeout* 300)
(setf dexador:*default-read-timeout* 300)

You can get the list of countries by using the COVID19:GET-COUNTRIES-DATA function, e.g.

CL-USER> (covid19.api:get-countries-data *api-client*)

A summarized statistics for COVID-19 can be retrieved by using the COVID19:GET-SUMMARY-DATA function, e.g.

CL-USER> (covid19.api:get-summary-data *api-client*)

The COVID-19 API provides an endpoint for exporting all data as a ZIP archive. You can get a ZIP archive of all time series data by using the COVID19:GET-TIME-SERIES-ARCHIVE function, e.g.

CL-USER> (covid19:get-time-series-archive *api-client* #P"/tmp/all-data.zip")

You can also display the list of available API endpoints by using the COVID19:DISPLAY-API-ROUTES function, e.g.

CL-USER> (covid19:display-api-routes *api-client*)

An example output looks like this.

.-------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
|                                                                           API Routes @ v0.0.8                                                                           |
+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| PATH                                             | NAME                                                                                                                 |
+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| /webhook                                         | Add a webhook to be notified when new data becomes available                                                         |
| /summary                                         | Summary of new and total cases per country                                                                           |
| /live/country/:country/status/:status            | Get a time series Of Cases Per Country Per Province By Case Type                                                     |
| /live/country/:country/status/:status/date/:date | Get a Time Series Of Cases Per Country Per Province By Case Type After A Date                                        |
| /live/country/:country                           | Get Live List Of Cases Per Country Per Province By Case Type                                                         |
| /export                                          | Get All Data as a zip file                                                                                           |
| /total/country/:country                          | Get List Of Cases Per Country By Case Type                                                                           |
| /total/country/:country/status/:status           | Get List Of Cases Per Country By Case Type                                                                           |
| /country/:country/status/:status                 | Get List Of Cases Per Country Per Province By Case Type                                                              |
| /country/:country/status/:status/live            | Daily list of cases per Country per Province by Case Type, updated with latest live count                            |
| /total/dayone/country/:country/status/:status    | Get List Of Cases Per Country By Case Type From The First Recorded Case                                              |
| /dayone/country/:country/status/:status          | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case                                 |
| /dayone/country/:country/status/:status/live     | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case, updated with latest live count |
| /country/:country                                | Get List Of Cases Per Country Per Province By Case Type                                                              |
| /total/dayone/country/:country                   | Get List Of Cases Per Country By Case Type From The First Recorded Case                                              |
| /dayone/country/:country                         | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case                                 |
| /countries                                       | Get List Of Countries                                                                                                |
| /all                                             | Get All Data                                                                                                         |
+--------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+

Various ~/.sqliterc config settings

When using the command-line interface of SQLite, you might find these config settings useful, which you can just drop in your ~/.sqliterc file.

.headers on
.mode column
.timer on

Contributing

cl-covid19 is hosted on Github. Please contribute by reporting issues, suggesting features or by sending patches using pull requests.

Authors

License

This project is Open Source and licensed under the BSD License.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-covid19

Long Name

cl-covid19

Maintainer

Marin Atanasov Nikolov <dnaeon@gmail.com>

Author

Marin Atanasov Nikolov <dnaeon@gmail.com>

Home Page

https://github.com/dnaeon/cl-covid19

Source Control

https://github.com/dnaeon/cl-covid19

Bug Tracker

https://github.com/dnaeon/cl-covid19

License

BSD 2-Clause

Description

Common Lisp library and utilities for inspecting COVID-19 data

Long Description

# Explore COVID-19 data in Common Lisp

The ‘cl-covid19‘ system provides APIs for exploring and reviewing
[COVID-19](https://en.wikipedia.org/wiki/Coronavirus_disease_2019)
data in Common Lisp.

The system fetches time-series data from the [COVID-19
API](https://covid19api.com), and persists it locally in a
[SQLite](https://www.sqlite.org) database, so it can be reviewed
offline.

![COVID-19 Cases in BG with filledcurves](./images/covid19-bg-filledcurves.png)

## Requirements

* [Quicklisp](https://www.quicklisp.org/beta/)
* [SQLite3](https://sqlite.org) dev libraries
* [gnuplot](http://gnuplot.sourceforge.net) for plotting graphs
* [cl-migratum](https://github.com/dnaeon/cl-migratum) for database migrations

## Installation

Clone the ‘cl-covid19‘ repo in your [Quicklisp
local-projects](https://www.quicklisp.org/beta/faq.html) directory.

“‘ shell
git clone https://github.com/dnaeon/cl-covid19.git
“‘

Load the system.

“‘ common-lisp
CL-USER> (ql:quickload :cl-covid19)
“‘

## Usage

The following section provides examples to get you started.

## Sample database

You can find an already populated database, that you can use in the
[databases](./databases/) directory of this repo.

### Create Database

First, we need to create a connection to the SQLite database.

“‘ common-lisp
CL-USER> (defparameter *db-conn*
(covid19:make-db-conn "covid19.db"))
*DB-CONN*
“‘

Next, we need to apply the database migrations, so that the database
schema is properly created. Database schema migrations are handled by
[cl-migratum](https://github.com/dnaeon/cl-migratum) system.

“‘ common-lisp
CL-USER> (covid19:migrate-db *db-conn*)
“‘

You should see similar output when applying the database migrations.
“‘ common-lisp
<INFO> [16:01:37] cl-migratum.core core.lisp (apply-pending) -
Found 3 pending migration(s) to be applied
<INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
Applying migration 20200608135822 - create_countries_table
<INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
Applying migration 20200611230626 - add_time_series_table
<INFO> [16:01:37] cl-migratum.core core.lisp (apply-and-register) -
Applying migration 20200611234716 - add_time_series_views
“‘

The local SQLite database provides the following tables and views.

| Name | Description |
|———————————-|—————————————————-|
| ‘migration‘ | Contains the applied database migrations |
| ‘country‘ | Contains the countries fetched from the remote API |
| ‘time_series‘ | Time series for each country and location |
| ‘time_series_global‘ | Aggregated global time series |
| ‘time_series_per_country‘ | Time series data per country |
| ‘time_series_per_country_latest‘ | Latest time series data per country |

### Create API Client

In order to fetch data from the COVID-19 API, we need to create an
API client.

“‘ common-lisp
CL-USER> (defparameter *api-client*
(covid19:make-api-client))
*API-CLIENT*
“‘

### Updating local database with latest time series data

Using the API client we’ve created in the previous step we can now
fetch the latest time-series data and persist them locally in our
database. In order to do that simply call the
‘COVID19:UPDATE-ALL-DATA‘ function.

“‘ common-lisp
CL-USER> (covid19:update-all-data *api-client* *db-conn*)
T
“‘

You should probably do that once in a day, since time-series data
usually gets updated on daily basis.

### Fetching data from the database

The following examples show how to fetch various data from the
database.

By default each fetch function will return up to
‘COVID19:*DEFAULT-RESULT-LIMIT*‘ number of items. You can either use
the ‘:limit‘ keyword parameter of the fetch function you use, or
rebind the above parameter to a value you want.

Another common parameter used by the various fetch functions is
‘:offset‘, which allows you to skip a given number of items and is
useful for retrieving items in pages, when used in combination with
the ‘:limit‘ keyword parameter.

The ‘:order‘ keyword parameter, used in some fetching functions
controls the order in which items will be returned based on the
‘timestamp‘ column. By default the results will be in descending order
(most recent ones). If you need to return items in ascending order
(oldest to newest ones), you can use the ‘:asc‘ value for the ‘:order‘
keyword parameter.

Here’s how to fetch ten countries using the ‘COVID19:FETCH-COUNTRIES‘
function. You can control the number of results to fetch by using the
‘:limit‘ keyword parameter.

“‘ common-lisp
CL-USER> (covid19:fetch-countries *db-conn* :limit 10)
((:|id| 1 :|iso_code| "JE" :|name| "Jersey" :|slug| "jersey")
(:|id| 2 :|iso_code| "MM" :|name| "Myanmar" :|slug| "myanmar")
(:|id| 3 :|iso_code| "NA" :|name| "Namibia" :|slug| "namibia")
(:|id| 4 :|iso_code| "SO" :|name| "Somalia" :|slug| "somalia")
(:|id| 5 :|iso_code| "AU" :|name| "Australia" :|slug| "australia")
(:|id| 6 :|iso_code| "GD" :|name| "Grenada" :|slug| "grenada")
(:|id| 7 :|iso_code| "JP" :|name| "Japan" :|slug| "japan")
(:|id| 8 :|iso_code| "QA" :|name| "Qatar" :|slug| "qatar")
(:|id| 9 :|iso_code| "UM" :|name| "US Minor Outlying Islands" :|slug|
"us-minor-outlying-islands")
(:|id| 10 :|iso_code| "AG" :|name| "Antigua and Barbuda" :|slug|
"antigua-and-barbuda"))
“‘

You can also use the ‘COVID19:DISPLAY-TABLE‘ function to display a
table of the fetched results from your REPL.

“‘ common-lisp
CL-USER> (covid19:display-table
(covid19:fetch-countries *db-conn* :limit 10))
+—-+———-+—————————+—————————+
| id | iso_code | name | slug |
+—-+———-+—————————+—————————+
| 1 | JE | Jersey | jersey |
| 2 | MM | Myanmar | myanmar |
| 3 | NA | Namibia | namibia |
| 4 | SO | Somalia | somalia |
| 5 | AU | Australia | australia |
| 6 | GD | Grenada | grenada |
| 7 | JP | Japan | japan |
| 8 | QA | Qatar | qatar |
| 9 | UM | US Minor Outlying Islands | us-minor-outlying-islands |
| 10 | AG | Antigua and Barbuda | antigua-and-barbuda |
+—-+———-+—————————+—————————+
NIL
“‘

In order to get a specific country by either name or ISO code you can use the
‘COVID19:FETCH-COUNTRY‘ function, e.g.

“‘ common-lisp
CL-USER> (covid19:fetch-country *db-conn* "BG")
((:|id| 44 :|iso_code| "BG" :|name| "Bulgaria" :|slug| "bulgaria"))
“‘

Time series data can be fetched using the ‘COVID19:FETCH-TIME-SERIES‘
function. The results will contain historical records for each
country, ordered by timestamp in descending order.

“‘ common-lisp
CL-USER> (covid19:display-table
(covid19:fetch-time-series *db-conn* :limit 10)) +———————-+———–+——–+———–+——–+—————+————+—————+————+————+———————+———————+——————+ | timestamp | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name | country_slug | country_iso_code | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+———————+———————+——————+ | 2020-06-16T00:00:00Z | 262 | 6 | 179 | 77 | 0 | 0 | 4 | -4 | 2 | Myanmar | myanmar | MM | | 2020-06-16T00:00:00Z | 34 | 0 | 18 | 16 | 2 | 0 | 1 | 1 | 3 | Namibia | namibia | NA | | 2020-06-16T00:00:00Z | 2658 | 88 | 649 | 1921 | 16 | 0 | 27 | -11 | 4 | Somalia | somalia | SO | | 2020-06-16T00:00:00Z | 7370 | 102 | 6861 | 407 | 23 | 0 | 5 | 18 | 5 | Australia | australia | AU | | 2020-06-16T00:00:00Z | 23 | 0 | 22 | 1 | 0 | 0 | 0 | 0 | 6 | Grenada | grenada | GD | | 2020-06-16T00:00:00Z | 17484 | 934 | 15652 | 898 | 45 | 5 | 85 | -45 | 7 | Japan | japan | JP | | 2020-06-16T00:00:00Z | 82077 | 80 | 60461 | 21536 | 1201 | 4 | 1780 | -583 | 8 | Qatar | qatar | QA | | 2020-06-16T00:00:00Z | 26 | 3 | 22 | 1 | 0 | 0 | 2 | -2 | 10 | Antigua and Barbuda | antigua-and-barbuda | AG | | 2020-06-16T00:00:00Z | 532 | 9 | 236 | 287 | 49 | 0 | 4 | 45 | 11 | Benin | benin | BJ | | 2020-06-16T00:00:00Z | 8931 | 212 | 7937 | 782 | 46 | 0 | 109 | -63 | 12 | Morocco | morocco | MA | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+———————+———————+——————+ NIL
“‘

If you want to get the time-series data for a given country you can
use ‘COVID19:FETCH-TIME-SERIES-FOR-COUNTRY‘. The following command will
return the data for the past 10 days.

“‘ common-lisp
CL-USER> (covid19:display-table
(covid19:fetch-time-series-for-country *db-conn* "Bulgaria" :limit 10)) +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
| timestamp | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name | country_slug | country_iso_code | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
| 2020-06-16T00:00:00Z | 3453 | 181 | 1817 | 1455 | 112 | 5 | 33 | 74 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-15T00:00:00Z | 3341 | 176 | 1784 | 1381 | 51 | 2 | 54 | -5 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-14T00:00:00Z | 3290 | 174 | 1730 | 1386 | 24 | 2 | 7 | 15 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-13T00:00:00Z | 3266 | 172 | 1723 | 1371 | 75 | 0 | 7 | 68 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-12T00:00:00Z | 3191 | 172 | 1716 | 1303 | 105 | 4 | 28 | 73 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-11T00:00:00Z | 3086 | 168 | 1688 | 1230 | 93 | 1 | 24 | 68 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-10T00:00:00Z | 2993 | 167 | 1664 | 1162 | 104 | 0 | 41 | 63 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-09T00:00:00Z | 2889 | 167 | 1623 | 1099 | 79 | 3 | 36 | 40 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-08T00:00:00Z | 2810 | 164 | 1587 | 1059 | 83 | 4 | 39 | 40 | 44 | Bulgaria | bulgaria | BG |
| 2020-06-07T00:00:00Z | 2727 | 160 | 1548 | 1019 | 16 | 0 | 3 | 13 | 44 | Bulgaria | bulgaria | BG | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
NIL
“‘

Latest (most recent) time-series data per country can be fetched using
the ‘COVID19:FETCH-TIME-SERIES-LATEST‘ function, e.g.

“‘ common-lisp
CL-USER> (covid19:display-table
(covid19:fetch-time-series-latest *db-conn* :limit 5)) +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
| timestamp | confirmed | deaths | recovered | active | new_confirmed | new_deaths | new_recovered | new_active | country_id | country_name | country_slug | country_iso_code | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
| 2020-06-16T00:00:00Z | 262 | 6 | 179 | 77 | 0 | 0 | 4 | -4 | 2 | Myanmar | myanmar | MM |
| 2020-06-16T00:00:00Z | 34 | 0 | 18 | 16 | 2 | 0 | 1 | 1 | 3 | Namibia | namibia | NA |
| 2020-06-16T00:00:00Z | 2658 | 88 | 649 | 1921 | 16 | 0 | 27 | -11 | 4 | Somalia | somalia | SO |
| 2020-06-16T00:00:00Z | 7370 | 102 | 6861 | 407 | 23 | 0 | 5 | 18 | 5 | Australia | australia | AU |
| 2020-06-16T00:00:00Z | 23 | 0 | 22 | 1 | 0 | 0 | 0 | 0 | 6 | Grenada | grenada | GD | +———————-+———–+——–+———–+——–+—————+————+—————+————+————+————–+————–+——————+
NIL
“‘

In order to fetch the top countries by given column you can use the
‘COVID19:FETCH-TOP-COUNTRIES-BY‘ function. The following example will
display the top 5 countries by ‘confirmed‘ cases.

“‘ common-lisp
CL-USER> (mapcar (lambda (item)
(getf item :|country_name|))
(covid19:fetch-top-countries-by *db-conn* :column :confirmed :limit 5))
("United States of America" "Brazil" "Russian Federation" "India"
"United Kingdom")
“‘

The ‘COVID19:FETCH-TIME-SERIES-GLOBAL‘ function returns the aggregated
time series on a global scale. The following example will display the
stats for the past 10 days.

“‘ common-lisp
CL-USER> (covid19:display-table
(covid19:fetch-time-series-global *db-conn* :limit 10))
+———————-+———–+——–+———–+———+—————+—————+————+————+
| timestamp | confirmed | deaths | recovered | active | new_confirmed | new_recovered | new_deaths | new_active | +———————-+———–+——–+———–+———+—————+—————+————+————+
| 2020-06-16T00:00:00Z | 8274306 | 451939 | 3954518 | 3867849 | 139803 | 97831 | 6829 | 35143 |
| 2020-06-15T00:00:00Z | 8134503 | 445110 | 3856687 | 3832706 | 133896 | 87626 | 3843 | 42427 |
| 2020-06-14T00:00:00Z | 8000607 | 441267 | 3769061 | 3790279 | 134333 | 71408 | 3365 | 59560 |
| 2020-06-13T00:00:00Z | 7866274 | 437902 | 3697653 | 3730719 | 134598 | 85027 | 4400 | 45171 |
| 2020-06-12T00:00:00Z | 7731676 | 433502 | 3612626 | 3685548 | 118757 | 72581 | 3990 | 42186 |
| 2020-06-11T00:00:00Z | 7612919 | 429512 | 3540045 | 3643362 | 154681 | 85889 | 5290 | 63502 |
| 2020-06-10T00:00:00Z | 7458238 | 424222 | 3454156 | 3579860 | 118483 | 79139 | 4833 | 34511 |
| 2020-06-09T00:00:00Z | 7339755 | 419389 | 3375017 | 3545349 | 124338 | 82260 | 4974 | 37104 |
| 2020-06-08T00:00:00Z | 7215417 | 414415 | 3292757 | 3508245 | 109895 | 152488 | 3825 | -46418 |
| 2020-06-07T00:00:00Z | 7105522 | 410590 | 3140269 | 3554663 | 118555 | 55087 | 3039 | 60429 | +———————-+———–+——–+———–+———+—————+—————+————+————+
NIL
“‘

### Executing database queries

If you need to execute a custom query or statement against the
database you can use the ‘COVID19:DB-EXECUTE‘ function.

The following example will fetch a country by given ISO code,
using a parameterized query.

“‘ common-lisp
CL-USER> (covid19:db-execute *db-conn* "SELECT * FROM country WHERE iso_code = ?" "BG")
((:|id| 44 :|iso_code| "BG" :|name| "Bulgaria" :|slug| "bulgaria"))
“‘

You can pass the result of ‘COVID19:DB-EXECUTE‘ to ‘COVID19:DISPLAY-TABLE‘ to
display the results in a nice table format.

### Exporting data to CSV

If you need to export the data in CSV format you can do that by using
the ‘COVID19:WRITE-CSV‘ function. This example will export all
time series data for a given country.

“‘ common-lisp
CL-USER> (with-open-file (out "/tmp/covid19-bg.csv" :direction :output)
(covid19:write-csv (covid19:fetch-time-series-for-country *db-conn* "BG") :stream out))
“‘

### Plotting graphs

The following examples assume that you have
[gnuplot](http://gnuplot.sourceforge.net) installed already.

In order to plot a graph using the time series data for a given
country you can use the ‘COVID19:PLOT-TIME-SERIES-FOR-COUNTRY‘
function. The ‘:limit‘ keyword parameter controls how many rows of
data will be fetched from the database.

This example shows how to plot the data for past 90 days for a given
country.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-for-country *db-conn*
"Bulgaria"
:limit 90)
NIL
“‘

This is how the plot looks like at the time of writing this document.

![COVID-19 Cases in BG with filledcurves](./images/covid19-bg-filledcurves.png)

If you want to use lines, instead of filled curves, which is what
above plot generated you can specify an alternative template to be
used when plotting the graph, e.g.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-for-country *db-conn*
"Bulgaria"
:limit 90
:template covid19:*gnuplot-time-series-with-lines-template*)
NIL
“‘

The generated graph looks like this.

![COVID-19 Cases in BG with lines](./images/covid19-bg-lines.png)

Another plot function that can be used is ‘COVID19:PLOT-TIME-SERIES-GLOBAL‘.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-global *db-conn* :limit 90)
NIL
“‘

The generated graph on a global scale looks like this.

![COVID-19 Cases Global with filledcurves](./images/covid19-global-filledcurves.png)

The ‘COVID19:PLOT-TOP-COUNTRIES-BY‘ function can be used to plot countries
by sorting them first on a given column. Here’s an example to plot a histogram
per each country based on the latest data from the ‘confirmed‘ column.

“‘ common-lisp
CL-USER> (covid19:plot-top-countries-by *db-conn* :column :confirmed :limit 10)
NIL
“‘

An example generated graph looks like this.

![COVID-19 Top Countries By column](./images/covid19-top-by-confirmed.png)

Another set of useful templates which show the new cases per country
or on global scale are
‘COVID19:*GNUPLOT-TIME-SERIES-WITH-FILLED-CURVES-NEW-CASES*‘ and
‘COVID19:*GNUPLOT-TIME-SERIES-WITH-LINES-NEW-CASES*‘.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-for-country *db-conn*
"Italy"
:limit 100
:template covid19:*gnuplot-time-series-with-filled-curves-new-cases-template*)
NIL
“‘

The graph generated looks like this, which plots the new cases on
daily basis.

![COVID-19 Cases in IT with lines](./images/covid19-it-new-cases.png)

The ‘COVID19:PLOT-TIME-SERIES-GLOBAL-ANIMATION‘ function creates an
animation of the cases using the global time series data. When
creating an animation you need to specify the destination, where the
animation will be stored at. The ‘:limit‘ keyword parameter in the
example below specifies the number of time series records in ascending
order.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-global-animation *db-conn*
#P"/tmp/covid19-global.gif"
:limit 200)
NIL
“‘

The generated animation looks like this.

![COVID-19 Global Cases Animation](./images/covid19-global.gif)

Another function, which creates animations from time-series data is the
‘COVID19:PLOT-TIME-SERIES-FOR-COUNTRY-ANIMATION‘.

“‘ common-lisp
CL-USER> (covid19:plot-time-series-for-country-animation *db-conn*
"Italy"
#P"/tmp/covid19-it.gif"
:limit 200)
NIL
“‘

The generated animation for a given country looks like this.

![COVID-19 IT Cases Animation](./images/covid19-it.gif)

The ‘:delay‘, ‘:height‘, ‘:width‘ and ‘:line-width‘ keyword parameters
can be used to further customize the resulting animation.

You could also render any of the existing ‘gnuplot(1)‘ templates
defined in the ‘COVID19.GNUPLOT-TEMPLATE‘ package and customize them
further, if needed.

In order to do that you need to pass at least two arguments to the
template while rendering it - one for the title of the graph, and
another one which points to the path containing data points.

The following example shows how to export the data points for a given country to a
file, and then renders a template using that file.

“‘ common-lisp
CL-USER> (let ((csv-file #P"/tmp/covid19-bg.csv")
(data-points (covid19:fetch-time-series-for-country *db-conn* "Bulgaria" :limit 90)))
(with-open-file (out csv-file :direction :output)
(covid19:write-csv data-points :stream out))
(covid19:render-gnuplot-template covid19:*gnuplot-time-series-with-filled-curves-template*
:title "Bulgaria"
:datafile (namestring csv-file)))
"#
# gnuplot(1) template for plotting time series with filledcurves
#

set title ’Covid19 Cases - Bulgaria’
set grid
set xdata time
set timefmt ’%Y-%m-%dT%H:%M:%S+00:00Z’
set format x ’%Y-%m-%d’
set xtics rotate by 45 right
set xlabel ’Time’
set ylabel ’Cases’
set key outside right center
set datafile separator ’,’
set autoscale fix
set style fill transparent solid 0.3
plot ’/tmp/covid19-bg.csv’ using 1:2:(0) title ’Confirmed’ with filledcurves, \\
” using 1:3:(0) title ’Deaths’ with filledcurves, \\
” using 1:4:(0) title ’Recovered’ with filledcurves, \\
” using 1:5:(0) title ’Active’ with filledcurves
"
“‘

### Debug logging

The ‘cl-covid19‘ system uses ‘log4cl‘ for logging purposes.

If you need to adjust the logging level (e.g. set it to ‘debug‘ level), simply
evaluate the following expression.

“‘ common-lisp
CL-USER> (log:config :debug)
“‘

## API Client Usage

This section provides some examples on how to use the API client for
interfacing with the [COVID-19 API](https://covid19api.com).

The ‘COVID19.API‘ package exports functionality for creating an API
client and fetching data from the remote API endpoint, most of these
symbols are re-exported by the ‘COVID19‘ package.

First, create an API client.

“‘ common-lisp
CL-USER> (defparameter *api-client*
(covid19:make-api-client))
*API-CLIENT*
“‘

If you experience timeout issues, you can also change the timeout
settings of the HTTP client, e.g.

“‘ common-lisp
(setf dexador:*default-connect-timeout* 300)
(setf dexador:*default-read-timeout* 300)
“‘

You can get the list of countries by using the ‘COVID19:GET-COUNTRIES-DATA‘ function, e.g.

“‘ common-lisp
CL-USER> (covid19.api:get-countries-data *api-client*)
“‘

A summarized statistics for COVID-19 can be retrieved by using the ‘COVID19:GET-SUMMARY-DATA‘
function, e.g.

“‘ common-lisp
CL-USER> (covid19.api:get-summary-data *api-client*)
“‘

The COVID-19 API provides an endpoint for exporting all data as a ZIP
archive. You can get a ZIP archive of all time series data by using
the ‘COVID19:GET-TIME-SERIES-ARCHIVE‘ function, e.g.

“‘ common-lisp
CL-USER> (covid19:get-time-series-archive *api-client* #P"/tmp/all-data.zip")
“‘

You can also display the list of available API endpoints by using the
‘COVID19:DISPLAY-API-ROUTES‘ function, e.g.

“‘ common-lisp
CL-USER> (covid19:display-api-routes *api-client*)
“‘

An example output looks like this.

“‘ text
.————————————————————————————————————————————————————————-.
| API Routes @ v0.0.8 | +————————————————–+———————————————————————————————————————-+
| PATH | NAME | +————————————————–+———————————————————————————————————————-+
| /webhook | Add a webhook to be notified when new data becomes available |
| /summary | Summary of new and total cases per country |
| /live/country/:country/status/:status | Get a time series Of Cases Per Country Per Province By Case Type |
| /live/country/:country/status/:status/date/:date | Get a Time Series Of Cases Per Country Per Province By Case Type After A Date |
| /live/country/:country | Get Live List Of Cases Per Country Per Province By Case Type |
| /export | Get All Data as a zip file |
| /total/country/:country | Get List Of Cases Per Country By Case Type |
| /total/country/:country/status/:status | Get List Of Cases Per Country By Case Type |
| /country/:country/status/:status | Get List Of Cases Per Country Per Province By Case Type |
| /country/:country/status/:status/live | Daily list of cases per Country per Province by Case Type, updated with latest live count |
| /total/dayone/country/:country/status/:status | Get List Of Cases Per Country By Case Type From The First Recorded Case |
| /dayone/country/:country/status/:status | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case |
| /dayone/country/:country/status/:status/live | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case, updated with latest live count |
| /country/:country | Get List Of Cases Per Country Per Province By Case Type |
| /total/dayone/country/:country | Get List Of Cases Per Country By Case Type From The First Recorded Case |
| /dayone/country/:country | Get List Of Cases Per Country Per Province By Case Type From The First Recorded Case |
| /countries | Get List Of Countries |
| /all | Get All Data | +————————————————–+———————————————————————————————————————-+
“‘

## Various ~/.sqliterc config settings

When using the command-line interface of SQLite, you might find these
config settings useful, which you can just drop in your ‘~/.sqliterc‘
file.

“‘ text
.headers on
.mode column
.timer on
“‘

## Contributing

‘cl-covid19‘ is hosted on
[Github](https://github.com/dnaeon/cl-covid19). Please contribute by
reporting issues, suggesting features or by sending patches using pull
requests.

## Authors

* [Marin Atanasov Nikolov](mailto:dnaeon@gmail.com)

## License

This project is Open Source and licensed under the [BSD
License](http://opensource.org/licenses/BSD-2-Clause).

Version

0.1.0

Dependencies
Source

cl-covid19.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 cl-covid19/migrations

Parent

cl-covid19 (system)

Location

migrations/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.2 cl-covid19/gnuplot-templates

Parent

cl-covid19 (system)

Location

templates/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.3 cl-covid19/core

Dependencies
Parent

cl-covid19 (system)

Location

src/

Components

Previous: , Up: Modules   [Contents][Index]

3.4 cl-covid19/client-package

Dependency

core (module)

Parent

cl-covid19 (system)

Location

src/

Component

package.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 cl-covid19.asd

Location

cl-covid19.asd

Systems

cl-covid19 (system)

Packages

cl-covid19-system


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 cl-covid19/core/util.lisp

Parent

core (module)

Location

src/util.lisp

Packages

cl-covid19.util

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 cl-covid19/core/api.lisp

Dependency

util.lisp (file)

Parent

core (module)

Location

src/api.lisp

Packages

cl-covid19.api

Exported Definitions
Internal Definitions

*endpoint* (special variable)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 cl-covid19/core/db.lisp

Dependency

api.lisp (file)

Parent

core (module)

Location

src/db.lisp

Packages

cl-covid19.db

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 cl-covid19/core/gnuplot-template.lisp

Dependency

db.lisp (file)

Parent

core (module)

Location

src/gnuplot-template.lisp

Packages

cl-covid19.gnuplot-template

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 cl-covid19/core/core.lisp

Dependency

gnuplot-template.lisp (file)

Parent

core (module)

Location

src/core.lisp

Packages

cl-covid19.core

Exported Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.7 cl-covid19/client-package/package.lisp

Parent

client-package (module)

Location

src/package.lisp

Packages

cl-covid19


Previous: , Up: Files   [Contents][Index]

4.2 Static


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.1 cl-covid19/migrations/20200608135822-create_countries_table.down.sql

Parent

migrations (module)

Location

migrations/20200608135822-create_countries_table.down.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.2 cl-covid19/migrations/20200608135822-create_countries_table.up.sql

Parent

migrations (module)

Location

migrations/20200608135822-create_countries_table.up.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.3 cl-covid19/migrations/20200611230626-add_time_series_table.down.sql

Parent

migrations (module)

Location

migrations/20200611230626-add_time_series_table.down.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.4 cl-covid19/migrations/20200611230626-add_time_series_table.up.sql

Parent

migrations (module)

Location

migrations/20200611230626-add_time_series_table.up.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.5 cl-covid19/migrations/20200611234716-add_time_series_views.down.sql

Parent

migrations (module)

Location

migrations/20200611234716-add_time_series_views.down.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.6 cl-covid19/migrations/20200611234716-add_time_series_views.up.sql

Parent

migrations (module)

Location

migrations/20200611234716-add_time_series_views.up.sql


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.7 cl-covid19/gnuplot-templates/histograms-per-country.plt

Parent

gnuplot-templates (module)

Location

templates/histograms-per-country.plt


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.8 cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases.plt

Parent

gnuplot-templates (module)

Location

templates/time-series-with-filled-curves-new-cases.plt


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.9 cl-covid19/gnuplot-templates/time-series-with-filled-curves.plt

Parent

gnuplot-templates (module)

Location

templates/time-series-with-filled-curves.plt


Next: , Previous: , Up: Static files   [Contents][Index]

4.2.10 cl-covid19/gnuplot-templates/time-series-with-lines-new-cases.plt

Parent

gnuplot-templates (module)

Location

templates/time-series-with-lines-new-cases.plt


Previous: , Up: Static files   [Contents][Index]

4.2.11 cl-covid19/gnuplot-templates/time-series-with-lines.plt

Parent

gnuplot-templates (module)

Location

templates/time-series-with-lines.plt


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 cl-covid19-system

Source

cl-covid19.asd

Use List

Next: , Previous: , Up: Packages   [Contents][Index]

5.2 cl-covid19.util

Source

util.lisp (file)

Nickname

covid19.util

Use List

common-lisp

Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.3 cl-covid19.api

Source

api.lisp (file)

Nickname

covid19.api

Use List

common-lisp

Exported Definitions
Internal Definitions

*endpoint* (special variable)


Next: , Previous: , Up: Packages   [Contents][Index]

5.4 cl-covid19.db

Source

db.lisp (file)

Nickname

covid19.db

Use List

common-lisp

Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.5 cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Nickname

covid19.gnuplot-template

Use List

common-lisp

Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.6 cl-covid19.core

Source

core.lisp (file)

Nickname

covid19.core

Use List

common-lisp

Exported Definitions

Previous: , Up: Packages   [Contents][Index]

5.7 cl-covid19

Source

package.lisp (file)

Nickname

covid19

Use List

common-lisp


Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *default-result-limit*

The default number of items to return when fetching data from the database

Package

cl-covid19.core

Source

core.lisp (file)

Special Variable: *gnuplot-histograms-per-country-template*

gnuplot(1) template for plotting histograms per country

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *gnuplot-time-series-animation-template*

gnuplot(1) template for plotting an animation of time-series data with lines

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *gnuplot-time-series-with-filled-curves-new-cases-template*

gnuplot(1) template for plotting time-series data of new cases with filled curves

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *gnuplot-time-series-with-filled-curves-template*

gnuplot(1) template for plotting time-series data with filled curves

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *gnuplot-time-series-with-lines-new-cases-template*

gnuplot(1) template for plotting time-series data of new cases with lines

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *gnuplot-time-series-with-lines-template*

gnuplot(1) template for plotting time-series data with lines

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Special Variable: *migrations-path*

Path to the SQL migrations

Package

cl-covid19.db

Source

db.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Functions

Function: api-version CLIENT &rest REST

Retrieves the remote API version

Package

cl-covid19.api

Source

api.lisp (file)

Function: db-execute DB-CONN STMT &rest PARAMS

Execute a given statement against the database

Package

cl-covid19.db

Source

db.lisp (file)

Function: disconnect-db-conn DB-CONN

Disconnects from the database

Package

cl-covid19.db

Source

db.lisp (file)

Function: display-api-routes CLIENT &optional OUT

Display the API routes in a table

Package

cl-covid19.api

Source

api.lisp (file)

Function: display-table ITEMS

Displays a table view of the items. Useful when used in combination with COVID19:DB-EXECUTE results

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-countries DB-CONN &key LIMIT OFFSET

Fetch countries from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-country DB-CONN NAME

Fetch a country by name from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-time-series DB-CONN &key LIMIT OFFSET ORDER

Fetches time series data from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-time-series-for-country DB-CONN NAME &key LIMIT OFFSET ORDER

Fetch time series data for a given country from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-time-series-global DB-CONN &key LIMIT OFFSET ORDER

Fetch global time series data from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-time-series-latest DB-CONN &key LIMIT OFFSET

Fetch latest time series data from the database

Package

cl-covid19.core

Source

core.lisp (file)

Function: fetch-top-countries-by DB-CONN &key COLUMN LIMIT OFFSET

Fetch top latest countries from the database, sorted by the given column

Package

cl-covid19.core

Source

core.lisp (file)

Function: get-api-routes CLIENT &rest REST

Fetch the available API routes

Package

cl-covid19.api

Source

api.lisp (file)

Function: get-countries-data CLIENT &rest REST

Retrieve the list of countries

Package

cl-covid19.api

Source

api.lisp (file)

Function: get-summary-data CLIENT &rest REST

Retrieve summary stats

Package

cl-covid19.api

Source

api.lisp (file)

Function: get-time-series-archive CLIENT DESTINATION &rest REST

Download all time series data as a ZIP archive

Package

cl-covid19.api

Source

api.lisp (file)

Function: get-time-series-for-country CLIENT COUNTRY &rest REST

Retrieve the time series data for a given country

Package

cl-covid19.api

Source

api.lisp (file)

Function: make-api-client &rest REST

Creates a new API client

Package

cl-covid19.api

Source

api.lisp (file)

Function: make-api-uri CLIENT &key PATH QUERY

Create new API URI for the given path and query params

Package

cl-covid19.api

Source

api.lisp (file)

Function: make-db-conn DB-PATH

Creates a new database connection to the given DB-PATH

Package

cl-covid19.db

Source

db.lisp (file)

Function: migrate-db DB-CONN

Migrates the database to the latest version

Package

cl-covid19.db

Source

db.lisp (file)

Function: persist-countries-data ITEMS DB-CONN

Persists the given ITEMS representing countries with the database

Package

cl-covid19.db

Source

db.lisp (file)

Function: persist-time-series-data ITEMS DB-CONN

Persists the given ITEMS representing time series data

Package

cl-covid19.db

Source

db.lisp (file)

Function: plist-keys PLIST

Returns the keys of a property list

Package

cl-covid19.util

Source

util.lisp (file)

Function: plist-values PLIST

Returns the values of a property list

Package

cl-covid19.util

Source

util.lisp (file)

Function: plot-data DATA-FUN TEMPLATE &rest REST

Plot the data returned by DATA-FUN using the given TEMPLATE

Package

cl-covid19.core

Source

core.lisp (file)

Function: plot-time-series-for-country DB-CONN COUNTRY &key TEMPLATE LIMIT

Plot time series data for a given country

Package

cl-covid19.core

Source

core.lisp (file)

Function: plot-time-series-for-country-animation DB-CONN COUNTRY DESTINATION &key LIMIT DELAY HEIGHT WIDTH LINE-WIDTH

Plot global time series for a given country as an animation

Package

cl-covid19.core

Source

core.lisp (file)

Function: plot-time-series-global DB-CONN &key TEMPLATE LIMIT

Plot global time series

Package

cl-covid19.core

Source

core.lisp (file)

Function: plot-time-series-global-animation DB-CONN DESTINATION &key LIMIT DELAY HEIGHT WIDTH LINE-WIDTH

Plot global time series data as an animation

Package

cl-covid19.core

Source

core.lisp (file)

Function: plot-top-countries-by DB-CONN &key COLUMN LIMIT TEMPLATE

Plot time series per country sorted by given column

Package

cl-covid19.core

Source

core.lisp (file)

Function: render-gnuplot-template TEMPLATE &rest REST

Renders the given gnuplot(1) template

Package

cl-covid19.gnuplot-template

Source

gnuplot-template.lisp (file)

Function: table-columns DB-CONN TABLE

Get the list of columns for a given table

Package

cl-covid19.db

Source

db.lisp (file)

Function: table-info DB-CONN TABLE

Get details about a given table

Package

cl-covid19.db

Source

db.lisp (file)

Function: update-all-data API-CLIENT DB-CONN

Updates the local database with the data retrieved from the remote API

Package

cl-covid19.core

Source

core.lisp (file)

Function: update-countries-data API-CLIENT DB-CONN

Updates the local database with the latest countries data from the remote API

Package

cl-covid19.core

Source

core.lisp (file)

Function: update-time-series-data API-CLIENT DB-CONN

Updates the local database with the latest time series data from the remote API

Package

cl-covid19.core

Source

core.lisp (file)

Function: write-csv ITEMS &key STREAM INCLUDE-HEADERS

Writes the given items in CSV format

Package

cl-covid19.core

Source

core.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Generic functions

Generic Function: api-client-endpoint OBJECT
Generic Function: (setf api-client-endpoint) NEW-VALUE OBJECT
Package

cl-covid19.api

Methods
Method: api-client-endpoint (API-CLIENT api-client)
Method: (setf api-client-endpoint) NEW-VALUE (API-CLIENT api-client)

API endpoint to interface with

Source

api.lisp (file)

Generic Function: api-client-port OBJECT
Generic Function: (setf api-client-port) NEW-VALUE OBJECT
Package

cl-covid19.api

Methods
Method: api-client-port (API-CLIENT api-client)
Method: (setf api-client-port) NEW-VALUE (API-CLIENT api-client)

Service port to connect to

Source

api.lisp (file)

Generic Function: api-client-scheme OBJECT
Generic Function: (setf api-client-scheme) NEW-VALUE OBJECT
Package

cl-covid19.api

Methods
Method: api-client-scheme (API-CLIENT api-client)
Method: (setf api-client-scheme) NEW-VALUE (API-CLIENT api-client)

URI scheme to use

Source

api.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Classes

Class: api-client ()

Client for interfacing with COVID-19 API

Package

cl-covid19.api

Source

api.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: scheme

URI scheme to use

Initargs

:scheme

Initform

"https"

Readers

api-client-scheme (generic function)

Writers

(setf api-client-scheme) (generic function)

Slot: port

Service port to connect to

Initargs

:port

Initform

443

Readers

api-client-port (generic function)

Writers

(setf api-client-port) (generic function)

Slot: endpoint

API endpoint to interface with

Initargs

:endpoint

Initform

cl-covid19.api::*endpoint*

Readers

api-client-endpoint (generic function)

Writers

(setf api-client-endpoint) (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: *endpoint*

The API from which to fetch data about COVID-19

Package

cl-covid19.api

Source

api.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M   S  
Index Entry  Section

C
cl-covid19.asd: The cl-covid19․asd file
cl-covid19/client-package: The cl-covid19/client-package module
cl-covid19/client-package/package.lisp: The cl-covid19/client-package/package․lisp file
cl-covid19/core: The cl-covid19/core module
cl-covid19/core/api.lisp: The cl-covid19/core/api․lisp file
cl-covid19/core/core.lisp: The cl-covid19/core/core․lisp file
cl-covid19/core/db.lisp: The cl-covid19/core/db․lisp file
cl-covid19/core/gnuplot-template.lisp: The cl-covid19/core/gnuplot-template․lisp file
cl-covid19/core/util.lisp: The cl-covid19/core/util․lisp file
cl-covid19/gnuplot-templates: The cl-covid19/gnuplot-templates module
cl-covid19/gnuplot-templates/histograms-per-country.plt: The cl-covid19/gnuplot-templates/histograms-per-country․plt file
cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases․plt file
cl-covid19/gnuplot-templates/time-series-with-filled-curves.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves․plt file
cl-covid19/gnuplot-templates/time-series-with-lines-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-lines-new-cases․plt file
cl-covid19/gnuplot-templates/time-series-with-lines.plt: The cl-covid19/gnuplot-templates/time-series-with-lines․plt file
cl-covid19/migrations: The cl-covid19/migrations module
cl-covid19/migrations/20200608135822-create_countries_table.down.sql: The cl-covid19/migrations/20200608135822-create_countries_table․down․sql file
cl-covid19/migrations/20200608135822-create_countries_table.up.sql: The cl-covid19/migrations/20200608135822-create_countries_table․up․sql file
cl-covid19/migrations/20200611230626-add_time_series_table.down.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․down․sql file
cl-covid19/migrations/20200611230626-add_time_series_table.up.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․up․sql file
cl-covid19/migrations/20200611234716-add_time_series_views.down.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․down․sql file
cl-covid19/migrations/20200611234716-add_time_series_views.up.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․up․sql file

F
File, Lisp, cl-covid19.asd: The cl-covid19․asd file
File, Lisp, cl-covid19/client-package/package.lisp: The cl-covid19/client-package/package․lisp file
File, Lisp, cl-covid19/core/api.lisp: The cl-covid19/core/api․lisp file
File, Lisp, cl-covid19/core/core.lisp: The cl-covid19/core/core․lisp file
File, Lisp, cl-covid19/core/db.lisp: The cl-covid19/core/db․lisp file
File, Lisp, cl-covid19/core/gnuplot-template.lisp: The cl-covid19/core/gnuplot-template․lisp file
File, Lisp, cl-covid19/core/util.lisp: The cl-covid19/core/util․lisp file
File, static, cl-covid19/gnuplot-templates/histograms-per-country.plt: The cl-covid19/gnuplot-templates/histograms-per-country․plt file
File, static, cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases․plt file
File, static, cl-covid19/gnuplot-templates/time-series-with-filled-curves.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves․plt file
File, static, cl-covid19/gnuplot-templates/time-series-with-lines-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-lines-new-cases․plt file
File, static, cl-covid19/gnuplot-templates/time-series-with-lines.plt: The cl-covid19/gnuplot-templates/time-series-with-lines․plt file
File, static, cl-covid19/migrations/20200608135822-create_countries_table.down.sql: The cl-covid19/migrations/20200608135822-create_countries_table․down․sql file
File, static, cl-covid19/migrations/20200608135822-create_countries_table.up.sql: The cl-covid19/migrations/20200608135822-create_countries_table․up․sql file
File, static, cl-covid19/migrations/20200611230626-add_time_series_table.down.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․down․sql file
File, static, cl-covid19/migrations/20200611230626-add_time_series_table.up.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․up․sql file
File, static, cl-covid19/migrations/20200611234716-add_time_series_views.down.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․down․sql file
File, static, cl-covid19/migrations/20200611234716-add_time_series_views.up.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․up․sql file

L
Lisp File, cl-covid19.asd: The cl-covid19․asd file
Lisp File, cl-covid19/client-package/package.lisp: The cl-covid19/client-package/package․lisp file
Lisp File, cl-covid19/core/api.lisp: The cl-covid19/core/api․lisp file
Lisp File, cl-covid19/core/core.lisp: The cl-covid19/core/core․lisp file
Lisp File, cl-covid19/core/db.lisp: The cl-covid19/core/db․lisp file
Lisp File, cl-covid19/core/gnuplot-template.lisp: The cl-covid19/core/gnuplot-template․lisp file
Lisp File, cl-covid19/core/util.lisp: The cl-covid19/core/util․lisp file

M
Module, cl-covid19/client-package: The cl-covid19/client-package module
Module, cl-covid19/core: The cl-covid19/core module
Module, cl-covid19/gnuplot-templates: The cl-covid19/gnuplot-templates module
Module, cl-covid19/migrations: The cl-covid19/migrations module

S
Static File, cl-covid19/gnuplot-templates/histograms-per-country.plt: The cl-covid19/gnuplot-templates/histograms-per-country․plt file
Static File, cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves-new-cases․plt file
Static File, cl-covid19/gnuplot-templates/time-series-with-filled-curves.plt: The cl-covid19/gnuplot-templates/time-series-with-filled-curves․plt file
Static File, cl-covid19/gnuplot-templates/time-series-with-lines-new-cases.plt: The cl-covid19/gnuplot-templates/time-series-with-lines-new-cases․plt file
Static File, cl-covid19/gnuplot-templates/time-series-with-lines.plt: The cl-covid19/gnuplot-templates/time-series-with-lines․plt file
Static File, cl-covid19/migrations/20200608135822-create_countries_table.down.sql: The cl-covid19/migrations/20200608135822-create_countries_table․down․sql file
Static File, cl-covid19/migrations/20200608135822-create_countries_table.up.sql: The cl-covid19/migrations/20200608135822-create_countries_table․up․sql file
Static File, cl-covid19/migrations/20200611230626-add_time_series_table.down.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․down․sql file
Static File, cl-covid19/migrations/20200611230626-add_time_series_table.up.sql: The cl-covid19/migrations/20200611230626-add_time_series_table․up․sql file
Static File, cl-covid19/migrations/20200611234716-add_time_series_views.down.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․down․sql file
Static File, cl-covid19/migrations/20200611234716-add_time_series_views.up.sql: The cl-covid19/migrations/20200611234716-add_time_series_views․up․sql file

Jump to:   C   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   D   F   G   M   P   R   T   U   W  
Index Entry  Section

(
(setf api-client-endpoint): Exported generic functions
(setf api-client-endpoint): Exported generic functions
(setf api-client-port): Exported generic functions
(setf api-client-port): Exported generic functions
(setf api-client-scheme): Exported generic functions
(setf api-client-scheme): Exported generic functions

A
api-client-endpoint: Exported generic functions
api-client-endpoint: Exported generic functions
api-client-port: Exported generic functions
api-client-port: Exported generic functions
api-client-scheme: Exported generic functions
api-client-scheme: Exported generic functions
api-version: Exported functions

D
db-execute: Exported functions
disconnect-db-conn: Exported functions
display-api-routes: Exported functions
display-table: Exported functions

F
fetch-countries: Exported functions
fetch-country: Exported functions
fetch-time-series: Exported functions
fetch-time-series-for-country: Exported functions
fetch-time-series-global: Exported functions
fetch-time-series-latest: Exported functions
fetch-top-countries-by: Exported functions
Function, api-version: Exported functions
Function, db-execute: Exported functions
Function, disconnect-db-conn: Exported functions
Function, display-api-routes: Exported functions
Function, display-table: Exported functions
Function, fetch-countries: Exported functions
Function, fetch-country: Exported functions
Function, fetch-time-series: Exported functions
Function, fetch-time-series-for-country: Exported functions
Function, fetch-time-series-global: Exported functions
Function, fetch-time-series-latest: Exported functions
Function, fetch-top-countries-by: Exported functions
Function, get-api-routes: Exported functions
Function, get-countries-data: Exported functions
Function, get-summary-data: Exported functions
Function, get-time-series-archive: Exported functions
Function, get-time-series-for-country: Exported functions
Function, make-api-client: Exported functions
Function, make-api-uri: Exported functions
Function, make-db-conn: Exported functions
Function, migrate-db: Exported functions
Function, persist-countries-data: Exported functions
Function, persist-time-series-data: Exported functions
Function, plist-keys: Exported functions
Function, plist-values: Exported functions
Function, plot-data: Exported functions
Function, plot-time-series-for-country: Exported functions
Function, plot-time-series-for-country-animation: Exported functions
Function, plot-time-series-global: Exported functions
Function, plot-time-series-global-animation: Exported functions
Function, plot-top-countries-by: Exported functions
Function, render-gnuplot-template: Exported functions
Function, table-columns: Exported functions
Function, table-info: Exported functions
Function, update-all-data: Exported functions
Function, update-countries-data: Exported functions
Function, update-time-series-data: Exported functions
Function, write-csv: Exported functions

G
Generic Function, (setf api-client-endpoint): Exported generic functions
Generic Function, (setf api-client-port): Exported generic functions
Generic Function, (setf api-client-scheme): Exported generic functions
Generic Function, api-client-endpoint: Exported generic functions
Generic Function, api-client-port: Exported generic functions
Generic Function, api-client-scheme: Exported generic functions
get-api-routes: Exported functions
get-countries-data: Exported functions
get-summary-data: Exported functions
get-time-series-archive: Exported functions
get-time-series-for-country: Exported functions

M
make-api-client: Exported functions
make-api-uri: Exported functions
make-db-conn: Exported functions
Method, (setf api-client-endpoint): Exported generic functions
Method, (setf api-client-port): Exported generic functions
Method, (setf api-client-scheme): Exported generic functions
Method, api-client-endpoint: Exported generic functions
Method, api-client-port: Exported generic functions
Method, api-client-scheme: Exported generic functions
migrate-db: Exported functions

P
persist-countries-data: Exported functions
persist-time-series-data: Exported functions
plist-keys: Exported functions
plist-values: Exported functions
plot-data: Exported functions
plot-time-series-for-country: Exported functions
plot-time-series-for-country-animation: Exported functions
plot-time-series-global: Exported functions
plot-time-series-global-animation: Exported functions
plot-top-countries-by: Exported functions

R
render-gnuplot-template: Exported functions

T
table-columns: Exported functions
table-info: Exported functions

U
update-all-data: Exported functions
update-countries-data: Exported functions
update-time-series-data: Exported functions

W
write-csv: Exported functions

Jump to:   (  
A   D   F   G   M   P   R   T   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
E   P   S  
Index Entry  Section

*
*default-result-limit*: Exported special variables
*endpoint*: Internal special variables
*gnuplot-histograms-per-country-template*: Exported special variables
*gnuplot-time-series-animation-template*: Exported special variables
*gnuplot-time-series-with-filled-curves-new-cases-template*: Exported special variables
*gnuplot-time-series-with-filled-curves-template*: Exported special variables
*gnuplot-time-series-with-lines-new-cases-template*: Exported special variables
*gnuplot-time-series-with-lines-template*: Exported special variables
*migrations-path*: Exported special variables

E
endpoint: Exported classes

P
port: Exported classes

S
scheme: Exported classes
Slot, endpoint: Exported classes
Slot, port: Exported classes
Slot, scheme: Exported classes
Special Variable, *default-result-limit*: Exported special variables
Special Variable, *endpoint*: Internal special variables
Special Variable, *gnuplot-histograms-per-country-template*: Exported special variables
Special Variable, *gnuplot-time-series-animation-template*: Exported special variables
Special Variable, *gnuplot-time-series-with-filled-curves-new-cases-template*: Exported special variables
Special Variable, *gnuplot-time-series-with-filled-curves-template*: Exported special variables
Special Variable, *gnuplot-time-series-with-lines-new-cases-template*: Exported special variables
Special Variable, *gnuplot-time-series-with-lines-template*: Exported special variables
Special Variable, *migrations-path*: Exported special variables

Jump to:   *  
E   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   P   S  
Index Entry  Section

A
api-client: Exported classes

C
cl-covid19: The cl-covid19 system
cl-covid19: The cl-covid19 package
cl-covid19-system: The cl-covid19-system package
cl-covid19.api: The cl-covid19․api package
cl-covid19.core: The cl-covid19․core package
cl-covid19.db: The cl-covid19․db package
cl-covid19.gnuplot-template: The cl-covid19․gnuplot-template package
cl-covid19.util: The cl-covid19․util package
Class, api-client: Exported classes

P
Package, cl-covid19: The cl-covid19 package
Package, cl-covid19-system: The cl-covid19-system package
Package, cl-covid19.api: The cl-covid19․api package
Package, cl-covid19.core: The cl-covid19․core package
Package, cl-covid19.db: The cl-covid19․db package
Package, cl-covid19.gnuplot-template: The cl-covid19․gnuplot-template package
Package, cl-covid19.util: The cl-covid19․util package

S
System, cl-covid19: The cl-covid19 system

Jump to:   A   C   P   S