7 releases
0.1.4 | Oct 26, 2023 |
---|---|
0.1.3 | Oct 26, 2023 |
0.0.2 | Oct 22, 2023 |
#12 in #spdx
35 downloads per month
Used in 3 crates
(2 directly)
180KB
310 lines
lice
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.
Dependencies
~6–18MB
~261K SLoC