}
IDENTIFIERS = {
- 'AGPLv1.0': {'spdx': 'AGPL-1.0'},
- 'AGPLv3.0': {'spdx': 'AGPL-3.0'},
- 'AcademicFreeLicense1.1': {'spdx': 'AFL-1.1'},
- 'AcademicFreeLicense1.2': {'spdx': 'AFL-1.2'},
- 'AcademicFreeLicense2.0': {'spdx': 'AFL-2.0'},
- 'AcademicFreeLicense2.1': {'spdx': 'AFL-2.1'},
- 'AcademicFreeLicense3.0': {'spdx': 'AFL-3.0'},
- 'Aladdin': {'spdx': 'Aladdin'},
- 'apache1.1': {'spdx': 'Apache-1.1'},
- 'apache1': {'spdx': 'Apache-1.0'},
- 'apache2': {'spdx': 'Apache-2.0'},
- 'apsl1': {'spdx': 'APSL-1.0'},
- 'apsl2': {'spdx': 'APSL-2.0'},
- 'ArtisticLicense': {'spdx': 'Artistic-1.0'},
- 'ArtisticLicense2': {'spdx': 'Artistic-2.0'},
- 'BerkeleyDB': {'spdx': 'Sleepycat'},
- 'bittorrent': {'spdx': 'BitTorrent-1.1'},
- 'boost': {'spdx': 'BSL-1.0'},
- 'ccby': {'spdx': 'CC-BY-4.0'},
- 'CC-BY-NC-1.0': {'spdx': 'CC-BY-NC-1.0'},
- 'CC-BY-NC-2.0': {'spdx': 'CC-BY-NC-2.0'},
- 'CC-BY-NC-2.5': {'spdx': 'CC-BY-NC-2.5'},
- 'CC-BY-NC-3.0': {'spdx': 'CC-BY-NC-3.0'},
- 'CC-BY-NC-4.0': {'spdx': 'CC-BY-NC-4.0'},
- 'CC-BY-ND-1.0': {'spdx': 'CC-BY-ND-1.0'},
- 'CC-BY-ND-2.0': {'spdx': 'CC-BY-ND-2.0'},
- 'CC-BY-ND-2.5': {'spdx': 'CC-BY-ND-2.5'},
- 'CC-BY-ND-3.0': {'spdx': 'CC-BY-ND-3.0'},
- 'CC-BY-ND-4.0': {'spdx': 'CC-BY-ND-4.0'},
- 'ccbysa': {'spdx': 'CC-BY-SA-4.0'},
- 'CC0': {'spdx': 'CC0-1.0'},
- 'CDDL': {'spdx': 'CDDL-1.0'},
- 'CPAL': {'spdx': 'CPAL-1.0'},
- 'CeCILL': {'spdx': 'CECILL-2.0'},
- 'CeCILL-B': {'spdx': 'CECILL-B'},
- 'CeCILL-C': {'spdx': 'CECILL-C'},
- 'ClarifiedArtistic': {'spdx': 'ClArtistic'},
- 'clearbsd': {'spdx': 'BSD-3-Clause-Clear'},
- 'CommonPublicLicense10': {'spdx': 'CPL-1.0'},
- 'cpol': {'spdx': 'CPOL-1.02'},
- 'Condor': {'spdx': 'Condor-1.1'},
- 'ECL2.0': {'spdx': 'ECL-2.0'},
- 'eCos11': {'spdx': 'RHeCos-1.1'},
- 'eCos2.0': {'spdx': 'GPL-2.0+ WITH eCos-exception-2.0'},
- 'EPL': {'spdx': 'EPL-1.0'},
- 'EPL2': {'spdx': 'EPL-2.0'}, # not in license-list-XML yet
- 'EUDataGrid': {'spdx': 'EUDatagrid'},
- 'EUPL': {'spdx': 'EUPL-1.1'},
- 'Eiffel': {'spdx': 'EFL-2.0'},
- 'Expat': {'spdx': 'MIT'},
- 'FDLv1.1': {'spdx': 'GFDL-1.1'},
- 'FDLv1.2': {'spdx': 'GFDL-1.2'},
- 'FDLv1.3': {'spdx': 'GFDL-1.3'},
- 'FreeBSD': {'spdx': 'BSD-2-Clause-FreeBSD'},
- 'freetype': {'spdx': 'FTL'},
- 'GNUAllPermissive': {'spdx': 'FSFAP'},
- 'GNUGPLv3': {'spdx': 'GPL-3.0'},
- 'gnuplot': {'spdx': 'gnuplot'},
- 'GPLv2': {'spdx': 'GPL-2.0'},
- 'HPND': {'spdx': 'HPND'},
- 'IBMPL': {'spdx': 'IPL-1.0'},
- 'iMatix': {'spdx': 'iMatix'},
- 'imlib': {'spdx': 'Imlib2'},
- 'ijg': {'spdx': 'IJG'},
- 'intel': {'spdx': 'Intel'},
- 'IPAFONT': {'spdx': 'IPA'},
- 'ISC': {'spdx': 'ISC'},
- 'JSON': {'spdx': 'JSON'},
- 'LGPLv3': {'spdx': 'LGPL-3.0'},
- 'LGPLv2.1': {'spdx': 'LGPL-2.1'},
- 'LPPL-1.2': {'spdx': 'LPPL-1.2'},
- 'LPPL-1.3a': {'spdx': 'LPPL-1.3a'},
- 'lucent102': {'spdx': 'LPL-1.02'},
- 'ModifiedBSD': {'spdx': 'BSD-3-Clause'},
- 'MPL': {'spdx': 'MPL-1.1'},
- 'MPL-2.0': {'spdx':'MPL-2.0'},
- 'ms-pl': {'spdx': 'MS-PL'},
- 'ms-rl': {'spdx': 'MS-RL'},
- 'NASA': {'spdx': 'NASA-1.3'},
- 'NCSA': {'spdx':'NCSA'},
- 'newOpenLDAP': {'spdx': 'OLDAP-2.7'},
- 'Nokia': {'spdx': 'Nokia'},
- 'NoLicense': {'spdx': 'NONE'},
- 'NOSL': {'spdx': 'NOSL'},
- 'NPL-1.0': {'spdx': 'NPL-1.0'},
- 'NPL-1.1': {'spdx': 'NPL-1.1'},
- 'ODbl': {'spdx': 'ODbL-1.0'},
- 'oldOpenLDAP': {'spdx': 'OLDAP-2.3'},
- 'OpenPublicL': {'spdx': 'OPL-1.0'},
- 'OpenSSL': {'spdx': 'OpenSSL'},
- 'OriginalBSD': {'spdx': 'BSD-4-Clause'},
- 'OSL-1.0': {'spdx': 'OSL-1.0'},
- 'OSL-1.1': {'spdx': 'OSL-1.1'},
- 'OSL-2.0': {'spdx': 'OSL-2.0'},
- 'OSL-2.1': {'spdx': 'OSL-2.1'},
- 'OSL-3.0': {'spdx': 'OSL-3.0'},
- 'PHP-3.01': {'spdx': 'PHP-3.01'},
- 'Python2.0': {'spdx': 'Python-2.0'},
- 'QPL': {'spdx': 'QPL-1.0'},
- 'RPSL': {'spdx': 'RPSL-1.0'},
- 'Ruby': {'spdx': 'Ruby'},
- 'SGIFreeB': {'spdx': 'SGI-B-2.0'},
- 'SILOFL': {'spdx': 'OFL-1.1'},
- 'SPL': {'spdx': 'SPL-1.0'},
- 'StandardMLofNJ': {'spdx': 'SMLNJ'},
- 'Unlicense': {'spdx': 'Unlicense'},
- 'UPL': {'spdx': 'UPL-1.0'},
- 'Vim': {'spdx': 'Vim'},
- 'W3C': {'spdx': 'W3C'},
- 'Watcom': {'spdx': 'Watcom-1.0'},
- 'WTFPL': {'spdx': 'WTFPL'},
- 'X11License': {'spdx': 'X11'},
- 'XFree861.1License': {'spdx': 'XFree86-1.1'},
- 'xinetd': {'spdx': 'xinetd'},
- 'Yahoo': {'spdx': 'YPL-1.1'},
- 'Zend': {'spdx': 'Zend-2.0'},
- 'Zimbra': {'spdx': 'Zimbra-1.3'},
- 'ZLib': {'spdx': 'Zlib'},
- 'Zope2.0': {'spdx': 'ZPL-2.0'},
- 'Zope2.1': {'spdx': 'ZPL-2.1'},
+ 'AGPLv1.0': {'spdx': ['AGPL-1.0']},
+ 'AGPLv3.0': {'spdx': ['AGPL-3.0-or-later', 'AGPL-3.0-only', 'AGPL-3.0']},
+ 'AcademicFreeLicense1.1': {'spdx': ['AFL-1.1']},
+ 'AcademicFreeLicense1.2': {'spdx': ['AFL-1.2']},
+ 'AcademicFreeLicense2.0': {'spdx': ['AFL-2.0']},
+ 'AcademicFreeLicense2.1': {'spdx': ['AFL-2.1']},
+ 'AcademicFreeLicense3.0': {'spdx': ['AFL-3.0']},
+ 'Aladdin': {'spdx': ['Aladdin']},
+ 'apache1.1': {'spdx': ['Apache-1.1']},
+ 'apache1': {'spdx': ['Apache-1.0']},
+ 'apache2': {'spdx': ['Apache-2.0']},
+ 'apsl1': {'spdx': ['APSL-1.0']},
+ 'apsl2': {'spdx': ['APSL-2.0']},
+ 'ArtisticLicense': {'spdx': ['Artistic-1.0']},
+ 'ArtisticLicense2': {'spdx': ['Artistic-2.0']},
+ 'BerkeleyDB': {'spdx': ['Sleepycat']},
+ 'bittorrent': {'spdx': ['BitTorrent-1.1']},
+ 'boost': {'spdx': ['BSL-1.0']},
+ 'ccby': {'spdx': ['CC-BY-4.0']},
+ 'CC-BY-NC-1.0': {'spdx': ['CC-BY-NC-1.0']},
+ 'CC-BY-NC-2.0': {'spdx': ['CC-BY-NC-2.0']},
+ 'CC-BY-NC-2.5': {'spdx': ['CC-BY-NC-2.5']},
+ 'CC-BY-NC-3.0': {'spdx': ['CC-BY-NC-3.0']},
+ 'CC-BY-NC-4.0': {'spdx': ['CC-BY-NC-4.0']},
+ 'CC-BY-ND-1.0': {'spdx': ['CC-BY-ND-1.0']},
+ 'CC-BY-ND-2.0': {'spdx': ['CC-BY-ND-2.0']},
+ 'CC-BY-ND-2.5': {'spdx': ['CC-BY-ND-2.5']},
+ 'CC-BY-ND-3.0': {'spdx': ['CC-BY-ND-3.0']},
+ 'CC-BY-ND-4.0': {'spdx': ['CC-BY-ND-4.0']},
+ 'ccbysa': {'spdx': ['CC-BY-SA-4.0']},
+ 'CC0': {'spdx': ['CC0-1.0']},
+ 'CDDL': {'spdx': ['CDDL-1.0']},
+ 'CPAL': {'spdx': ['CPAL-1.0']},
+ 'CeCILL': {'spdx': ['CECILL-2.0']},
+ 'CeCILL-B': {'spdx': ['CECILL-B']},
+ 'CeCILL-C': {'spdx': ['CECILL-C']},
+ 'ClarifiedArtistic': {'spdx': ['ClArtistic']},
+ 'clearbsd': {'spdx': ['BSD-3-Clause-Clear']},
+ 'CommonPublicLicense10': {'spdx': ['CPL-1.0']},
+ 'cpol': {'spdx': ['CPOL-1.02']},
+ 'Condor': {'spdx': ['Condor-1.1']},
+ 'ECL2.0': {'spdx': ['ECL-2.0']},
+ 'eCos11': {'spdx': ['RHeCos-1.1']},
+ 'eCos2.0': {'spdx': ['GPL-2.0+ WITH eCos-exception-2.0']},
+ 'EPL': {'spdx': ['EPL-1.0']},
+ 'EPL2': {'spdx': ['EPL-2.0']}, # not in license-list-XML yet
+ 'EUDataGrid': {'spdx': ['EUDatagrid']},
+ 'EUPL': {'spdx': ['EUPL-1.1']},
+ 'Eiffel': {'spdx': ['EFL-2.0']},
+ 'Expat': {'spdx': ['MIT']},
+ 'FDLv1.1': {'spdx': ['GFDL-1.1-or-later', 'GFDL-1.1-only', 'GFDL-1.1']},
+ 'FDLv1.2': {'spdx': ['GFDL-1.2-or-later', 'GFDL-1.2-only', 'GFDL-1.2']},
+ 'FDLv1.3': {'spdx': ['GFDL-1.3-or-later', 'GFDL-1.3-only', 'GFDL-1.3']},
+ 'FreeBSD': {'spdx': ['BSD-2-Clause-FreeBSD']},
+ 'freetype': {'spdx': ['FTL']},
+ 'GNUAllPermissive': {'spdx': ['FSFAP']},
+ 'GNUGPLv3': {'spdx': ['GPL-3.0-or-later', 'GPL-3.0-only', 'GPL-3.0']},
+ 'gnuplot': {'spdx': ['gnuplot']},
+ 'GPLv2': {'spdx': ['GPL-2.0-or-later', 'GPL-2.0-only', 'GPL-2.0']},
+ 'HPND': {'spdx': ['HPND']},
+ 'IBMPL': {'spdx': ['IPL-1.0']},
+ 'iMatix': {'spdx': ['iMatix']},
+ 'imlib': {'spdx': ['Imlib2']},
+ 'ijg': {'spdx': ['IJG']},
+ 'intel': {'spdx': ['Intel']},
+ 'IPAFONT': {'spdx': ['IPA']},
+ 'ISC': {'spdx': ['ISC']},
+ 'JSON': {'spdx': ['JSON']},
+ 'LGPLv3': {'spdx': ['LGPL-3.0-or-later', 'LGPL-3.0-only', 'LGPL-3.0']},
+ 'LGPLv2.1': {'spdx': ['LGPL-2.1-or-later', 'LGPL-2.1-only', 'LGPL-2.1']},
+ 'LPPL-1.2': {'spdx': ['LPPL-1.2']},
+ 'LPPL-1.3a': {'spdx': ['LPPL-1.3a']},
+ 'lucent102': {'spdx': ['LPL-1.02']},
+ 'ModifiedBSD': {'spdx': ['BSD-3-Clause']},
+ 'MPL': {'spdx': ['MPL-1.1']},
+ 'MPL-2.0': {'spdx': ['MPL-2.0']},
+ 'ms-pl': {'spdx': ['MS-PL']},
+ 'ms-rl': {'spdx': ['MS-RL']},
+ 'NASA': {'spdx': ['NASA-1.3']},
+ 'NCSA': {'spdx': ['NCSA']},
+ 'newOpenLDAP': {'spdx': ['OLDAP-2.7']},
+ 'Nokia': {'spdx': ['Nokia']},
+ 'NoLicense': {'spdx': ['NONE']},
+ 'NOSL': {'spdx': ['NOSL']},
+ 'NPL-1.0': {'spdx': ['NPL-1.0']},
+ 'NPL-1.1': {'spdx': ['NPL-1.1']},
+ 'ODbl': {'spdx': ['ODbL-1.0']},
+ 'oldOpenLDAP': {'spdx': ['OLDAP-2.3']},
+ 'OpenPublicL': {'spdx': ['OPL-1.0']},
+ 'OpenSSL': {'spdx': ['OpenSSL']},
+ 'OriginalBSD': {'spdx': ['BSD-4-Clause']},
+ 'OSL-1.0': {'spdx': ['OSL-1.0']},
+ 'OSL-1.1': {'spdx': ['OSL-1.1']},
+ 'OSL-2.0': {'spdx': ['OSL-2.0']},
+ 'OSL-2.1': {'spdx': ['OSL-2.1']},
+ 'OSL-3.0': {'spdx': ['OSL-3.0']},
+ 'PHP-3.01': {'spdx': ['PHP-3.01']},
+ 'Python2.0': {'spdx': ['Python-2.0']},
+ 'QPL': {'spdx': ['QPL-1.0']},
+ 'RPSL': {'spdx': ['RPSL-1.0']},
+ 'Ruby': {'spdx': ['Ruby']},
+ 'SGIFreeB': {'spdx': ['SGI-B-2.0']},
+ 'SILOFL': {'spdx': ['OFL-1.1']},
+ 'SPL': {'spdx': ['SPL-1.0']},
+ 'StandardMLofNJ': {'spdx': ['SMLNJ']},
+ 'Unlicense': {'spdx': ['Unlicense']},
+ 'UPL': {'spdx': ['UPL-1.0']},
+ 'Vim': {'spdx': ['Vim']},
+ 'W3C': {'spdx': ['W3C']},
+ 'Watcom': {'spdx': ['Watcom-1.0']},
+ 'WTFPL': {'spdx': ['WTFPL']},
+ 'X11License': {'spdx': ['X11']},
+ 'XFree861.1License': {'spdx': ['XFree86-1.1']},
+ 'xinetd': {'spdx': ['xinetd']},
+ 'Yahoo': {'spdx': ['YPL-1.1']},
+ 'Zend': {'spdx': ['Zend-2.0']},
+ 'Zimbra': {'spdx': ['Zimbra-1.3']},
+ 'ZLib': {'spdx': ['Zlib']},
+ 'Zope2.0': {'spdx': ['ZPL-2.0']},
+ 'Zope2.1': {'spdx': ['ZPL-2.1']},
}
with open(license_path, 'w') as f:
json.dump(obj=license, fp=f, indent=2, sort_keys=True)
f.write('\n')
- for scheme, identifier in license.get('identifiers', {}).items():
+ for scheme, identifiers in license.get('identifiers', {}).items():
scheme_dir = os.path.join(dir, scheme)
os.makedirs(scheme_dir, exist_ok=True)
- id_path = os.path.join(scheme_dir, '{}.json'.format(identifier))
- os.link(license_path, id_path)
+ if isinstance(identifiers, str):
+ identifiers = [identifiers]
+ for identifier in identifiers:
+ id_path = os.path.join(scheme_dir, '{}.json'.format(identifier))
+ os.link(license_path, id_path)
with open(os.path.join(dir, 'licenses-full.json'), 'w') as f:
json.dump(obj=full_index, fp=f, indent=2, sort_keys=True)
f.write('\n')