diff --git a/licenses/trove/trove.json b/licenses/trove/trove.json index fc022c1..067fb82 100644 --- a/licenses/trove/trove.json +++ b/licenses/trove/trove.json @@ -53,6 +53,15 @@ } ] }, + { + "id": "BSL-1.0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Boost Software License 1.0 (BSL-1.0)", + "scheme": "Trove" + } + ] + }, { "id": "CECILL-2.1", "identifiers": [ @@ -62,6 +71,15 @@ } ] }, + { + "id": "CDDL-1.0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Common Development and Distribution License 1.0 (CDDL-1.0)", + "scheme": "Trove" + } + ] + }, { "id": "CPL-1.0", "identifiers": [ @@ -71,6 +89,24 @@ } ] }, + { + "id": "EPL-1.0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Eclipse Public License 1.0 (EPL-1.0)", + "scheme": "Trove" + } + ] + }, + { + "id": "EPL-2.0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)", + "scheme": "Trove" + } + ] + }, { "id": "EFL-2.0", "identifiers": [ @@ -89,6 +125,15 @@ } ] }, + { + "id": "EUPL-1.2", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)", + "scheme": "Trove" + } + ] + }, { "id": "AGPL-3.0", "identifiers": [ @@ -152,6 +197,15 @@ } ] }, + { + "id": "HPND", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)", + "scheme": "Trove" + } + ] + }, { "id": "IPL-1.0", "identifiers": [ @@ -197,6 +251,15 @@ } ] }, + { + "id": "MIT-0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: MIT No Attribution License (MIT-0)", + "scheme": "Trove" + } + ] + }, { "id": "CVW", "identifiers": [ @@ -206,6 +269,15 @@ } ] }, + { + "id": "MirOS", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: MirOS License (MirOS)", + "scheme": "Trove" + } + ] + }, { "id": "Motosoto", "identifiers": [ @@ -269,6 +341,24 @@ } ] }, + { + "id": "OSL-3.0", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: Open Software License 3.0 (OSL-3.0)", + "scheme": "Trove" + } + ] + }, + { + "id": "PostgreSQL", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: PostgreSQL License", + "scheme": "Trove" + } + ] + }, { "id": "CNRI-Python", "identifiers": [ @@ -305,6 +395,15 @@ } ] }, + { + "id": "OFL-1.1", + "identifiers": [ + { + "identifier": "License :: OSI Approved :: SIL Open Font License 1.1 (OFL-1.1)", + "scheme": "Trove" + } + ] + }, { "id": "Sleepycat", "identifiers": [ diff --git a/licenses/trove/update.py b/licenses/trove/update.py new file mode 100755 index 0000000..fa02934 --- /dev/null +++ b/licenses/trove/update.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# Script to update the imported Trove license data. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# +# Intended to be run in order to update trove.json with new Trove license +# identifiers, e.g. like this: +# +# ./scrape.py > trove-new.json +# ./update.py > trove-updated.json +# diff -u trove.json trove-updated.json +# +# # Now manually merge content from trove-updated.json into trove.json; +# # _might_ even execute this (at some time in future): +# #mv trove-updates.json trove.json + +import json +from sys import stdout + +def update(): + with open('trove.json', 'r') as fc, open('trove-new.json', 'r') as fn: + trove_cur = json.load(fc) + trove_new = json.load(fn) + + # keep it simple and just assume 1:1 mapping + id_mapping = {} + for lic in trove_cur: + osi_id = lic['id'] + for id_ in lic['identifiers']: + if id_['scheme'] == 'Trove': + trove_id = id_['identifier'] + id_mapping[trove_id] = osi_id + + for lic in trove_new: + for id_ in lic['identifiers']: + if id_['scheme'] == 'Trove': + trove_id = id_['identifier'] + if id_mapping.__contains__(trove_id): + lic['id'] = id_mapping[trove_id] + + json.dump(trove_new, stdout, indent=4, sort_keys=True) + +update()