Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/to-mc/checksumdir
Simple package to compute a single deterministic hash of the file contents of a directory.
https://github.com/to-mc/checksumdir
Last synced: about 2 months ago
JSON representation
Simple package to compute a single deterministic hash of the file contents of a directory.
- Host: GitHub
- URL: https://github.com/to-mc/checksumdir
- Owner: to-mc
- License: mit
- Created: 2015-03-04T10:36:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-10-08T09:16:11.000Z (almost 2 years ago)
- Last Synced: 2024-07-12T04:51:00.464Z (2 months ago)
- Language: Python
- Size: 32.2 KB
- Stars: 91
- Watchers: 3
- Forks: 27
- Open Issues: 12
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
***********
Checksumdir
***********|badge1| |badge2|
.. |badge1| image:: https://img.shields.io/pypi/dm/checksumdir
:alt: PyPI - Downloads
:target: https://pypistats.org/packages/checksumdir.. |badge2| image:: https://badge.fury.io/py/checksumdir.svg
:target: https://pypi.org/project/checksumdir/A simple module for creating a single hash for a directory of files, with file contents;
ignoring any metadata such as file name. Options exist to also exclude specific files
or files with specific extensions.=====
Usage
=====.. code-block:: python
from checksumdir import dirhash
directory = '/path/to/directory/'
md5hash = dirhash(directory, 'md5')
sha1hash = dirhash(directory, 'sha1', excluded_files=['package.json'])
sha256hash = dirhash(directory, 'sha256', excluded_extensions=['pyc'])Or to use the CLI:
.. code-block:: bash
# Defaults to md5.
$ checksumdir /path/to/directory# Create sha1 hash:
$ checksumdir -a sha1 /path/to/directory# Exclude files:
$ checksumdir -e /path/to/directory# Exclude files with specific extensions:
$ checksumdir -x /path/to/directory# Follow soft links:
$ checksumdir --follow-links /path/to/directory