项目作者: kobaltcore

项目描述 :
A pure-python diffing utility using Google's diff-match-patch.
高级语言: Python
项目地址: git://github.com/kobaltcore/diffusor.git
创建时间: 2020-06-06T23:01:50Z
项目社区:https://github.com/kobaltcore/diffusor

开源协议:MIT License

下载


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:

  1. $ 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:

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

To apply a diff:

  1. diffusor apply <patch_file> -t <target_file>

Command Line Interface

  1. Usage: diffusor.py [OPTIONS] COMMAND [ARGS]...
  2. A pure-python diffing utility using Google's diff-match-patch.
  3. This tool serves exactly two functions:
  4. 1. Create diffs between two versions of the same file
  5. 2. Apply diffs to a file
  6. Commands can be abbreviated by the shortest unique string.
  7. For example:
  8. diff -> d
  9. apply -> a
  10. Examples of full commands:
  11. diffusor diff <source_file> <modified_file> -n <target_file>
  12. diffusor apply <patch_file> -t <target_file>
  13. Options:
  14. -d, --debug / -nd, --no-debug Print debug information or only regular
  15. output
  16. --help Show this message and exit.
  17. Commands:
  18. apply
  19. diff