SPDX licenses list and validation library.

Fund package maintenance!

Installs: 55 970 313

Dependents: 18

Suggesters: 1

Security: 0

Stars: 1 305

Watchers: 7

Forks: 26

Open Issues: 1

1.5.5 2020-12-03 16:04 UTC

This package is auto-updated.

Last update: 2021-09-21 06:39:52 UTC


SPDX (Software Package Data Exchange) licenses list and validation library.

Originally written as part of composer/composer, now extracted and made available as a stand-alone library.

Continuous Integration


Install the latest version with:

$ composer require composer/spdx-licenses

Basic Usage


use Composer\Spdx\SpdxLicenses;

$licenses = new SpdxLicenses();

// get a license by identifier

// get a license exception by identifier

// get a license identifier by name
$licenses->getIdentifierByName('MIT License');

// check if a license is OSI approved by identifier

// check if a license identifier is deprecated

// check if input is a valid SPDX license expression

Read the specifications to find out more about valid license expressions.


  • PHP 5.3.2 is required but using the latest version of PHP is highly recommended.


composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.


License information is curated by SPDX. The data is pulled from the License List Data repository.