获取给定路径中所有文件的安全哈希值(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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓如何在java字符串中获取RATE的值   java ANT在哪里输出编译器错误?   在java中,while循环在何处启动对象   javacom。谷歌。格森。内部的LinkedTreeMap无法强制转换到我的类   java单选按钮。isSelected()方法未返回正确的响应   嵌入式系统中applet中的java相对码基字段   如何在eclipse中将Java应用程序附加到jvm探查器?   java为什么Android应用程序崩溃?   在java中拖放上传后保持文件夹结构   爪哇多领导人选举问题   java Springs RestTemplate如何处理postForEntity()中的错误响应   Java如何用前导零递增整数字符串?   java Android将文本作为图像共享给其他应用程序   Java搜索替换   java isDirectory()不适用于UNIX目录   java我们可以得到显示测试类是否通过或失败的TestNG报告吗   Java类对象排序和分组   简单Java幂递归   java在处理MethodArgumentNotValidException时如何访问请求对象?