1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8 setuptools,
9
10 # dependencies
11 jsonref,
12 jsonschema,
13 latex2mathml,
14 pandas,
15 pillow,
16 pydantic,
17 pyyaml,
18 semchunk,
19 tabulate,
20 transformers,
21 typer,
22 typing-extensions,
23
24 # tests
25 jsondiff,
26 pytestCheckHook,
27 requests,
28}:
29
30buildPythonPackage rec {
31 pname = "docling-core";
32 version = "2.48.2";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "docling-project";
37 repo = "docling-core";
38 tag = "v${version}";
39 hash = "sha256-nZ9uPy6H8VhtoC7TXuFfXHefqvQ72jfUSwM6VmuFyxo=";
40 };
41
42 build-system = [
43 poetry-core
44 setuptools
45 ];
46
47 dependencies = [
48 jsonref
49 jsonschema
50 latex2mathml
51 pandas
52 pillow
53 pydantic
54 pyyaml
55 semchunk
56 tabulate
57 transformers
58 typer
59 typing-extensions
60 ];
61
62 pythonRelaxDeps = [
63 "pillow"
64 ];
65
66 pythonImportsCheck = [
67 "docling_core"
68 ];
69
70 nativeCheckInputs = [
71 jsondiff
72 pytestCheckHook
73 requests
74 ];
75
76 disabledTestPaths = [
77 # attempts to download models
78 "test/test_hybrid_chunker.py"
79 ];
80
81 meta = {
82 changelog = "https://github.com/DS4SD/docling-core/blob/${src.tag}/CHANGELOG.md";
83 description = "Python library to define and validate data types in Docling";
84 homepage = "https://github.com/DS4SD/docling-core";
85 license = lib.licenses.mit;
86 maintainers = with lib.maintainers; [ ];
87 };
88}