From 9d6224a810b00a0f41b076e182091e1e57df62f6 Mon Sep 17 00:00:00 2001 From: Nicolas Roeser Date: Sat, 8 Jul 2023 15:43:00 +0200 Subject: [PATCH 1/2] Add script to make updating Trove data easier Intended to assist humans in the process of integrating new Trove license identifiers. --- licenses/trove/update.py | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 licenses/trove/update.py 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() From 7d469d9c51e500c8b32b4508babf4b7e084ba5b3 Mon Sep 17 00:00:00 2001 From: Nicolas Roeser Date: Sat, 8 Jul 2023 17:15:23 +0200 Subject: [PATCH 2/2] Add Trove identifiers for licenses in this repo Update the Trove identifiers list to include the identifiers for all licenses which are already included in some way in the OSI data in this repository. (The Trove input document has more licenses.) --- licenses/trove/trove.json | 99 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) 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": [