1 unstable release
new 0.1.0 | Dec 13, 2024 |
---|
#2 in #arxiv
110 downloads per month
25KB
537 lines
arxiv-tools
Tools for arXiv API.
Quick Start
Installation
To start using arxiv-tools
, just add it to your project's dependencies in the Cargo.toml
.
> cargo add arxiv-tools
Then, import it in your program.
use arxiv_tools::ArXiv;
Usage
arxiv-tools
is a simple api wrapper. You just need to build and execute the query.
-
simple query
// build the query let mut arxiv = ArXiv::new(); arxiv.title("attention is all you need"); // execute let response: Vec<ArXivResponse> = arxiv.query().await; // serialize into json let response = serde_json::to_string_pretty(&response).unwrap();
-
query combining multiple conditions
// build the query let mut arxiv = ArXiv::new(); arxiv .subject_category("cs.AI") .or() .subject_category("cs.LG") .submitted_date("202412010000", "202412012359"); // execute let response = arxiv.query().await; // serialize into json let response = serde_json::to_string_pretty(&response).unwrap();
-
complex query using grouped conditions
// build the query let mut arxiv = ArXiv::new(); arxiv .title("ai") .or() .title("llm") .and() .group_start() .subject_category("cs.AI") .or() .subject_category("cs.LG") .group_end() .submitted_date("202412010000", "202412012359"); // execute let response = arxiv.query().await; // serialize into json let response = serde_json::to_string_pretty(&response).unwrap();
Dependencies
~11–22MB
~316K SLoC