{"id":15703966,"url":"https://github.com/lf-/splice_graft","last_synced_at":"2025-05-12T16:30:23.374Z","repository":{"id":89739751,"uuid":"271979688","full_name":"lf-/splice_graft","owner":"lf-","description":"GitHub API multitool","archived":false,"fork":false,"pushed_at":"2022-04-12T00:26:19.000Z","size":22,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-26T13:21:29.319Z","etag":null,"topics":["github-api-v4","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lf-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-13T09:37:04.000Z","updated_at":"2022-04-12T01:29:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcafd247-e586-4c16-b2ba-26e18bbba7e8","html_url":"https://github.com/lf-/splice_graft","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"9fe6af813697e11a9525352237d724b60ecfb76d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-%2Fsplice_graft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-%2Fsplice_graft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-%2Fsplice_graft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-%2Fsplice_graft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lf-","download_url":"https://codeload.github.com/lf-/splice_graft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165525,"owners_count":20246721,"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":["github-api-v4","python"],"created_at":"2024-10-03T20:09:28.145Z","updated_at":"2025-03-12T05:30:33.595Z","avatar_url":"https://github.com/lf-.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# splice graft 🌿\n\nThis is a tool to do various operations on the GitHub API.\n\n## Usage\n\n### Installation\n\nYou can install for usage with `pip install --user https://github.com/lf-/splice_graft/archive/refs/heads/main.zip`\n\nor for development with `pip install --user -e .` in a clone of the repository.\n\n### Supported operations\n\n```\n» python splice_graft.py --help\nusage: splice_graft.py [-h] {list,find_pr,set} ...\n\npositional arguments:\n  {list,find_pr,set}\n    list                List non-archived repositories with the `master` default branch\n    find_pr             Finds a pull request touching the specified files\n    set                 Sets some attributes on a set of repositories (from stdin)\n\noptions:\n  -h, --help            show this help message and exit\n```\n\n### Finding a PR touching some file\n\n```\n# find any open PR touching both filename1 and filename2\n» splice-graft find_pr owner/repo filename1 filename2\n\n# find a closed or merged PR touching filename1\n» splice-graft find_pr -s closed -s merged owner/repo filename1\n\n# find a closed or merged PR touching anything under blah/\n» splice-graft find_pr -s closed -s merged -m re gankra/gankra.github.io '^blah/.*'\n\n# find a PR of any status touching anything under blah/\n» splice-graft find_pr -s any -m re gankra/gankra.github.io '^blah/.*'\n```\n\n### Renaming branches\n\nThis tool helps you change the default branch on a bunch of GitHub repos to\n`main` or another name. It creates a new branch using the GitHub API and sets\nthe default branch to it. This tool does not change your client side git\nconfigs and branches, which need to be updated with `git branch -m main` and\n`git branch -u origin/main` on your clones.\n\n```bash\n$ # Grab an access token with scope 'repos' for your GitHub user account at https://github.com/settings/tokens\n$ export GH_ACCESS_TOKEN='abcdef'\n$ ./splice_graft.py list \u003e repos.txt\n$ # Now, go through the repository list and remove any that you don't want to use\n$ ./splice_graft.py fix \u003c repos.txt\n```\n\n## Project information\n\nThis project is licensed under the MIT License. Everyone is expected to follow\nthe Contributor Covenant code of conduct while participating in this project.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flf-%2Fsplice_graft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flf-%2Fsplice_graft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flf-%2Fsplice_graft/lists"}