iars

Crates.ioiars
lib.rsiars
version0.1.0
sourcesrc
created_at2023-12-31 00:39:01.132778
updated_at2023-12-31 00:39:01.132778
descriptionA synchronous (blocking) client written purely in Rust, for interfacing with Internet Archive APIs.
homepage
repositoryhttps://github.com/bigbass1997/iars
max_upload_size
id1084501
size29,715
Luke Stadem (bigbass1997)

documentation

README

License: MIT License: APACHE2.0 Crates.io Documentation

Description

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.

Getting Started

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();
}

Authentication

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.

License

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.

Commit count: 1

cargo fmt