* FSF ID: a short slug identifying the license.
* `name`: a short string naming the license.
-* `uri`: the FSF's recommendend URI for the license.
+* `uris`: an array of URIs for the license.
+ The first entry in this array will always be an entry on the [the FSF's HTML page][fsf-list].
+ The order of the remaining entries is not significant.
* `tags`: an array of FSF categories for the license.
The FSF currently defines the following categories:
license['name'] = a.text.strip()
else:
continue
+ uris = ['{}#{}'.format(base_uri, oid)]
uri = a.attrib.get('href')
if uri:
if base_uri:
- uri = urllib.parse.urljoin(base=base_uri, url=uri)
- license['uri'] = uri
+ uris.append(urllib.parse.urljoin(base=base_uri, url=uri))
+ license['uris'] = uris
identifiers = IDENTIFIERS.get(id)
if identifiers:
license['identifiers'] = identifiers
licenses[id] = license
else:
licenses[id]['tags'].update(tags)
+ for uri in uris:
+ if uri not in licenses[id]['uris']:
+ licenses[id]['uris'].append(uri)
unused_splits = set(SPLITS.keys()).difference(oids)
if unused_splits:
raise ValueError('unused SPLITS keys: {}'.format(