54 releases (23 stable)

3.2.0 Sep 16, 2023
3.1.1 Apr 9, 2023
3.0.0 Dec 14, 2022
2.0.3 Aug 13, 2022
0.2.12 Jul 14, 2017

#74 in Development tools

Download history 238/week @ 2023-08-09 473/week @ 2023-08-16 596/week @ 2023-08-23 576/week @ 2023-08-30 528/week @ 2023-09-06 428/week @ 2023-09-13 529/week @ 2023-09-20 1005/week @ 2023-09-27 934/week @ 2023-10-04 605/week @ 2023-10-11 526/week @ 2023-10-18 532/week @ 2023-10-25 534/week @ 2023-11-01 693/week @ 2023-11-08 548/week @ 2023-11-15 739/week @ 2023-11-22

2,635 downloads per month
Used in 42 crates (10 directly)

MIT/Apache

2.5MB
319 lines

license

Provides embedded license information from SPDX.

Rust Crates.io Docs

Use the licenses directly.

use license::License;
use license::licenses::Bsd3Clause;

let bsd3 = Bsd3Clause;
assert!(bsd3.is_osi_approved());
assert_eq!(bsd3.name(), r#"BSD 3-Clause "New" or "Revised" License"#);

Get the license by parsing the license id.

use license::License;

let apache2: &dyn License = "Apache-2.0".parse().unwrap();
assert_eq!(apache2.name(), "Apache License 2.0");

License exceptions are also supported.

use license::Exception;

let gcc: &dyn Exception = "GCC-exception-3.1".parse().unwrap();
assert_eq!(gcc.name(), "GCC Runtime Library exception 3.1");

By default, this library downloads the latest licenses from github.com/spdx. If you want to build it offline instead, you can enable the offline feature.

Serde is supported with the serde feature.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies