8.5
covid-19
Racket wrapper of QQ/Sina’s COVID-19 API
(require covid-19) will do the same as (require covid-19/qq covid-19/sina).
There is also a website whose data is drived by this pkg for you to check with:
https://www.yanying.wang/daily-report/.
1 QQ
(require covid-19/qq) | package: covid-19 |
parameter
(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
procedure
procedure
procedure
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)
Example:
> (qq/sort+filter-by 'confirm 'total) '(...)
2 Sina
(require covid-19/sina) | package: covid-19 |
parameter
(covid-19/reload-data/sina v) → void? v : boolean?
= #t
Whether rerequest Sina COVID-19 API and reflush cached data or not, which data is used for all the following procedures.
procedure
procedure
(sina/data/list) → list?
procedure
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:
> (sina/contries/sort+filter-by 'conNum) '()