Skip to main content

A pure-python diffing utility using Google's diff-match-patch.

Project description

Diffusor

CircleCI Downloads

A pure-python diffing utility using Google's diff-match-patch.

This is a utility script for a very specific purpose, namely easy generation and application of diffs for Python-centric projects, programmatically from within Python.

This tool serves exactly two functions:

  1. Create diffs between two versions of the same file
  2. Apply diffs to a file

It works on a per-file basis.

If you don't have a specific use case for this, you're probably better off using Git diffs and the ubiquitous Linux patch tool. Diffusor exists specifically for easing the patch-apply workflow within Python programs, nothing more, nothing less.

Installation

Diffusor can be installed via pip:

$ pip install diffusor

Please note that Diffusor requires Python 3 and will not provide backwards compatibility for Python 2 for the foreseeable future.

Usage

To create a diff:

diffusor diff <source_file> <modified_file> -n <target_file>

To apply a diff:

diffusor apply <patch_file> -t <target_file>

Command Line Interface

Usage: diffusor.py [OPTIONS] COMMAND [ARGS]...

  A pure-python diffing utility using Google's diff-match-patch.

  This tool serves exactly two functions:
  1. Create diffs between two versions of the same file
  2. Apply diffs to a file

  Commands can be abbreviated by the shortest unique string.

  For example:
      diff -> d
      apply -> a

  Examples of full commands:
      diffusor diff <source_file> <modified_file> -n <target_file>
      diffusor apply <patch_file> -t <target_file>

Options:
  -d, --debug / -nd, --no-debug  Print debug information or only regular
                                 output

  --help                         Show this message and exit.

Commands:
  apply
  diff

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffusor-1.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffusor-1.3.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file diffusor-1.3.0.tar.gz.

File metadata

  • Download URL: diffusor-1.3.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.9 Linux/4.15.0-1092-aws

File hashes

Hashes for diffusor-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d78b6a3c379668f225a0827818ec3990506cd48c2e5349ba755dfbf598b8651c
MD5 2de26b39fd81cdeda96dd8ab96ba2a82
BLAKE2b-256 8de791ab505ef55f113377c3aed0028266a52194aabf2464711412bb8a3a639c

See more details on using hashes here.

File details

Details for the file diffusor-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: diffusor-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.9 Linux/4.15.0-1092-aws

File hashes

Hashes for diffusor-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b223f7bfa4107f4f7fbbc949f99b2080834b828eb1e873071e7862fa0645a2f4
MD5 3c66ad8f34e33ec0f8eb4aa655aa42ba
BLAKE2b-256 4d09d6c00866ac92c8559038d0d58eaa8f0335d726e90b68cc4061e08ee88243

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page