Packages / rupm

license-tools 0.1.0

Identify common open source licenses from their text, and check SPDX license identifiers and expressions

Install

cargo add license-tools --registry rupm

In Ruststudio: Packages, search for license-tools, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-22.

Versions

README

# license-tools

Identify common open source licenses from their text, and check SPDX license identifiers and expressions

Add it with `rupm add license-tools` (or `cargo add license-tools --registry rupm`).

```rust
let text = "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction ... shall be included in all copies or substantial portions of the Software.";
assert_eq!(license_tools::identify(text).unwrap().id, "MIT");

assert!(license_tools::is_spdx_id("Apache-2.0"));
assert_eq!(license_tools::canonical_id("apache-2.0"), Some("Apache-2.0"));
assert_eq!(license_tools::expression_ids("MIT OR Apache-2.0").unwrap(), ["MIT", "Apache-2.0"]);
assert!(license_tools::expression_ids("MIT OR Made-Up").is_err());
```