diff --git a/pkgs/development/python-modules/markitdown/default.nix b/pkgs/development/python-modules/markitdown/default.nix new file mode 100644 index 0000000000000..b27e23b846778 --- /dev/null +++ b/pkgs/development/python-modules/markitdown/default.nix @@ -0,0 +1,74 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + beautifulsoup4, + ffmpeg-headless, + mammoth, + markdownify, + numpy, + openpyxl, + pandas, + pathvalidate, + pdfminer-six, + puremagic, + pydub, + python-pptx, + requests, + speechrecognition, + youtube-transcript-api, + pytestCheckHook, + gitUpdater, +}: + +buildPythonPackage { + pname = "markitdown"; + version = "unstable-2024-12-15"; + pyproject = true; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "markitdown"; + rev = "6dad1cca967f0d8eb15233104ab5b30fc37e6649"; + hash = "sha256-oview6cA4bFPq5fp6UegW34uKHF1PybAh+FUcfgPa+Q="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + beautifulsoup4 + ffmpeg-headless + mammoth + markdownify + numpy + openpyxl + pandas + pathvalidate + pdfminer-six + puremagic + pydub + python-pptx + requests + speechrecognition + youtube-transcript-api + ]; + + pythonImportsCheck = [ "markitdown" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTests = [ + # Require network access + "test_markitdown_remote" + ]; + + passthru.updateScripts = gitUpdater { }; + + meta = { + description = "Python tool for converting files and office documents to Markdown"; + homepage = "https://github.com/microsoft/markitdown"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4a807b9781e5c..fb8e06097ad75 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7869,6 +7869,8 @@ self: super: with self; { markdownify = callPackage ../development/python-modules/markdownify { }; + markitdown = callPackage ../development/python-modules/markitdown { }; + marko = callPackage ../development/python-modules/marko { }; markupsafe = callPackage ../development/python-modules/markupsafe { };