lice

Crates.iolice
lib.rslice
version0.1.4
sourcesrc
created_at2023-10-21 23:26:14.069772
updated_at2023-10-26 20:46:41.583226
descriptionDead simple, minimal SPDX License generator library written in Rust.
homepagehttps://github.com/refcell/lice
repositoryhttps://github.com/refcell/lice
max_upload_size
id1010287
size227,351
refcell (refcell)

documentation

README

lice

Build Status License Docs Latest Version rustc 1.65+

Dead simple, minimal SPDX License generator library written in Rust. Lice is in https://github.com/refcell/lice/labels/beta

Install | User Docs | Crate Docs | Reference | Contributing | License | Attribution

What is lice?

lice is a dead simple, minimal library for generating valid SPDX licenses. It was primarily built for amble but ripped out into it's own crate to provide an extensible library, published on crates.io.

Usage

Install lice with cargo.

cargo add lice

A short example to query for the MIT License is shown below.

use anyhow::Result;

#[tokio::main]
async fn main() -> Result<()> {
    let license = lice::get("mit").await?;
    assert_eq!(license.license_id, "MIT");
    Ok(())    
}

Under the hood, the get function fetches licenses and fuzzy matches, using the first choice to query the license details, returning the merged License and its details.

Contributing

All contributions are welcome! Experimentation is highly encouraged and new issues are welcome.

Troubleshooting & Bug Reports

Please check existing issues for similar bugs or open an issue if no relevant issue already exists.

Attribution

Much of this work is based off of lic, an spdx license generator binary that isn't extensible as a library. The adapted lice crate extends the SPDX "API" to provide more verbose license fetching methods. Big h/t to the creators of lic especially SigureMo

License

This project is licensed under the MIT License. Free and open-source, forever. All our rust are belong to you.

Commit count: 16

cargo fmt