## Endpoints
-You can pull the set of identifiers from [https://wking.github.io/fsf-api/licenses.json](https://wking.github.io/fsf-api/licenses.json).
+<a name="licenses.json"></a>
+You can pull an array of identifiers from [https://wking.github.io/fsf-api/licenses.json](https://wking.github.io/fsf-api/licenses.json).
+
+<a name="licenses-full.json"></a>
+You can pull an object with all the license data [https://wking.github.io/fsf-api/licenses-full.json](https://wking.github.io/fsf-api/licenses-full.json).
You can pull an individual license from a few places:
-* Using their FSF ID:
+* <a name="by-fsf-id"></a>
+ Using their FSF ID:
https://wking.github.io/fsf-api/{id}.json
For example [https://wking.github.io/fsf-api/Expat.json](https://wking.github.io/fsf-api/Expat.json).
-* Using a non-FSF ID, according to the mapping between other scheme and the FSF scheme asserted by this API:
+* <a name="by-non-fsf-id"></a>
+ Using a non-FSF ID, according to the mapping between other scheme and the FSF scheme asserted by this API:
https://wking.github.io/fsf-api/{scheme}/{id}.json
with open(os.path.join(dir, 'licenses.json'), 'w') as f:
json.dump(obj=index, fp=f, indent=2)
f.write('\n')
+ full_index = {}
for id, license in licenses.items():
license = license.copy()
if 'tags' in license:
license['tags'] = sorted(license['tags'])
+ full_index[id] = license
license_path = os.path.join(dir, '{}.json'.format(id))
with open(license_path, 'w') as f:
json.dump(obj=license, fp=f, indent=2, sort_keys=True)
os.makedirs(scheme_dir, exist_ok=True)
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')
if __name__ == '__main__':