GithubHelp home page GithubHelp logo

kobaltcore / diffusor Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 63 KB

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

License: MIT License

Python 100.00%
python python3 diff-match-patch diffing git patch diff

diffusor's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.