Command line tool to compare properties files
Project description
properties-diff
properties-diff
is a command line tools to compare properties files and print differences with colors as if you were using wdiff
or diff
tools.
Even if properties files are text files, using directly diff
is not that efficient because of key/value pairs order or format (for example using =
or [space]=[space]
as separator, double quoting values...). properties-diff
compare key/value pairs but not the order nor the format.
properties-patch
is a command line tools to patch a properties files with one or more properties files to add, update or delete some properties.
Install
Install the latest release from PyPI
$ pip3 install properties-diff
$ properties-diff path/to/file.properties path/to/another/file.properties
Install from the sources
$ pip3 install --user --upgrade git+https://github.com/essembeh/properties-diff
$ properties-diff path/to/file.properties path/to/another/file.properties
Usage
$ properties-diff --help 130
usage: properties-diff [-h] [-q] [--quote] [--sep SEP] [-m {simple,diff,wdiff}] [-A] [-D] [-U] left.properties right.properties
positional arguments:
left.properties left file to compare
right.properties right file to compare
optional arguments:
-h, --help show this help message and exit
-q, --quiet print less information
--quote use double quotes for values, example: foo="bar"
--sep SEP key/value separator, default is '='
-m {simple,diff,wdiff}, --mode {simple,diff,wdiff}
select a format to show differences: using colors only (simple), using diff-like format (diff) or wdiff-like (wdiff) format. Default is 'wdiff'
-A, --added print added properties
-D, --deleted print deleted properties
-U, --updated print updated properties
$ properties-patch --help
usage: properties-patch [-h] [-c] [--comments] [-f] [-i] [--quote] [--sep SEP] [-A] [-D] [-U] -p patch.properties [-o output.properties] source.properties
positional arguments:
source.properties file to modify
optional arguments:
-h, --help show this help message and exit
-c, --color print colors
--comments insert comment when property is added, updated or deleted
-f, --force force output file (--output) overwrite if it already exists
-i, --interactive ask for confirmation to add, update or delete a property
--quote use double quotes for values, example: foo="bar"
--sep SEP key/value separator, default is '='
-p patch.properties, --patch patch.properties
patch file
-o output.properties, --output output.properties
modified file
-A, --add add new properties from patches
-D, --delete delete properties not in patches
-U, --update update properties from patches
properties-diff modes
You can see differences between the properties files using 3 modes using --mode <MODE>
or -m <MODE>
wdiff
, prints the changes likewdiff
tool would do (this is the default mode)diff
, prints the changes likediff
tool would dosimple
, based on colors, red for removed lines, green for added lines
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
Built Distribution
File details
Details for the file properties-diff-0.4.1.tar.gz
.
File metadata
- Download URL: properties-diff-0.4.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57c86a5222b3f760802bec2625b317fa053d18f01b63d4a9c488ad5de38061b4 |
|
MD5 | 033361c9374faccb3881642e598b405b |
|
BLAKE2b-256 | bd32a81504a1b2ecbcd5541edb7e061ab6e34e27911eac5a515a6c6c64ed767e |
File details
Details for the file properties_diff-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: properties_diff-0.4.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fda8e57eba4cac7c86594e753a1b5b9d2f82952d89aa9ad935918d3f1a686b2 |
|
MD5 | bb4c3565696662e71226d51b5c5210eb |
|
BLAKE2b-256 | 89f31dc3e6c12ec6425339b106afcc0368f8668ddf55efdde971c31c8a56fd1d |