docling: init at 2.17.0

This commit is contained in:
happysalada
2025-02-02 16:39:38 -05:00
parent 7932cca2f3
commit b01185388f
3 changed files with 155 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
{ python3Packages }:
python3Packages.toPythonApplication python3Packages.docling
@@ -0,0 +1,150 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# dependencies
pydantic,
docling-core,
docling-ibm-models,
deepsearch-glm,
docling-parse,
filetype,
pypdfium2,
pydantic-settings,
huggingface-hub,
requests,
easyocr,
tesserocr,
certifi,
rtree,
scipy,
typer,
python-docx,
python-pptx,
beautifulsoup4,
pandas,
marko,
openpyxl,
lxml,
# ocrmac # not yet packaged
rapidocr-onnxruntime,
onnxruntime,
pillow,
pyarrow,
# build system
poetry-core,
# optional dependencies
mkdocs-material,
mkdocs-jupyter,
# mkdocs-click # not yet packaged
mkdocstrings,
# native check inputs
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "docling";
version = "2.17.0";
pyproject = true;
src = fetchFromGitHub {
owner = "DS4SD";
repo = "docling";
tag = "v${version}";
hash = "sha256-OtUFQRNqyTGT1Z41tHziwM5hqbk+tg/97bxhtPVtmN0=";
};
build-system = [
poetry-core
];
dependencies = [
pydantic
docling-core
docling-ibm-models
deepsearch-glm
docling-parse
filetype
pypdfium2
pydantic-settings
huggingface-hub
requests
easyocr
tesserocr
certifi
rtree
scipy
typer
python-docx
python-pptx
beautifulsoup4
pandas
marko
openpyxl
lxml
# ocrmac # not yet packaged
rapidocr-onnxruntime
onnxruntime
pillow
pyarrow
];
pythonRelaxDeps = [
"pillow"
];
optional-dependencies = {
ocrmac = [
# ocrmac # not yet packaged
];
rapidocr = [
onnxruntime
rapidocr-onnxruntime
];
tesserocr = [
tesserocr
];
docs = [
mkdocs-material
mkdocs-jupyter
# mkdocs-click # not yet packaged
mkdocstrings
# griffle-pydantic
];
};
preCheck = ''
export HOME="$TEMPDIR"
'';
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"docling"
];
disabledTests = [
"test_e2e_pdfs_conversions" # AssertionError: ## TableFormer: Table Structure Understanding with Transf
"test_e2e_conversions" # RuntimeError: Tesseract is not available
# huggingface_hub.errors.LocalEntryNotFoundError: An error happened
"test_cli_convert"
"test_code_and_formula_conversion"
"test_picture_classifier"
"test_convert_path"
"test_convert_stream"
"test_compare_legacy_output"
"test_ocr_coverage_threshold"
];
meta = {
description = "Get your documents ready for gen AI";
homepage = "https://github.com/DS4SD/docling";
changelog = "https://github.com/DS4SD/docling/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ happysalada ];
mainProgram = "docling";
};
}
+2
View File
@@ -3799,6 +3799,8 @@ self: super: with self; {
dockerspawner = callPackage ../development/python-modules/dockerspawner { };
docling = callPackage ../development/python-modules/docling { };
docling-core = callPackage ../development/python-modules/docling-core { };
docling-ibm-models = callPackage ../development/python-modules/docling-ibm-models { };