Skip to main content

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 above
  • windows: The current version (0.1.3) requires minGW 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

python-mmdt

Release files for python-mmdt 0.2.2

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

Source distribution (sdist)

Source distribution for python-mmdt 0.2.2
File Size Uploaded
python_mmdt-0.2.2.tar.gz 474.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for python-mmdt 0.2.2
File Interpreter ABI Platform
python_mmdt-0.2.2-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
python_mmdt-0.2.2-cp38-cp38-macosx_10_15_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.15+ x86-64 Details
python_mmdt-0.2.2-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details

Total release size: 1.9 MB

Release files / python_mmdt-0.2.2.tar.gz

Download URL python_mmdt-0.2.2.tar.gz
Size 474.9 kB
Tags Source
SHA-256 checksum
How to use checksums
35a3f39eaed15292b9fb504419b00c4da0df260dfb1bbe31ca1b27e279295faa
BLAKE2b-256 checksum
How to use checksums
ba8b6df2ea5046f9eb12429620e387b321120983455314a8023030cd11f3d77c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.1

Release files / python_mmdt-0.2.2-cp38-cp38-win_amd64.whl

Download URL python_mmdt-0.2.2-cp38-cp38-win_amd64.whl
Size 485.7 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
a48dcec71190937bff47f81495df69d19dbcd9e7aed421245e5cdbd6f26062e7
BLAKE2b-256 checksum
How to use checksums
de07f42a7a5fbe6cb2b559d5674d8711f25f0b11a8124a17543afd31e4e4f976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.1

Release files / python_mmdt-0.2.2-cp38-cp38-macosx_10_15_x86_64.whl

Download URL python_mmdt-0.2.2-cp38-cp38-macosx_10_15_x86_64.whl
Size 483.7 kB
Tags CPython 3.8 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
3540e55ed3fff936b44d33b639851c3e2465f588c0f5eb971f66c19ff224a6e5
BLAKE2b-256 checksum
How to use checksums
ea4949ae3605e24912765584f1bc0a67d22a3948d6f3399b9d73ad42f8270f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.1

Release files / python_mmdt-0.2.2-cp36-cp36m-win_amd64.whl

Download URL python_mmdt-0.2.2-cp36-cp36m-win_amd64.whl
Size 485.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
068c6cc2917fdc29a4908cd97db13966a6cc82d043532371ec593e7df0e7d954
BLAKE2b-256 checksum
How to use checksums
bea4874125167a71cd146042430efe44a711e6765da3c1198c04582528efb196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.1

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3.0

5 release files

0.2.3

3 release files

This release

0.2.2 This release

4 release files

0.1.3

4 release files

0.1.2

4 release files

0.1.1

3 release files

0.0.3

3 release files

0.0.2

2 release files

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