Installation

From packages

Easiest way is to install pipx, then use it to install mdedup:

$ pipx install mail-deduplicate

Note

pipx is to pip what npx is to npm: a clean way to install and run Python applications in isolated environments.

You can install the latest stable release and its dependencies with a simple pip call:

$ python -m pip install mail-deduplicate

On some system, due to the Python 2.x to 3.x migration, you’ll have to call python3 directly:

$ python3 -m pip install mail-deduplicate

Other variations includes:

$ pip install mail-deduplicate
$ pip3 install mail-deduplicate

If you have difficulties to use pip, see pip’s own installation instructions.

Binaries

Binaries are compiled at each release, so you can skip the installation process above and download the standalone executables directly.

This is the preferred way of testing mdedup without polluting your machine. They also offer the possibility of running the CLI on older systems not supporting the minimal Python version required by mdedup.

All links above points to the latest released version of mdedup.

See also

Older releases If you need to test previous versions for regression, compatibility or general troubleshooting, you’ll find the old binaries attached as assets to past releases on GitHub.

Caution

Development builds Each commit to the development branch triggers the compilation of binaries. This way you can easily test the bleeding edge version of mdedup and report any issue.

Look at the list of latest binary builds. Then select the latest Build & release/release.yaml workflow run and download the binary artifact corresponding to your platform and architecture.

Note

ABI targets

$ file ./mdedup*
./mdedup-linux-x64.bin:   ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ffc3a60c86bcfcd817c7c76ae3c527acd7c810e0, for GNU/Linux 3.2.0, stripped
./mdedup-macos-arm64.bin: Mach-O 64-bit executable arm64
./mdedup-macos-x64.bin:   Mach-O 64-bit executable x86_64
./mdedup-windows-x64.exe: PE32+ executable (console) x86-64, for MS Windows

Run mdedup

Mail Deduplicate should now be available system-wide:

$ mdedup --version
mdedup, version 7.0.0
(...)

If not, you can directly execute the module from Python:

$ python -m mail_deduplicate --version
mdedup, version 7.0.0
(...)

Or on some systems:

$ python3 -m mail_deduplicate --version
mdedup, version 7.0.0
(...)

Shell completion

Completion for popular shell rely on Click feature.

Add this to ~/.bashrc:

eval "$(_MDEDUP_COMPLETE=bash_source mdedup)"

Add this to ~/.zshrc:

eval "$(_MDEDUP_COMPLETE=zsh_source mdedup)"

Add this to ~/.config/fish/completions/mdedup.fish:

eval (env _MDEDUP_COMPLETE=fish_source mdedup)

Alternatively, export the generated completion code as a static script to be executed:

$ _MDEDUP_COMPLETE=bash_source mdedup > ~/.mdedup-complete.bash

Then source it from ~/.bashrc:

. ~/.mdedup-complete.bash
$ _MDEDUP_COMPLETE=zsh_source mdedup > ~/.mdedup-complete.zsh

Then source it from ~/.zshrc:

. ~/.mdedup.zsh
_MDEDUP_COMPLETE=fish_source mdedup > ~/.config/fish/completions/mdedup.fish

Python dependencies

FYI, here is a graph of Python package dependencies:

flowchart TD classDef missing stroke-dasharray: 5 arrow["arrow\n1.3.0"] boltons["boltons\n24.0.0"] bracex["bracex\n2.4"] certifi["certifi\n2024.6.2"] charset-normalizer["charset-normalizer\n3.3.2"] click-extra["click-extra\n4.8.3"] click_0["click\n8.1.7"] cloup["cloup\n3.0.5"] commentjson["commentjson\n0.9.0"] idna["idna\n3.7"] lark-parser["lark-parser\n0.7.8"] mail-deduplicate["mail-deduplicate\n7.4.0"] mergedeep["mergedeep\n1.3.4"] python-dateutil["python-dateutil\n2.9.0.post0"] pyyaml["PyYAML\n6.0.1"] regex["regex\n2024.5.15"] requests["requests\n2.32.3"] six["six\n1.16.0"] tabulate["tabulate\n0.9.0"] types-python-dateutil["types-python-dateutil\n2.9.0.20240316"] urllib3["urllib3\n2.2.2"] wcmatch["wcmatch\n8.5.2"] xmltodict["xmltodict\n0.13.0"] arrow -- ">=2.7.0" --> python-dateutil arrow -- ">=2.8.10" --> types-python-dateutil click-extra -- ">=0.13.0,<0.14.0" --> xmltodict click-extra -- ">=0.9,<0.10" --> tabulate click-extra -- ">=0.9.0,<0.10.0" --> commentjson click-extra -- ">=1.3.4,<2.0.0" --> mergedeep click-extra -- ">=2.28.2,<3.0.0" --> requests click-extra -- ">=2024.4.16,<2025.0.0" --> regex click-extra -- ">=24.0.0,<25.0.0" --> boltons click-extra -- ">=3.0.5,<4.0.0" --> cloup click-extra -- ">=6.0.0,<7.0.0" --> pyyaml click-extra -- ">=8.1.4,<9.0.0" --> click_0 click-extra -- ">=8.5,<9.0" --> wcmatch cloup -- ">=8.0,<9.0" --> click_0 commentjson -- ">=0.7.1,<0.8.0" --> lark-parser mail-deduplicate -- ">=0.9.0,<0.10.0" --> tabulate mail-deduplicate -- ">=1.2.3,<2.0.0" --> arrow mail-deduplicate -- ">=24.0.0,<25.0.0" --> boltons mail-deduplicate -- ">=4.8.3,<5.0.0" --> click-extra python-dateutil -- ">=1.5" --> six requests -- ">=1.21.1,<3" --> urllib3 requests -- ">=2,<4" --> charset-normalizer requests -- ">=2.5,<4" --> idna requests -- ">=2017.4.17" --> certifi wcmatch -- ">=2.1.1" --> bracex