{ "info": { "author": "Erick Daniszewski", "author_email": "edaniszewski@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Utilities" ], "description": "# cmpy\n[![License](https://pypip.in/license/cmpy/badge.svg)](https://pypi.python.org/pypi/cmpy/)\n[![Latest Version](https://pypip.in/version/cmpy/badge.svg)](https://pypi.python.org/pypi/cmpy/)\n[![Downloads](https://pypip.in/download/cmpy/badge.svg)](https://pypi.python.org/pypi/cmpy/)\n\nA simple utility for detecting differences in directories and files.\n\n### Installation\n\nYou can get cmpy with pip:\n\n```\npip install cmpy\n```\n\n### Overview\n\nComparison of files and directories in `cmpy` is handled with the `FCompare` and `DCompare` classes, respectively. Files\ncan also be compared using the static `shallow_fcmp()` and `deep_fcmp()` methods. As the names suggest, the former performs \na shallow comparison (less strict comparison, faster and less resource intensive), while the latter performs a deep comparison\n(strict comparison, slower, more resource intensive). \n\nFor additional information on the comparison methods and classes, see the docstring in `cmpy.py`.\n\n### Usage\n\n#### Comparing Files\n\n```python\n# Instantiate a file compare object between to files\nf = FCompare('foo/bar', 'bar/foo')\n\n# Compare the files (returns True or False)\nf.compare()\n```\n\nOptional arguments may be provided\n\n```python\n# Perform a shallow comparison (default behavior)\nf = FCompare('foo/bar', 'bar/foo', shallow=True)\n\n# Perform a deep comparison\nf = FCompare('foo/bar', 'bar/foo', shallow=False)\n\n# Change the default buffer size (for deep comparison). Default is 2**10 bytes\nf = FCompare('foo/bar', 'bar/foo', buffer_size=2**8)\n```\n\nFiles can also be compared without instantiating an object\n\n```python\n# Shallow comparison\nshallow_fcmp('foo/bar', 'bar/foo')\n\n# Deep comparison\ndeep_fcmp('foo/bar', 'bar/foo')\n\n# Deep comparison specifying buffer size\ndeep_fcmp('foo/bar', 'bar/foo', 2**8)\n```\n\n#### Comparing Directories:\n\n```python\n# Instantiate a directory compare object between to directories\nd = DCompare('foo/bar/', 'bar/foo/')\n\n# Compare the directories (returns True or False)\nd.compare()\n```\n\nOptional arguments may be provided\n\n```python\n# Perform a shallow comparison (default behavior)\nd = DCompare('foo/bar/', 'bar/foo/', shallow=True)\n\n# Perform a deep comparison\nd = DCompare('foo/bar/', 'bar/foo/', shallow=False)\n\n# Change the default buffer size (for deep comparison). Default is 2**10 bytes\nd = DCompare('foo/bar/', 'bar/foo/', buffer_size=2**8)\n\n# Perform a comparison non-recursively \nd = DCompare('foo/bar/', 'bar/foo/', recursive=False)\n\n# Perform a comparison recursively (default behavior)\nd = DCompare('foo/bar/', 'bar/foo/', recursive=True)\n```\n\nThe `DCompare` class has various properties on it\n\n```python\nd = DCompare('foo/bar/', 'bar/foo/')\n\n# The names of files in the first directory\nd.dir1_files\n\n# The names of directories in the first directory\nd.dir1_directories\n\n# The names of the entries in the first directory\nd.dir1_contents\n\n# The names of files in the second directory\nd.dir2_files\n\n# The names of directories in the second directory\nd.dir2_directories\n\n# The names of the entries in the second directory\nd.dir2_contents\n\n# The names of the entries in the first directory which are not in the second directory\nd.dir1_unique\n\n# The names of the entries in the second directory which are not in the first directory\nd.dir2_unique\n\n# The names of the entries found in both directories\nd.common\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/edaniszewski/cmpy/releases/tag/0.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/edaniszewski/cmpy", "keywords": "file compare,directory compare,compare,comparison", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "cmpy", "package_url": "https://pypi.org/project/cmpy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cmpy/", "project_urls": { "Download": "https://github.com/edaniszewski/cmpy/releases/tag/0.2", "Homepage": "https://github.com/edaniszewski/cmpy" }, "release_url": "https://pypi.org/project/cmpy/0.2/", "requires_dist": null, "requires_python": null, "summary": "A simple utility for detecting differences in directories and files.", "version": "0.2" }, "last_serial": 1554165, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "da46ea5b23cf5bff6795a6e245a629c2", "sha256": "b6448b71280fe710e34e1c0da3a865b97136d5b74118526f669f4cd4e897984d" }, "downloads": -1, "filename": "cmpy-0.1.tar.gz", "has_sig": false, "md5_digest": "da46ea5b23cf5bff6795a6e245a629c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3333, "upload_time": "2015-05-15T02:10:45", "url": "https://files.pythonhosted.org/packages/e4/1d/c6fb07d7559fe2d217b118377d09f37db4b5cd7266ad9c1a100945c300b4/cmpy-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b6ec65310661bc707a0e90c9cbc4cbc7", "sha256": "ba2e0f218bd748855eb3121d5d45a25ea1b34f06980cceae80cbc6d3b99967be" }, "downloads": -1, "filename": "cmpy-0.2.tar.gz", "has_sig": false, "md5_digest": "b6ec65310661bc707a0e90c9cbc4cbc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4749, "upload_time": "2015-05-17T13:06:41", "url": "https://files.pythonhosted.org/packages/58/11/29854680c85211fc1e813bc94dbedb32a9806dff94ae21577320d42df1d9/cmpy-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6ec65310661bc707a0e90c9cbc4cbc7", "sha256": "ba2e0f218bd748855eb3121d5d45a25ea1b34f06980cceae80cbc6d3b99967be" }, "downloads": -1, "filename": "cmpy-0.2.tar.gz", "has_sig": false, "md5_digest": "b6ec65310661bc707a0e90c9cbc4cbc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4749, "upload_time": "2015-05-17T13:06:41", "url": "https://files.pythonhosted.org/packages/58/11/29854680c85211fc1e813bc94dbedb32a9806dff94ae21577320d42df1d9/cmpy-0.2.tar.gz" } ] }