#uk #data #api #covid-19 #coronavirus #filter #nhs

covid19_uk_rs

Unofficial Rust library for the 'Coronavirus in the UK' data API

3 stable releases

1.1.1 Oct 16, 2020
1.0.1 Aug 15, 2020

#12 in #covid-19

31 downloads per month

MIT/Apache

20KB
287 lines

covid19-uk-rs

Unofficial Rust library for the 'Coronavirus in the UK' data API.

Please see the crates.io page for more information and documentation.

Archival notice + data validity warning

This project was archived on 23rd May 2022, owing to a limitation in usefulness following changes in UK Government policy: in short, tests are no longer available for the vast majority of people, and indeed most tests are no longer reportable to the NHS. This severely limits the usefulness of the data supplied, and certainly renders any real data analysis of case numbers or conclusions drawn from such analysis likely invalid.

Nonetheless, the project remains available in an as-is state.

Thank you!


lib.rs:

This library is not affiliated with the NHS, Public Health England, or the UK Government. This is an unofficial project to provide Rust bindings for the NHS COVID-19 API.

This library provides interfaces with the NHS 'Coronavirus (COVID-19) in the UK' data APIs, provided by gov.uk.

Examples

use covid19_uk_rs;

let mut req = covid19_uk_rs::Request::new(covid19_uk_rs::AreaType::Nation, covid19_uk_rs::Metric::CumulativeCasesByPublishDate(0));
req.add_filter(covid19_uk_rs::Filter::new(covid19_uk_rs::FilterValue::AreaName(String::from("england"))));

for day in req.get().unwrap() {
    match day.get(0) {
        Some(i) => match i {
            covid19_uk_rs::Metric::CumulativeCasesByPublishDate(i) => println!("{}", i),
            _ => {},
        },
        None => {},
    }
}

Dependencies

~5–9MB
~211K SLoC