Crates.io | arxiv-rs |
lib.rs | arxiv-rs |
version | 0.1.5 |
source | src |
created_at | 2020-08-31 10:52:37.633131 |
updated_at | 2021-04-15 14:04:29.418948 |
description | A wrapper of the arXiv API for Rust |
homepage | |
repository | https://github.com/moisutsu/arxiv-rs |
max_upload_size | |
id | 283013 |
size | 43,212 |
This is a wrapper crate for the arXiv API
Add dependencies to Cargo.toml
[dependencies]
arxiv-rs = "0.1.5"
tokio = { version = "1.3.0", features = ["full"]}
anyhow = "1.0.32"
Fetch the paper information and save it as a pdf
use anyhow::Result;
use arxiv::ArxivQueryBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let query = ArxivQueryBuilder::new()
.search_query("cat:cs.CL")
.start(0)
.max_results(5)
.sort_by("submittedDate")
.sort_order("descending")
.build();
let arxivs = arxiv::fetch_arxivs(query).await?;
for arxiv in arxivs {
arxiv.fetch_pdf(&arxiv.title).await?;
}
Ok(())
}
You can easily build the query using the macro
use arxiv::query;
let query = query!(
search_query = "cat:cs.CL",
start = 0,
max_results = 5,
sort_by = "submittedDate",
sort_order = "descending"
);
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator