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.1.3) 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.3.tar.gz
(474.1 kB
view hashes)
Built Distributions
Close
Hashes for python_mmdt-0.1.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70fb3dfd806b1b48c9498441ff6eb8c6f77fc41a4fc262b915c752c8252d3234 |
|
MD5 | 1c5a42f4e644dd673d2face3df7f6ed6 |
|
BLAKE2b-256 | 00a5b077fba23ead41b8bdf8bf6e03d413b3eade460d5f9a5532b789cbe80130 |
Close
Hashes for python_mmdt-0.1.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa048cb7f3c6376d333008bebb36cc8409c60711f56875d5ac0b1ffcbcd382d9 |
|
MD5 | 05eb39623266b8873e0dcea32a3b7c4d |
|
BLAKE2b-256 | cd1200673513002c2e3f8bb08a47987737b6f36bf3d23491eca6143772bbe57b |
Close
Hashes for python_mmdt-0.1.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf8ec9c9e8d0ae733f358fc04fafed033ef2213b5e4945cdddb393dfc8a1c632 |
|
MD5 | eb13aef188e8de52dc7291ee1b6c8ce3 |
|
BLAKE2b-256 | 2193134ca7afcb13f844c10ce76b25b374ed23ba57ab33cb2e614fbbc8becb9c |