Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moisutsu/arxiv-rs
Wrapper of the arXiv API for Rust
https://github.com/moisutsu/arxiv-rs
arxiv-api rust
Last synced: 27 days ago
JSON representation
Wrapper of the arXiv API for Rust
- Host: GitHub
- URL: https://github.com/moisutsu/arxiv-rs
- Owner: moisutsu
- License: mit
- Created: 2020-08-20T09:02:23.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-22T05:26:12.000Z (about 3 years ago)
- Last Synced: 2024-10-08T02:50:33.111Z (about 1 month ago)
- Topics: arxiv-api, rust
- Language: Rust
- Homepage: https://crates.io/crates/arxiv-rs
- Size: 80.1 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to arxiv-rs 👋
[![Crates.io](https://img.shields.io/crates/v/arxiv-rs.svg)](https://crates.io/crates/arxiv-rs)
[![Documentation](https://docs.rs/arxiv-rs/badge.svg)](https://docs.rs/arxiv-rs)
![License](https://img.shields.io/crates/l/arxiv-rs.svg)This is a wrapper crate for the arXiv API
## Usage
Add dependencies to `Cargo.toml`
```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
```rust
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
```rust
use arxiv::query;let query = query!(
search_query = "cat:cs.CL",
start = 0,
max_results = 5,
sort_by = "submittedDate",
sort_order = "descending"
);
```## Show your support
Give a ⭐️ if this project helped you!
---
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_