{"id":16916696,"url":"https://github.com/konstin/github-wikidata-bot","last_synced_at":"2025-05-08T23:48:55.172Z","repository":{"id":45200007,"uuid":"76398571","full_name":"konstin/github-wikidata-bot","owner":"konstin","description":"Updates Wikidata entries using metadata from github","archived":false,"fork":false,"pushed_at":"2025-03-28T18:42:03.000Z","size":639,"stargazers_count":44,"open_issues_count":27,"forks_count":10,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-08T23:48:49.484Z","etag":null,"topics":["bot","github-api","wikidata","wikidata-bot"],"latest_commit_sha":null,"homepage":"https://www.wikidata.org/wiki/User:Github-wiki-bot","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konstin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-13T21:09:38.000Z","updated_at":"2025-03-28T18:42:07.000Z","dependencies_parsed_at":"2024-03-19T00:24:21.701Z","dependency_job_id":"937f2ae2-6382-4633-86a6-a8d7a66c62d6","html_url":"https://github.com/konstin/github-wikidata-bot","commit_stats":{"total_commits":344,"total_committers":8,"mean_commits":43.0,"dds":"0.40116279069767447","last_synced_commit":"390f1323a684cd35437e0e142743af5d68084b2a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstin%2Fgithub-wikidata-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstin%2Fgithub-wikidata-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstin%2Fgithub-wikidata-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konstin%2Fgithub-wikidata-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konstin","download_url":"https://codeload.github.com/konstin/github-wikidata-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166479,"owners_count":21864467,"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":["bot","github-api","wikidata","wikidata-bot"],"created_at":"2024-10-13T19:29:26.024Z","updated_at":"2025-05-08T23:48:55.150Z","avatar_url":"https://github.com/konstin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub to Wikidata bot\n\n![Tests](https://github.com/konstin/github-wikidata-bot/workflows/Tests/badge.svg)\n\nUpdate Wikidata entries using metadata from GitHub.\n\nFor free software projects with a GitHub repository listed in Wikidata,\nthis script will perform the following steps,\nusing metadata collected from the GitHub API:\n\n- Import all stable releases and the release dates, including release data, source, and a source title\n- Update the project website\n- Normalize the GitHub link\n\nIt is possible to [exclude items](https://www.wikidata.org/wiki/User:Github-wiki-bot/Exceptions) from being edited by the bot, and also to [allow using tags](https://www.wikidata.org/w/index.php?title=User:Github-wiki-bot/Whitelist) for projects without GitHub releases.\n\n## Setup and usage\n\nFirst install python 3.12 and [poetry][poetry], then run `poetry install`.\n\n[Generate a personal access token on GitHub][github-token]. Create a `config.json` file with that token and your Wikidata username:\n\n```json\n{\n  \"username\": \"my-wikidata-username\",\n  \"github-oauth-token\": \"abcdedf1234567\"\n}\n```\n\nThen run `main.py` in a terminal and enter the password for your bot account.\n\nRun `pytest`, `ruff format` and `ruff check` after making code changes.\n\n## Implementation notes\n\nFirst, a SPARQL query gathers all the free software projects in Wikidata which have a GitHub repository specified in the [source code repository][repo-property] property. For each entry, a cached request to the GitHub API is made, which is authenticated by the OAuth key. The wikidata entries are then inserted using a \"exists or insert\" logic. For each entry, the GitHub api link is added as reference.\n\n## Why does the bot not work for item Q…?\n\n- Does the entity already have a VCS repository set? Use [this query][no-repo-query]\n  to determine entities without a repository.\n\n## Statistics\n\nYou can find detailed statistics on [wmflabs][wmflabs].\n\n[poetry]: https://github.com/sdispater/poetry\n[github-token]: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/\n[repo-property]: https://www.wikidata.org/wiki/Property:P1324\n[no-repo-query]: https://github.com/konstin/github-wikidata-bot/blob/main/src/free_software_without_repository.rq\n[wmflabs]: https://xtools.wmflabs.org/ec/wikidata/Github-wiki-bot\n[logs]: https://gist.github.com/konstin/9b90ae895ad9a270102415474a56e613\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstin%2Fgithub-wikidata-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonstin%2Fgithub-wikidata-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstin%2Fgithub-wikidata-bot/lists"}