{"id":18730210,"url":"https://github.com/peter17/pywdcollections","last_synced_at":"2025-11-12T09:30:11.109Z","repository":{"id":43869294,"uuid":"227931925","full_name":"peter17/pyWDcollections","owner":"peter17","description":"A bot framework based on pyWikiBot to harvest Wikipedia templates to Wikidata","archived":false,"fork":false,"pushed_at":"2024-10-20T16:36:35.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T14:43:43.906Z","etag":null,"topics":["pywikibot","sparql-query-builder","wikidata-bot","wikipedia"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peter17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-13T22:24:59.000Z","updated_at":"2024-10-20T16:36:39.000Z","dependencies_parsed_at":"2024-02-18T18:29:04.113Z","dependency_job_id":"ebceef97-80c4-4f74-8b70-dc13b41abf08","html_url":"https://github.com/peter17/pyWDcollections","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter17%2FpyWDcollections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter17%2FpyWDcollections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter17%2FpyWDcollections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter17%2FpyWDcollections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter17","download_url":"https://codeload.github.com/peter17/pyWDcollections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599028,"owners_count":19665911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pywikibot","sparql-query-builder","wikidata-bot","wikipedia"],"created_at":"2024-11-07T14:38:35.262Z","updated_at":"2025-11-12T09:30:11.046Z","avatar_url":"https://github.com/peter17.png","language":"Python","readme":"A Python framework based on pyWikibot to harvest Wikipedia templates to Wikidata.\n\n# Usage example\n\nThis harvests properties Commonscat (P373), image (P18) and administrative location (P131) from the English Wikipedia templates \"Commonscat\" and \"Infobox cemetery\".\n\nRunning this will create a local SQLite database, download all cemeteries items from Wikidata and for the items that miss at least one of those three properties, it will scan all English Wikipedia articles related to the items to search for those properties in those templates.\n\n    #!/usr/bin/env python3\n    # -*- coding: utf-8 -*-\n\n    import os\n    import pywdcollections as PYWDC\n\n    path = os.path.dirname(os.path.realpath(__file__))\n\n    class Cemeteries(PYWDC.Collection):\n        def __init__(self, pywb):\n            self.db = PYWDC.Database(path + '/cemeteries.db')\n            self.name = 'cemeteries'\n            self.commit_frequency = 10000\n            self.main_type = 39614 # cemetery\n            self.properties = [18, 131, 373]\n            self.languages = ['en']\n            self.templates = {\n                'enwiki': {\n                    'Commonscat': 373,\n                    'Infobox cemetery': {\n                        'image': 18,\n                        'location': 131,\n                    },\n                },\n        }\n        super().__init__(pywb)\n\n    if __name__ == '__main__':\n        pywb = PYWDC.PYWB('\u003cYOUR_BOT_NAME\u003e', 'en')\n        pywb.wikidata.login()\n        collection = Cemeteries(pywb)\n        collection.fetch()\n        collection.copy_ciwiki_to_declaration()\n        collection.update_outdated_items()\n        collection.harvest_templates()\n        collection.copy_harvested_properties([18, 131, 373])\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter17%2Fpywdcollections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter17%2Fpywdcollections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter17%2Fpywdcollections/lists"}