Skip to content

A Rust wrapper around the Entrez API. Helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.

Notifications You must be signed in to change notification settings

Zenleaf/entrez-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

entrez-rs

A Rust wrapper for the Entrez API

release: Crates.io

master: Build Status

This library helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.

Installation

Add the following to your Cargo.toml:

   [dependencies]
   entrez-rs = "0.1.4"

Usage

use entrez_rs::eutils::{Eutils, ESearch, EFetch, DB};
use entrez_rs::parser::esearch::{ESearchResult};
use entrez_rs::parser::pubmed::{PubmedArticleSet};
use entrez_rs::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.

About

A Rust wrapper around the Entrez API. Helps you access the Entrez API using idiomatic Rust. It also provides tools to parse the XML results from Entrez.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages