Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🦀 Rust crate

crates.io docs.rs Size Downloads Dependency Status

The ACORN CLI application is built on top of the acorn-lib Rust crate. The acorn-lib library provides core functionalities for working with ACORN schemas, validating persistent identifiers1, and generating artifacts.

Important

When ACORN validates a PID, it does not just use regular expressions, but also includes checksum validation when part of the associated PID specification. ARKs2, ISBNs3, ORCiDs4, and RORs5 all include some form of checksum, and acorn-lib validates these as well to ensure the PID is not only well-formed but also valid according to its specification.

Installation

  • Add acorn-lib as a dependency6

    cargo add acorn-lib
    
  • Use acorn-lib functions in your Rust code

    #![allow(unused)]
    fn main() {
    use acorn::schema::validate::{is_ark, is_doi, is_orcid, is_ror};
    
    assert!(is_ark("ark:/1234/w5678"));
    assert!(is_doi("10.11578/dc.20250604.1"));
    assert!(is_orcid("https://orcid.org/0000-0002-2057-9115"));
    assert!(is_ror("01qz5mb56"));
    }
  • If you want to use the full capability of acorn-lib to build your own CLI app, be sure to enable the doctor and powerpoint features7

    cargo add acorn-lib --features doctor,powerpoint
    

  1. Persistent Identifiers (PIDs) supported by acorn-lib include DOIs, ORCIDs, RAiDs, RORs, and ARKs.

  2. noid_check_digit

  3. isbn_check_digit

  4. orcid_check_digit

  5. ror_check_digit

  6. Check crates.io for the latest version

  7. See the Cargo.toml for more details.