Crates.io | lice |
lib.rs | lice |
version | 0.1.4 |
source | src |
created_at | 2023-10-21 23:26:14.069772 |
updated_at | 2023-10-26 20:46:41.583226 |
description | Dead simple, minimal SPDX License generator library written in Rust. |
homepage | https://github.com/refcell/lice |
repository | https://github.com/refcell/lice |
max_upload_size | |
id | 1010287 |
size | 227,351 |
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
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.
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.
All contributions are welcome! Experimentation is highly encouraged and new issues are welcome.
Please check existing issues for similar bugs or open an issue if no relevant issue already exists.
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
This project is licensed under the MIT License. Free and open-source, forever. All our rust are belong to you.