Crates.io | core_api_client |
lib.rs | core_api_client |
version | 1.1.0 |
source | src |
created_at | 2023-06-30 08:10:18.227128 |
updated_at | 2024-07-03 09:43:03.252472 |
description | A Rust library for interacting with CORE API, a service that provides access to metadata and full texts of research papers from thousands of data providers. |
homepage | |
repository | https://github.com/VakeDomen/core_api_client |
max_upload_size | |
id | 904250 |
size | 64,242 |
A Rust library for interacting with CORE, a service that provides access to metadata and full texts of research papers from thousands of data providers.
The CORE API Rust Client library allows for easy interaction with the CORE API, a unique service providing real-time machine access to vast quantities of metadata and full text research papers.
To add the library to your project, add the following to your Cargo.toml:
[dependencies]
core_api_client = "1.1.0"
Then run cargo build
to download and compile the library.
Yout can access the full documentation on here here
Executes a search on the API for works based on the query. These are the entities that represent a piece of research, .e.g research articles, theses, etc. In total, it is a deduplicated and enriched version of records.
use core_api_client::FilterOperator;
use core_api_client::Api;
let api = Api::from("API_KEY");
let query = api.paged_search(10, 0)
.and(FilterOperator::Exists("doi"))
.and(FilterOperator::Bigger("citationCount", 20));
match api.search_works(query) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Executes a search on the API for works based on the query. It gives you access to the collection of entities that offer data to CORE. It contains repositories (institutional and disciplinary), preprint servers, journals and publishers.
use core_api_client::FilterOperator;
use core_api_client::Api;
let api = Api::from("API_KEY");
let query = api.paged_search(10, 0)
.and(FilterOperator::Exists("software"))
.and(FilterOperator::HasValue("type", "JOURNAL"));
match api.search_data_providers(query) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Fetches a specific data provider from CORE using the provided data provider identifier. The function makes use of the CORE API's capability to fetch data provider details using their identifiers. The identifiers can be either:
ApiResponse
.id
: Identifier of the data provider. Can be a CORE data provider identifier (integer) or an OpenDOAR identifier prefixed with "opendoar:".use core_api_client::FilterOperator;
use core_api_client::Api;
let api = Api::from("API_KEY");
match api.get_data_provider(86) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
match api.get_data_provider("opendoar:300") {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Executes a search on the API for journals based on the query. This dataset contains all journal titles included in the CORE collection. Moreover, you can search and retrieve any journal even if it is not a CORE data provider.
use core_api_client::FilterOperator;
use core_api_client::Api;
let api = Api::from("API_KEY");
let query = api.paged_search(10, 0)
.and(FilterOperator::Eq("publisher", "OJS"));
match api.search_journals(query) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Fetches a single output from CORE using the provided output id.
id
- The Journal id in CORE. Use issn:ISSN to search by ISSN instead of the CORE identifier.use core_api_client::Api;
let api = Api::from("API_KEY");
match api.get_journal("issn:1179-1497") {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Executes a search on the API for otuputs (works) based on the query. Outputs are a representation of a Work in a data provider. The data is not enriched and it mirrors exactly the content harvested from the data provider.
use core_api_client::FilterOperator;
use core_api_client::Api;
let api = Api::from("API_KEY");
let query = api.paged_search(10, 0)
.and(FilterOperator::Eq("publisher", "OJS"));
match api.search_outputs(query) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
Fetches a single output from CORE using the provided output id.
id
- The CORE ID of the output to be fetched.use core_api_client::Api;
let api = Api::from("API_KEY");
match api.get_output(0) {
Ok(data) => println!("{:#?}", data),
Err(e) => println!("{:#?}", e),
};
We would love for you to contribute to core_api_client
and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow:
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to the core_api_client GitHub Repository. Even better, you can submit a Pull Request with a fix.
You can also request a new feature by submitting an issue to our GitHub Repository. If you would like to implement a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it.
We actively welcome your pull requests. Here's a quick guide:
main
.Please follow a simple rule for commit messages: Keep them short, but expressive. The first line of the commit message should be less than 50 characters and should start with a capital letter. An empty line should follow it, followed by a more detailed explanation if necessary.
This project is licensed under the MIT License. See the LICENSE file for details.