A Rust wrapper for the Entrez API
master:
This library helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.
Add the following to your Cargo.toml:
toml
[dependencies]
entrez-rs = "0.1.2"
```rust use entrezrs::eutils::{Eutils, ESearch, EFetch, DB}; use entrezrs::parser::esearch::{ESearchResult}; use entrezrs::parser::pubmed::{PubmedArticleSet}; use entrezrs::errors::Error;
fn main() -> Result<(), Error> { let xml = ESearch::new( DB::Pubmed, "eclampsia") .run()?;
let parsed = ESearchResult::read(&xml);
println!("{:#?}", &parsed?
.id_list
.ids);
let pm_xml = EFetch::new(
DB::Pubmed,
vec!["33246200", "33243171"])
.run()?;
let pm_parsed = PubmedArticleSet::read(&pm_xml);
println!("{}", pm_parsed?.articles);
Ok(())
}
``` Will add a walkthrough and tutorial of the API as soon as it reaches beta level.
Inspired by Entrez Direct, Entrezpy and BioPython.