covid-19
1 QQ
covid-19/  reload-data/  qq
qq/  data
qq/  data/  china-total
qq/  data/  china-add
qq/  data/  all-provinces
qq/  get-region
qq/  get-num
qq/  get-num*
qq/  sort+  filter-by
2 Sina
covid-19/  reload-data/  sina
sina/  data
sina/  data/  list
sina/  data/  otherlist
sina/  contries/  sort+  filter-by
8.5

covid-19

Yanying Wang <yanyingwang1@gmail.com>

Racket wrapper of QQ/Sina’s COVID-19 API

    1 QQ

    2 Sina

 (require covid-19) package: covid-19

1 QQ

 (require covid-19/qq) package: covid-19

parameter

(covid-19/reload-data/qq)  boolean?

(covid-19/reload-data/qq v)  void?
  v : boolean?
 = #t
Whether rerequest QQ’s COVID-19 API and reflush cached data or not, which data is used for all the following procedures.

procedure

(qq/data)  hash-eq?

procedure

(qq/data/china-total)  hash-eq?

procedure

(qq/data/china-add)  hash-eq?

procedure

(qq/data/all-provinces)  list?

Returns corresponding requested data.

procedure

(qq/get-region province-name city-name)  hash-eq?

  province-name : (or/c string? symbol?)
  city-name : (or/c string? symbol?)
Returns data of a specified province-name of China or data of its specified city-name if provided.

Examples:
> (qq/get-region '河南)

#<hash>

> (qq/get-region '河南 '郑州)

#<hash>

procedure

(qq/get-num node-data [type1 type2])  number?

  node-data : (hash-eq?)
  type1 : (or/c 'confirm 'dead) = 'confirm
  type2 : (or/c 'today 'total) = 'today
Returns the number of type1 in type2 of the node-data, which node-data is the result of qq/get-province.

Example:
> (qq/get-num (qq/get-region '河南) 'confirm 'total)

3159

procedure

(qq/get-num* province-name    
  [type1    
  type2    
  #:city city-name])  number?
  province-name : symbol?
  type1 : (or/c 'confirm 'dead) = 'confirm
  type2 : (or/c 'today 'total) = 'today
  city-name : string? = #f
Returns a number of type1 in type2 of a specified city-name of province-name.

Examples:
> (qq/get-num* '河南)

4

> (qq/get-num* '河南 'confirm 'total)

3159

> (qq/get-num* '河南 'confirm 'total #:city '郑州)

602

> (qq/get-num* '上海 'confirm 'total #:city '徐汇)

4661

procedure

(qq/sort+filter-by type1 type2)  list?

  type1 : (or/c 'confirm 'dead)
  type2 : (or/c 'today 'total)
Sorting and filting qq/data/all-provinces by type1 and type2.

Example:
> (qq/sort+filter-by 'confirm 'total)

'(...)

2 Sina

 (require covid-19/sina) package: covid-19

Whether rerequest Sina COVID-19 API and reflush cached data or not, which data is used for all the following procedures.

procedure

(sina/data)  hash-eq?

procedure

(sina/data/list)  list?

procedure

(sina/data/otherlist)  list?

Returns corresponding requested data.

procedure

(sina/contries/sort+filter-by type)  number?

  type : (or/c 'conNum 'conadd 'deathNum 'deathadd)
Sorting and filting sina/data/otherlist by type.

Example: