{"id":19180835,"url":"https://github.com/jingfelix/patche","last_synced_at":"2025-04-07T13:04:57.920Z","repository":{"id":254682127,"uuid":"846924825","full_name":"jingfelix/Patche","owner":"jingfelix","description":"Modern patch, written in Python. 现代化的 Patch 工具。","archived":false,"fork":false,"pushed_at":"2025-03-30T15:17:55.000Z","size":331,"stargazers_count":87,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T12:06:39.091Z","etag":null,"topics":["apply","diff","patch","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/jingfelix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-08-24T10:44:54.000Z","updated_at":"2025-03-30T15:17:59.000Z","dependencies_parsed_at":"2024-11-09T10:51:35.585Z","dependency_job_id":"2ea8ccb0-9fe2-45ad-97ca-b48c1c5bf057","html_url":"https://github.com/jingfelix/Patche","commit_stats":null,"previous_names":["jingfelix/patche"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingfelix%2FPatche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingfelix%2FPatche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingfelix%2FPatche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingfelix%2FPatche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jingfelix","download_url":"https://codeload.github.com/jingfelix/Patche/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657276,"owners_count":20974344,"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":["apply","diff","patch","python"],"created_at":"2024-11-09T10:51:25.516Z","updated_at":"2025-04-07T13:04:57.914Z","avatar_url":"https://github.com/jingfelix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003ePatche\u003c/h1\u003e\n    \u003ch3\u003eModern patch, written in Python.\u003c/h3\u003e\n    \u003cdiv\u003eEnglish | \u003ca href=\"README.zh-CN.md\"\u003e简体中文\u003c/a\u003e\u003c/div\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://pypi.org/project/Patche/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/Patche\" alt=\"PyPI\"\u003e\u003c/a\u003e\n    \u003c!-- \u003ca href=\"https://pypi.org/project/Patche/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/Patche\" alt=\"PyPI - Python Version\"\u003e\u003c/a\u003e --\u003e\n    \u003ca href=\"https://github.com/jingfelix/Patche/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/pypi/l/Patche\" alt=\"PyPI - License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pdm-project.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/pdm-managed-blueviolet\" alt=\"pdm-managed\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## 🔨 Usage\n\nThe following commands are supported:\n\n### ➡️ patche apply\n\nApply a patch to target files.\n\n```shell\npatche apply \u003cpatch-file\u003e\n```\n\nOptions:\n- `-R, --reverse`: Assume patches were created with old and new files swapped\n- `-F, --fuzz LINES`: Set the fuzz factor to LINES for inexact matching\n\n### ↕️ patche show\n\nShow details of a patch file.\n\n```shell\npatche show \u003cpatch-file\u003e\n```\n\n### ⚙️ patche settings\n\nDisplay current configuration.\n\n```shell\npatche settings\n```\n\n## 📚 Examples\n\nHere are some examples of how to use `patche` in different scenarios:\n\n| Usage | Introduction |\n| --- | --- |\n| [MCP Server](docs/mcp.md) | A simple MCP server that offers patch utility for LLMs |\n\n## 🧰 Config\n\n`patche` loads the configuration from a file named `.patche.env` in `$HOME`.\n\n```shell\nmax_diff_lines = 3\n```\n\n## 💻 Development\n\n`patche` uses `pdm` as package manager. To install the dependencies in your workspace, run:\n\n```bash\npdm install --prod\n\n# If you want to trace patche execution\npdm install\n\n# If you want to run tests\npdm run python3 -m unittest tests/test_parse.py\npdm run python3 -m unittest tests/test_apply.py\n```\n\nref: [PDM Documentation](https://pdm-project.org/en/latest/usage/dependency/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingfelix%2Fpatche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingfelix%2Fpatche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingfelix%2Fpatche/lists"}