1{
2 lib,
3 beautifulsoup4,
4 buildPythonPackage,
5 compressed-rtf,
6 ebcdic,
7 fetchFromGitHub,
8 olefile,
9 pytestCheckHook,
10 pythonOlder,
11 pythonRelaxDepsHook,
12 red-black-tree-mod,
13 rtfde,
14 setuptools,
15 tzlocal,
16}:
17
18buildPythonPackage rec {
19 pname = "extract-msg";
20 version = "0.48.5";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "TeamMsgExtractor";
27 repo = "msg-extractor";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-GBX6VRXXja18azyiJZJ3niKPhAKZxDR8kcFbiC2XgeU=";
30 };
31
32 pythonRelaxDeps = [
33 "olefile"
34 "red-black-tree-mod"
35 ];
36
37 build-system = [
38 pythonRelaxDepsHook
39 setuptools
40 ];
41
42 dependencies = [
43 beautifulsoup4
44 compressed-rtf
45 ebcdic
46 olefile
47 red-black-tree-mod
48 rtfde
49 tzlocal
50 ];
51
52 nativeCheckInputs = [ pytestCheckHook ];
53
54 pythonImportsCheck = [ "extract_msg" ];
55
56 pytestFlagsArray = [ "extract_msg_tests/*.py" ];
57
58 meta = with lib; {
59 description = "Extracts emails and attachments saved in Microsoft Outlook's .msg files";
60 homepage = "https://github.com/TeamMsgExtractor/msg-extractor";
61 changelog = "https://github.com/TeamMsgExtractor/msg-extractor/blob/${version}/CHANGELOG.md";
62 license = licenses.gpl3Only;
63 maintainers = with maintainers; [ fab ];
64 };
65}