diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | README.txt | 7 | ||||
-rwxr-xr-x | json_diff.py | 6 | ||||
-rw-r--r-- | setup.py | 29 |
5 files changed, 42 insertions, 3 deletions
@@ -1,2 +1,4 @@ *.pyc *~ +dist/ +MANIFEST diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..4c67ad3 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include test *.html *.json diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..6b60584 --- /dev/null +++ b/README.txt @@ -0,0 +1,7 @@ +Compares two JSON files (http://json.org) and generates a new JSON file
+with the result. Allows exclusion of some keys from the comparison, or
+in other way to include only some keys.
+
+The development repository is at https://gitorious.org/json_diff/mainline
+
+Released under MIT/X11 license.
diff --git a/json_diff.py b/json_diff.py index 978b0de..8cda9fd 100755 --- a/json_diff.py +++ b/json_diff.py @@ -317,12 +317,12 @@ if __name__ == "__main__": if len(args) != 2: parser.error("Script requires two positional arguments, names for old and new JSON file.") - diff = Comparator(file(args[0]), file(args[1]), options.include, options.exclude) + diff = Comparator(open(args[0]), open(args[1]), options.include, options.exclude) if options.HTMLoutput: diff_res = diff.compare_dicts() # logging.debug("diff_res:\n%s", json.dumps(diff_res, indent=True)) print(HTMLFormatter(diff_res)) else: - outs = json.dumps(diff.compare_dicts(), indent=4, ensure_ascii=False).encode("utf-8") + outs = json.dumps(diff.compare_dicts(), indent=4, ensure_ascii=False) outs = "\n".join([line for line in outs.split("\n")]) - print(outs) + print(outs.encode("utf-8")) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..7f3e86c --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from distutils.core import setup + +setup( + name = 'json_diff', + version = '0.9.1', + description = 'Generates diff between two JSON files', + author = 'Matěj Cepl', + author_email = 'mcepl@redhat.com', + url = 'https://gitorious.org/json_diff/mainline', + download_url = "http://mcepl.fedorapeople.org/scripts/json_diff-0.9.1.tar.gz", + py_modules = ['json_diff', 'test_json_diff', 'test_strings'], + package_data = ['test/*'], + long_description = """Compares two JSON files (http://json.org) and +generates a new JSON file with the result. Allows exclusion of some +keys from the comparison, or in other way to include only some keys.""", + keywords = ['json', 'diff'], + classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Text Processing :: General", + ] +) |