获取给定路径中所有文件的安全哈希值(SHA)的工具。
a-john-shots的Python项目详细描述
获取给定路径中所有文件的安全哈希算法(SHA)的工具。
此项目的目标是提供一个工具,该工具提供给定树/路径中所有文件的shax表示。
安装
来自Pypi
$ pip3 install --user a-john-shots
我们建议使用--user
标志,在用户级别安装所需的依赖项。有关它的更多信息可以在pip documentation上找到。
来自github
$ pip3 install --user git+https://github.com/funilrys/A-John-Shots.git@master#egg=a-john-shots
我们建议使用--user
标志,在用户级别安装所需的依赖项。有关它的更多信息可以在pip documentation上找到。
用法
cli
usage: a-john-shots [-h] [-a ALGORITHM] [-d DESTINATION] [-e EXCLUDE] [-p PATH] [--print] [-s SEARCH] [--save] [-v] A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path. optional arguments: -h, --help show this help message and exit -a ALGORITHM, --algorithm ALGORITHM The SHA algorithm to use. Can be ALL, SHA1, SHA224, SHA384 or SHA512 (default). -d DESTINATION, --destination DESTINATION Set the file we are going to write the JSON output to. -e EXCLUDE, --exclude EXCLUDE The (regex) pattern the filename has to match in order to be excluded from the output. -p PATH, --path PATH The file or directory path to read. --print Print the output. -s SEARCH, --search SEARCH The (regex) pattern the filename has to match in order to be included into the output. --save Save the output into a JSON file. -v, --version show program's version number and exit Crafted with ♥ by Nissar Chababy (Funilrys)
api
Help on function get in a_john_shots: a_john_shots.get = get(file_or_dir_path, sha='sha512', search=None, save=False, save_destination=None, exclude=None) Return the SHA representation of the given path children. .. note:: If :code:`file_or_dir_path` is a directory, we will get the SHA representation of all children files. .. note:: If :code:`file_or_dir_path` is a file, we will get the SHA representation of the given file. :param file_or_dir_path: The file or directory we are working with. :type file_or_dir_path: str :param sha: The SHA to use. Can be one of the following: :: - all - sha1 - sha224 - sha384 - sha513 :type sha: str :param search: The pattern the filename have to match in order to be taken in consideration. :type search: str :param save: Tell the system if we are allowed to save the result into a JSON file. .. note:: The default file name is :code:`faith-slosh.json`. .. note:: Even if this argument is set to :code:`True`, we return the dict representation if needed. :type save: bool :param save_destination: The destination file. :type save_destination: str :param exclude: The pattern the filename have to match in order to be excluded. :type exclude: str|list
许可证
MIT License Copyright (c) 2017-2019 Nissar Chababy <contact at funilrys dot com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.