Python wrapper for the mmdt library
Project description
python_mmdt
python_mmdt is a python-based mmdt library implementation. This library allows you to use mmdt through python to calculate sensitive hashes.
mmdt is a sensitive hash implementation that can be used to calculate file similarity
Pre-Install
cmake
: 2.6 and abovewindows
: The current version (0.0.1) requiresminGW
to be installed on windows
Install from Pypi
$ pip install python_mmdt
Install by Whl
.whl
download from Release
$ pip install python_mmdt-xxx.whl
Usage
Command Line
# calculate mmdt sensitive
$ mmdt-hash $file_path
# calculate file similarity
$ mmdt-compare $file_path1 $file_path2
python code
# -*- coding: utf-8 -*-
import unittest
import os
from python_mmdt.mmdt.mmdt import MMDT
class Testmmdt(unittest.TestCase):
def test_process(self):
mmdt = MMDT()
test_path = os.path.dirname(__file__)
test_samples = os.path.join(test_path, "samples")
files = os.listdir(test_samples)
for f in files:
file_path = os.path.join(test_samples, f)
r1 = mmdt.mmdt_hash(file_path)
print(r1)
r2 = mmdt.mmdt_hash_streaming(file_path)
print(r2)
sim1 = mmdt.mmdt_compare(file_path, file_path)
print(sim1)
sim2 = mmdt.mmdt_compare_hash(r1, r2)
print(sim2)
Screenshot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_mmdt-0.1.2.tar.gz
(473.6 kB
view hashes)
Built Distributions
Close
Hashes for python_mmdt-0.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d404278f991af994a126f560ac79a71066ebb8dd7557e7a06432a9717d52dc |
|
MD5 | ac121a3597c041f0f7c4c4de66220c8c |
|
BLAKE2b-256 | 0e9cefa425f18244d6515f12ec9c3f2e7dbe9fcdb24dd125379f1be5fb956ff6 |
Close
Hashes for python_mmdt-0.1.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5559c367393e4b91c2391aaf6b5cb96534d3b6f9cbbec0b35b1a251ab458c8e3 |
|
MD5 | e0e3c7acb06a2b23497d555af21c9233 |
|
BLAKE2b-256 | 4e8d8fa67c1d0cc9cae70d5f0c85e0037cb3dfb023c49d6c2afe7cbdc8958608 |
Close
Hashes for python_mmdt-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c6d234df4b51b3166e132d65b430649e6ef1a9f45737c1c684a2b053ea61e16 |
|
MD5 | 46a391c5e60bbee752b583c5022e04f6 |
|
BLAKE2b-256 | 43e840943ea4931d75161b5ebecd6d6f82a814c493fb9e26dc2a7dc2a9e3167d |