Name | ktreediff JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | An utility for comparing files in 2 directories |
upload_time | 2024-03-16 15:17:54 |
maintainer | |
docs_url | None |
author | |
requires_python | |
license | MIT License |
keywords |
diff
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ktreediff
An utility for comparing files in directories.
Pypi rejected the package name 'treediff' so I had to change package name to 'ktreediff'
but 'treediff' command is available.
## How to install
To install just run the following command. There's no external dependencies required.
```
$ pip install ktreediff
```
## Command line options
```
usage: $ treediff [options...] <left> <right>
Note: <left> and <right> can be a pair of files or a pair of directories
Examples:
To compare files in 2 directories dir_a and dir_b
$ treediff dir_a dir_b
To compare files in 2 directories dir_a and dir_b, included subfolders
$ treediff dir_a dir_b --recursive
To compare specific files (*.txt, *.psd) in 2 directories dir_a and dir_b
$ treediff --filter .txt .psd dir_a dir_b
Exit code:
0 : directories or files are the same
1 : directories or files are different
255: an error/exception occured
Utility for comparing directory/file
positional arguments:
left specify left dir/file
right specify right dir/file
options:
-h, --help show this help message and exit
-r, --recursive search file recursively
-q, --quiet be quiet
-f FILTER [FILTER ...], --filter FILTER [FILTER ...]
file filters separated by space. Ex: -f .psd .txt ...
```
## How to use
To compare 2 directories:
```
$ treediff dir_a dir_b
dir_a/ != dir_b/
file_1.txt == file_1.txt
file_2.txt == file_2.txt
file_3.txt != file_3.txt
file_4.txt == file_4.txt
file_5.txt != ...
... != file_6.txt
log_1.log == log_1.log
log_2.log == log_2.log
log_5.log == log_5.log
log_6.log != ...
sub_dir/ == sub_dir/
```
To compare 2 directories included their sub directories: use `-r/--recursive` option.
```
$ treediff dir_a dir_b -r
dir_a/ != dir_b/
file_1.txt == file_1.txt
file_2.txt == file_2.txt
file_3.txt != file_3.txt
file_4.txt == file_4.txt
file_5.txt != ...
... != file_6.txt
log_1.log == log_1.log
log_2.log == log_2.log
log_5.log == log_5.log
log_6.log != ...
sub_dir/ != sub_dir/
file1.log == file1.log
file2.log != file2.log
file3.log == file3.log
... != file4.log
file5.log != ...
```
To compare only *.txt files in 2 directories, use `-f/--filter` option.
Note: You can specify multiple file types also, for example: `-f .txt .log`
```
$ treediff dir_a dir_b -r -f .txt
dir_a/ != dir_b/
file_1.txt == file_1.txt
file_2.txt == file_2.txt
file_3.txt != file_3.txt
file_4.txt == file_4.txt
file_5.txt != ...
... != file_6.txt
sub_dir/ == sub_dir/
```
Or you can also just compare 2 files
```
$ treediff dir_a\file_1.txt dir_b\file_1.txt
2 files are identical at binary level
```
## How to build and install locally
To build this project, run the following commands
```
$ git clone <this_repo_url> <-- clone this project
$ cd treediff <-- move to project directory
$ pip install build <-- install 'build' package, do this only once if not installed
$ python -m build <-- build this project
```
After build this project, use the following command to install
```
$ pip install dist\ktreediff-<version>-py3-none-any.whl --force-reinstall
```
Raw data
{
"_id": null,
"home_page": "",
"name": "ktreediff",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "diff",
"author": "",
"author_email": "thkien <thkien@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/47/76/e1079dd68228f8d069e8e06a4d096f7c99effbf2e43dc0de80702d1eaa0b/ktreediff-0.1.0.tar.gz",
"platform": null,
"description": "# ktreediff\r\n\r\nAn utility for comparing files in directories.\r\n\r\nPypi rejected the package name 'treediff' so I had to change package name to 'ktreediff'\r\nbut 'treediff' command is available.\r\n\r\n## How to install\r\n\r\nTo install just run the following command. There's no external dependencies required.\r\n\r\n```\r\n$ pip install ktreediff\r\n```\r\n\r\n## Command line options\r\n```\r\nusage: $ treediff [options...] <left> <right>\r\n Note: <left> and <right> can be a pair of files or a pair of directories\r\n\r\nExamples:\r\nTo compare files in 2 directories dir_a and dir_b\r\n $ treediff dir_a dir_b\r\n\r\nTo compare files in 2 directories dir_a and dir_b, included subfolders\r\n $ treediff dir_a dir_b --recursive\r\n\r\nTo compare specific files (*.txt, *.psd) in 2 directories dir_a and dir_b\r\n $ treediff --filter .txt .psd dir_a dir_b\r\n\r\nExit code:\r\n 0 : directories or files are the same\r\n 1 : directories or files are different\r\n 255: an error/exception occured\r\n\r\nUtility for comparing directory/file\r\n\r\npositional arguments:\r\n left specify left dir/file\r\n right specify right dir/file\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -r, --recursive search file recursively\r\n -q, --quiet be quiet\r\n -f FILTER [FILTER ...], --filter FILTER [FILTER ...]\r\n file filters separated by space. Ex: -f .psd .txt ...\r\n```\r\n\r\n## How to use\r\n\r\nTo compare 2 directories:\r\n```\r\n$ treediff dir_a dir_b\r\ndir_a/ != dir_b/\r\n file_1.txt == file_1.txt\r\n file_2.txt == file_2.txt\r\n file_3.txt != file_3.txt\r\n file_4.txt == file_4.txt\r\n file_5.txt != ...\r\n ... != file_6.txt\r\n log_1.log == log_1.log\r\n log_2.log == log_2.log\r\n log_5.log == log_5.log\r\n log_6.log != ...\r\n sub_dir/ == sub_dir/\r\n\r\n```\r\n\r\nTo compare 2 directories included their sub directories: use `-r/--recursive` option.\r\n```\r\n$ treediff dir_a dir_b -r\r\ndir_a/ != dir_b/\r\n file_1.txt == file_1.txt\r\n file_2.txt == file_2.txt\r\n file_3.txt != file_3.txt\r\n file_4.txt == file_4.txt\r\n file_5.txt != ... \r\n ... != file_6.txt\r\n log_1.log == log_1.log\r\n log_2.log == log_2.log\r\n log_5.log == log_5.log\r\n log_6.log != ...\r\n sub_dir/ != sub_dir/\r\n file1.log == file1.log\r\n file2.log != file2.log\r\n file3.log == file3.log\r\n ... != file4.log\r\n file5.log != ...\r\n\r\n```\r\n\r\nTo compare only *.txt files in 2 directories, use `-f/--filter` option. \r\nNote: You can specify multiple file types also, for example: `-f .txt .log`\r\n\r\n```\r\n$ treediff dir_a dir_b -r -f .txt \r\ndir_a/ != dir_b/\r\n file_1.txt == file_1.txt\r\n file_2.txt == file_2.txt\r\n file_3.txt != file_3.txt\r\n file_4.txt == file_4.txt\r\n file_5.txt != ...\r\n ... != file_6.txt\r\n sub_dir/ == sub_dir/\r\n```\r\n\r\n\r\nOr you can also just compare 2 files\r\n\r\n```\r\n$ treediff dir_a\\file_1.txt dir_b\\file_1.txt\r\n\r\n2 files are identical at binary level\r\n```\r\n\r\n## How to build and install locally\r\n\r\nTo build this project, run the following commands\r\n\r\n```\r\n\r\n$ git clone <this_repo_url> <-- clone this project\r\n$ cd treediff <-- move to project directory\r\n$ pip install build <-- install 'build' package, do this only once if not installed\r\n$ python -m build <-- build this project\r\n\r\n```\r\n\r\n\r\nAfter build this project, use the following command to install\r\n\r\n```\r\n$ pip install dist\\ktreediff-<version>-py3-none-any.whl --force-reinstall\r\n```\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "An utility for comparing files in 2 directories",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"diff"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "91f3b0629a821ab238aa83fc0f75ed69dfe36edd3ac6244115cb9c0c9c4bfb62",
"md5": "91ec4e5995a1c9c8787f5d2b340ebd01",
"sha256": "c3f48625b6807653a498c5f8b8a5bd2bcbd2d95d01b60433ffc274636b25e75d"
},
"downloads": -1,
"filename": "ktreediff-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "91ec4e5995a1c9c8787f5d2b340ebd01",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9192,
"upload_time": "2024-03-16T15:17:52",
"upload_time_iso_8601": "2024-03-16T15:17:52.588082Z",
"url": "https://files.pythonhosted.org/packages/91/f3/b0629a821ab238aa83fc0f75ed69dfe36edd3ac6244115cb9c0c9c4bfb62/ktreediff-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4776e1079dd68228f8d069e8e06a4d096f7c99effbf2e43dc0de80702d1eaa0b",
"md5": "560d69b39eb0f7c3275ebc739878ed1e",
"sha256": "324dcc597b6be8581d9cdfaf368a0508bd722cf1d611c753825238e2807e3fa7"
},
"downloads": -1,
"filename": "ktreediff-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "560d69b39eb0f7c3275ebc739878ed1e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8760,
"upload_time": "2024-03-16T15:17:54",
"upload_time_iso_8601": "2024-03-16T15:17:54.431785Z",
"url": "https://files.pythonhosted.org/packages/47/76/e1079dd68228f8d069e8e06a4d096f7c99effbf2e43dc0de80702d1eaa0b/ktreediff-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-16 15:17:54",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ktreediff"
}