#!/usr/bin/env python3 # Copyright (C) 2022 Jonathan A. Poritz # # 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. # # # import csv fh=open('repository-export.csv', 'r') for line in csv.DictReader(fh): if line["dc.type"][:4]=="book": license = line["BITSTREAM License"] if ("creativecommons.org/licenses/by/" in license) or ("creativecommons.org/licenses/by-sa/" in license) or ("creativecommons.org/licenses/by-nc/" in license) or ("creativecommons.org/licenses/by-nc-sa/" in license) or ("creativecommons.org/publicdomain/zero" in license): print(line["dc.date.issued"][:4])