https://github.com/composer/spdx-licenses
Tools for working with the SPDX license list and validating licenses.
https://github.com/composer/spdx-licenses
Last synced: about 1 year ago
JSON representation
Tools for working with the SPDX license list and validating licenses.
- Host: GitHub
- URL: https://github.com/composer/spdx-licenses
- Owner: composer
- License: mit
- Created: 2015-07-14T15:27:19.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-08-26T15:22:11.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T10:24:15.804Z (over 1 year ago)
- Language: PHP
- Size: 172 KB
- Stars: 1,393
- Watchers: 9
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
composer/spdx-licenses
======================
SPDX (Software Package Data Exchange) licenses list and validation library.
Originally written as part of [composer/composer](https://github.com/composer/composer),
now extracted and made available as a stand-alone library.
[](https://github.com/composer/spdx-licenses/actions)
Installation
------------
Install the latest version with:
```bash
$ composer require composer/spdx-licenses
```
Basic Usage
-----------
```php
getLicenseByIdentifier('MIT');
// get a license exception by identifier
$licenses->getExceptionByIdentifier('Autoconf-exception-3.0');
// get a license identifier by name
$licenses->getIdentifierByName('MIT License');
// check if a license is OSI approved by identifier
$licenses->isOsiApprovedByIdentifier('MIT');
// check if a license identifier is deprecated
$licenses->isDeprecatedByIdentifier('MIT');
// check if input is a valid SPDX license expression
$licenses->validate($input);
```
> Read the [specifications](https://spdx.org/specifications)
> to find out more about valid license expressions.
Requirements
------------
* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.
License
-------
composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.
Source
------
License information is curated by [SPDX](https://spdx.org/). The data is pulled from the
[License List Data](https://github.com/spdx/license-list-data) repository.
* [Licenses](https://spdx.org/licenses/index.html)
* [License Exceptions](https://spdx.org/licenses/exceptions-index.html)