Crates.io | iars |
lib.rs | iars |
version | 0.1.0 |
source | src |
created_at | 2023-12-31 00:39:01.132778 |
updated_at | 2023-12-31 00:39:01.132778 |
description | A synchronous (blocking) client written purely in Rust, for interfacing with Internet Archive APIs. |
homepage | |
repository | https://github.com/bigbass1997/iars |
max_upload_size | |
id | 1084501 |
size | 29,715 |
This is a synchronous (blocking) client written purely in Rust, for interfacing with Internet Archive APIs.
Refer to the docs for which APIs are currently supported.
Add the iars
crate to your project's Cargo.toml file:
[dependencies]
iars = "0.1"
Most operations are available via the Item
data structure. Here's an example of uploading a file
to an Internet Archive "item":
use iars::{Credentials, Item};
fn main() {
// Authentication keys are required for uploading files.
let creds = Credentials::new("abcdefghijklmnop", "1234567890123456");
let item = Item::new("test_identifier")
.with_credentials(Some(creds));
item.upload_file(true, &[("collection", "test_collection")], "a_directory/myfile.txt", "Hello World!".as_bytes()).unwrap();
}
Some of the Internet Archive's API queries require authentication using API keys. To get your own API keys, create or log into an account on https://archive.org/. Then go to https://archive.org/account/s3.php.
The contents of this repository are dual-licensed under the MIT OR Apache
2.0 License. That means you can chose either the MIT licence or the
Apache-2.0 licence when you re-use this code. See the MIT
or APACHE2.0
files for more
information on each specific licence.
Any submissions to this project (e.g. as Pull Requests) must be made available under these terms.