Skip to main content

Description

PyPI version PyPI downloads GitHub license

sar is a simple search and replace script that outputs a valid diff file for review and later apply with patch.

Installation

$ pip install sar-tool

Usage

$ sar unified_diff megasuper_diff sar.py

Searching for 'unified_diff' and replacing to 'megasuper_diff'

Processing file sar.py ... MATCH FOUND
Index: sar.py
================================================================================
--- sar.py (original)
+++ sar.py (modified)
@@ -88,7 +88,7 @@
             debug("MATCH FOUND\n")
             print "Index:", filename
             print "=" * 80
-            diff = ''.join(list(difflib.unified_diff(orig.splitlines(1),
+            diff = ''.join(list(difflib.megasuper_diff(orig.splitlines(1),
                                                      res.splitlines(1),
                                                      filename + " (original)",
                                                      filename + " (modified)")))

Licence

This script is released under the MIT licence

Metadata

Release files for sar-tool 1.0.3

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

Source distribution (sdist)

Source distribution for sar-tool 1.0.3
File Size Uploaded Provenance Actions
sar-tool-1.0.3.tar.gz 3.6 kB Without provenance Details for sar-tool-1.0.3.tar.gz

Release files / sar-tool-1.0.3.tar.gz

Download URL sar-tool-1.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7dc83efe9e619af3c6b39e1882414039b8042a698e92e138b43d75da3610bd12
BLAKE2b-256 checksum
How to use checksums
382894cb0fd400d99934f93c6d2fcf7e05cec5b3a86fa7ec3f478de98a31cee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sar-tool 1.0.3

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.

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