Skip to main content

### Features

  • Automatic correction of * Linefeeds according to patched file * Diffs broken by stripping trailing whitespace * a/ and b/ prefixes

  • Single file, which is a command line tool and library

  • No dependencies outside Python stdlib

  • Patch format detection (SVN, HG, GIT)

  • Nice diffstat histogram

  • Linux / Windows / OX X

  • Python 2.5+ compatible, 2.6/2.7 tested

  • Test coverage

Things that don’t work out of the box:

  • Python 3

  • File renaming, creation and removal

  • Directory tree operations

  • Version control specific properties

  • Non-unified diff formats

### Usage

Download patch.py and run it with Python. It is a self-contained module without external dependencies.

patch.py diff.patch

You can also run the .zip file.

python patch-1.15.zip diff.patch

### Installation

patch.py is self sufficient. You can copy it into your repository and use it from here. This setup will always be repeatable. But if you need to add patch module as a dependency, make sure to use strict specifiers to avoid hitting an API break:

pip install “patch>=1,<2”

With pip 6.x.x and later it is possible to use the alternative syntax:

pip install “patch==1.*”

### Changes

https://github.com/techtonik/python-patch/blob/master/doc/CHANGES.md

Metadata

Release files for patch 1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patch 1.15
File Size Uploaded Provenance Actions
patch-1.15.zip 11.6 kB Without provenance Details for patch-1.15.zip

Release files / patch-1.15.zip

Download URL patch-1.15.zip
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c9ebda243e569dddf0eb87fd8e9cb1cbc02d63ff63abd4aa2204ace5d5fb833d
BLAKE2b-256 checksum
How to use checksums
e0b8bda6f5f559ad762c1d9b80a1ab5e7414421e390a1c241e944c95c4c0ad29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for patch 1.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.15 This release

1 release file No provenance

1.14

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page