Skip to main content

A John Shots (Hash To JSON)

A tool to get the Security Hash Algorightms (SHA) of all file in a given path.

The objective of this project is to provide a tool which give the SHAx representation of all file in a given tree/path.


Installation

From PyPi

$ pip3 install --user a-john-shots

We recommend the --user flag which installs the required dependencies at the user level. More information about it can be found on pip documentation.

From GitHub

$ pip3 install --user git+https://github.com/funilrys/A-John-Shots.git@master#egg=a-john-shots

We recommend the --user flag which installs the required dependencies at the user level. More information about it can be found on pip documentation.


Usage

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

License

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.

Metadata

Release files for a-john-shots 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a-john-shots 2.0.0
File Size Uploaded Provenance Actions
a-john-shots-2.0.0.tar.gz 8.8 kB Without provenance Details for a-john-shots-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for a-john-shots 2.0.0
File Interpreter ABI Platform Actions
a_john_shots-2.0.0-py3-none-any.whl Python 3 none any Details for a_john_shots-2.0.0-py3-none-any.whl

Total release size: 22.7 kB

Release files / a-john-shots-2.0.0.tar.gz

Download URL a-john-shots-2.0.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a5f2aa947b847acf1d5252c4be38e118c9d273961eb3bdaea9b40e521c81f8d9
BLAKE2b-256 checksum
How to use checksums
7ae268a06219e8489e43d786def09a96aa90e46960ea5a871f1d775ef3093cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / a_john_shots-2.0.0-py3-none-any.whl

Download URL a_john_shots-2.0.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e86ef28de402e161bfd9fa43d8c2bdf5abfa98560ccd3d4fdb7e95783d039d8c
BLAKE2b-256 checksum
How to use checksums
57d21156525e6b61494dd282e50db8d4c8df9d0659d28f01081bf1faa70144b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Security for a-john-shots 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page