{"id":34077617,"url":"https://github.com/essembeh/properties-tools","last_synced_at":"2026-04-05T11:32:08.489Z","repository":{"id":57105830,"uuid":"444216027","full_name":"essembeh/properties-tools","owner":"essembeh","description":"Command line tool to compare *properties* files and print differences with colors as if you were using `diff` or `colordiff` tools.","archived":false,"fork":false,"pushed_at":"2022-11-15T22:27:26.000Z","size":485,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T09:33:57.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/essembeh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-03T22:24:21.000Z","updated_at":"2024-05-31T12:55:01.000Z","dependencies_parsed_at":"2023-01-22T07:02:38.260Z","dependency_job_id":null,"html_url":"https://github.com/essembeh/properties-tools","commit_stats":null,"previous_names":["essembeh/properties-diff"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/essembeh/properties-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essembeh%2Fproperties-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essembeh%2Fproperties-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essembeh%2Fproperties-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essembeh%2Fproperties-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/essembeh","download_url":"https://codeload.github.com/essembeh/properties-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essembeh%2Fproperties-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31434624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-14T10:32:59.233Z","updated_at":"2026-04-05T11:32:08.481Z","avatar_url":"https://github.com/essembeh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Github](https://img.shields.io/github/tag/essembeh/properties-diff.svg)\n![PyPi](https://img.shields.io/pypi/v/properties-tools.svg)\n![Python](https://img.shields.io/pypi/pyversions/properties-tools.svg)\n![CI](https://github.com/essembeh/properties-tools/actions/workflows/poetry.yml/badge.svg)\n\n\n# properties-tools\n\n**properties-tools** is a collection of command line tools to work with *properties* files: comparing like `wdiff`, updating like `patch`... \n\nThe idea is to work with the *content* (`key/value` pairs) instead of the *text*, to ignore order or format and deal with the data.\n\n\n* [`properties-diff`](#properties-diff) can compare and print differences between 2 *properties* files, with fancy colors as if you were using `wdiff` or `diff` tools. It does not compare the *text* files.\n* [`properties-patch`](#properties-patch) can update a *properties* file using values from others, you can choose to *add* new keys and/or *update* existing and/or *remove* others.\n\n\n\n# Install\n\nInstall the latest release from [PyPI](https://pypi.org/project/properties-tools/)\n```sh\n$ pip3 install properties-diff\n$ properties-diff --help\n```\n\nInstall from the sources\n```sh\n$ pip3 install poetry\n$ pip3 install git+https://github.com/essembeh/properties-tools\n$ properties-diff --help\n```\n\n\n# properties-diff\n\n\n## Usage\n\n```sh\n$ properties-diff --help \nusage: properties-diff [-h] [--version] [-q] [--quote] [--color | --nocolor] [--sep SEP] [-m {simple,diff,wdiff} | --diff | --wdiff | --simple] [-A] [-D] [-U] left.properties right.properties\n\npositional arguments:\n  left.properties       left file to compare\n  right.properties      right file to compare\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -q, --quiet           print less information\n  --quote               use double quotes for values, example: foo=\"bar\"\n  --color               force colors\n  --nocolor             disable colors\n  --sep SEP             key/value separator, default is '='\n  -m {simple,diff,wdiff}, --mode {simple,diff,wdiff}\n                        select a format to show differences: using colors only (simple), using diff-like format (diff) or wdiff-like (wdiff) format. Default is 'wdiff'\n  --diff                use diff-like format to show differences\n  --wdiff               use wdiff-like format to show differences\n  --simple              use simple format to show differences\n  -A, --added           print added properties\n  -D, --deleted         print deleted properties\n  -U, --updated         print updated properties\n```\n\n\n## Examples\n\nComparing *properties* files like `wdiff`\n```sh\n$ properties-diff tests/sample1.properties tests/sample2.properties\n--- tests/sample1.properties (left)    2022-04-07 12:48:44\n+++ tests/sample2.properties (right)    2022-04-07 12:49:02\n# Only in tests/sample1.properties (left)\n[-database.host=localhost-]\n# Only in tests/sample2.properties (right)\n{+database.version=12+}\n# Updated from tests/sample1.properties (left) to tests/sample2.properties (right)\ndatabase.type=[-postgresql-]{+mysql+}\ndatabase.user=[-test-]{+dbuser+}\n```\n\nComparing *properties* files like `diff`\n```sh\n$ properties-diff tests/sample1.properties tests/sample2.properties --diff\n--- tests/sample1.properties (left)    2022-04-07 12:48:44\n+++ tests/sample2.properties (right)    2022-04-07 12:49:02\n# Only in tests/sample1.properties (left)\n- database.host=localhost\n# Only in tests/sample2.properties (right)\n+ database.version=12\n# Updated from tests/sample1.properties (left) to tests/sample2.properties (right)\n- database.type=postgresql\n+ database.type=mysql\n- database.user=test\n+ database.user=dbuser\n```\n\nCompare files, but only show `updateed` and `added` values\n```sh\n$ properties-diff tests/sample1.properties tests/sample2.properties --add --update\n--- tests/sample1.properties (left)    2022-04-07 12:48:44\n+++ tests/sample2.properties (right)    2022-04-07 12:49:02\n# Only in tests/sample2.properties (right)\n{+database.version=12+}\n# Updated from tests/sample1.properties (left) to tests/sample2.properties (right)\ndatabase.type=[-postgresql-]{+mysql+}\ndatabase.user=[-test-]{+dbuser+}\n```\n\n\n## Viewing modes\n\nYou can see *differences* between the *properties* files using 3 modes using `--mode \u003cMODE\u003e` or `-m \u003cMODE\u003e`\n* `wdiff`, prints the changes like `wdiff` tool would do (this is the default mode)\n* `diff`, prints the changes like `diff` tool would do\n* `simple`, based on colors, *red* for removed lines, *green* for added lines\n\n![wdiff](images/wdiff.png)\n![diff](images/diff.png)\n![simple](images/simple.png)\n\n\n\n\n# properties-patch\n\n\n## Usage\n\n```sh\n$ properties-patch --help                                                                       \nusage: properties-patch [-h] [--version] [--color | --nocolor] [-c] [-i] [--quote] [--sep SEP] [-A] [-D] [-U] -p patch.properties [-o output.properties | -w] [-f] source.properties\n\npositional arguments:\n  source.properties     file to modify\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --color               force colors\n  --nocolor             disable colors\n  -c, --comments        insert comment when property is added, updated or deleted\n  -i, --interactive     ask for confirmation to add, update or delete a property\n  --quote               use double quotes for values, example: foo=\"bar\"\n  --sep SEP             key/value separator, default is '='\n  -p patch.properties, --patch patch.properties\n                        patch file\n  -o output.properties, --output output.properties\n                        modified file\n  -w, --overwrite       update input properties file in place\n  -f, --force           force output file (--output) overwrite if it already exists\n\n  -A, --add             add new properties from patches\n  -D, --delete          delete properties not in patches\n  -U, --update          update properties from patches\n```\n\n\n## Examples\n\nBuild a properties file from `tests/sample1.properties` and add missing keys from  `tests/sample2.properties` \n```sh\n$ properties-patch tests/sample1.properties --patch tests/sample2.properties --add     \n# just a comment\ndatabase.type=postgresql\ndatabase.host=localhost\ndatabase.port=5432\n# and another comment\ndatabase.user=test\ndatabase.password=foobar\ndatabase.version=12\n```\n\nYou can use multiple *patch* files, if a value is present in multiple *patch* files, the latest value will be used. \n```sh\n$ properties-patch tests/sample1.properties --patch tests/sample2.properties --patch tests/sample3.properties -A    \n# just a comment\ndatabase.type=postgresql\ndatabase.host=localhost\ndatabase.port=5432\n# and another comment\ndatabase.user=test\ndatabase.password=foobar\ndatabase.version=42\n```\n\nYou can choose to *add* missing values and *update* values that are different in the *patch* files\n```sh\n$ properties-patch tests/sample1.properties --patch tests/sample2.properties -AU\n# just a comment\ndatabase.type=mysql\ndatabase.host=localhost\ndatabase.port=5432\n# and another comment\ndatabase.user=dbuser\ndatabase.password=foobar\ndatabase.version=12\n```\n\nThere is an *interactive* mode, which ask for confirmation before every change (usefull to take only some changes, equivalent to `git add --interactive`)\n```sh\n$ properties-patch tests/sample1.properties --patch tests/sample2.properties -AU --interactive\n# just a comment\n💬  Update database.type=postgresql,mysql ? [Y/n] \ndatabase.type=mysql\ndatabase.host=localhost\ndatabase.port=5432\n# and another comment\n💬  Update database.user=test,dbuser ? [Y/n] \ndatabase.user=dbuser\ndatabase.password=foobar\n💬  Add database.version=12 ? [Y/n] \ndatabase.version=12\n```\n\nTo track changes, you can add comments for every change applied\n```sh\n$ properties-patch tests/sample1.properties --patch tests/sample2.properties -ADU --comments\n# just a comment\n# 2022-04-07 23:12:11  update: database.type=postgresql\ndatabase.type=mysql\n# 2022-04-07 23:12:11  remove: database.host=localhost\ndatabase.port=5432\n# and another comment\n# 2022-04-07 23:12:11  update: database.user=test\ndatabase.user=dbuser\ndatabase.password=foobar\n# 2022-04-07 23:12:11  add: database.version\ndatabase.version=12\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessembeh%2Fproperties-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fessembeh%2Fproperties-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessembeh%2Fproperties-tools/lists"}