Skip to content

Commit e12d6a7

Browse files
authored
fix: fix legacy doc ref (#48)
Signed-off-by: Panos Vagenas <[email protected]>
1 parent 0aab007 commit e12d6a7

File tree

6 files changed

+1132
-2017
lines changed

6 files changed

+1132
-2017
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,37 @@ poetry run pytest test
3636
- You can validate your JSON objects using the pydantic class definition.
3737

3838
```py
39-
from docling_core.types import Document
39+
from docling_core.types import DoclingDocument
4040

4141
data_dict = {...} # here the object you want to validate, as a dictionary
42-
Document.model_validate(data_dict)
42+
DoclingDocument.model_validate(data_dict)
4343

4444
data_str = {...} # here the object as a JSON string
45-
Document.model_validate_json(data_str)
45+
DoclingDocument.model_validate_json(data_str)
4646
```
4747

4848
- You can generate the JSON schema of a model with the script `generate_jsonschema`.
4949

5050
```py
51-
# for the `Document` type
52-
generate_jsonschema Document
51+
# for the `DoclingDocument` type
52+
generate_jsonschema DoclingDocument
5353

5454
# for the use `Record` type
5555
generate_jsonschema Record
5656
```
5757

5858
## Documentation
5959

60-
Docling supports 3 main data types:
60+
Docling Core contains 3 top-level data types:
6161

62-
- **Document** for publications like books, articles, reports, or patents. When Docling converts an unstructured PDF document, the generated JSON follows this schema.
63-
The Document type also models the metadata that may be attached to the converted document.
64-
Check [Document](docs/Document.json) for the full JSON schema.
62+
- **DoclingDocument** for publications like books, articles, reports, or patents. When Docling converts an unstructured PDF document, the generated JSON follows this schema.
63+
The DoclingDocument type also models the metadata that may be attached to the converted document.
64+
Check [DoclingDocument](docs/DoclingDocument.json) for the full JSON schema.
6565
- **Record** for structured database records, centered on an entity or _subject_ that is provided with a list of attributes.
6666
Related to records, the statements can represent annotations on text by Natural Language Processing (NLP) tools.
67-
Check [Record](docs/Record.json) for the full JSON schema.
67+
Check [Record](docs/Record.json) for the full JSON schema.
6868
- **Generic** for any data representation, ensuring minimal configuration and maximum flexibility.
69-
Check [Generic](docs/Generic.json) for the full JSON schema.
69+
Check [Generic](docs/Generic.json) for the full JSON schema.
7070

7171
The data schemas are defined using [pydantic](https://pydantic-docs.helpmanual.io/) models, which provide built-in processes to support the creation of data that adhere to those models.
7272

docling_core/types/__init__.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@
55

66
"""Define the main types."""
77

8-
from docling_core.types.gen.generic import Generic # noqa
9-
from docling_core.types.legacy_doc.base import BoundingBox # noqa
10-
from docling_core.types.legacy_doc.base import Table # noqa
11-
from docling_core.types.legacy_doc.base import TableCell # noqa
12-
from docling_core.types.legacy_doc.base import ( # noqa
13-
BaseCell,
14-
BaseText,
15-
PageDimensions,
16-
PageReference,
17-
Prov,
18-
Ref,
19-
)
20-
from docling_core.types.legacy_doc.document import ( # noqa
21-
CCSDocumentDescription as DocumentDescription,
22-
)
23-
from docling_core.types.legacy_doc.document import ( # noqa
24-
CCSFileInfoObject as FileInfoObject,
25-
)
26-
from docling_core.types.legacy_doc.document import ( # noqa
27-
ExportedCCSDocument as Document,
28-
)
29-
from docling_core.types.rec.record import Record # noqa
8+
from docling_core.types.doc.document import DoclingDocument
9+
from docling_core.types.gen.generic import Generic
10+
from docling_core.types.rec.record import Record

docling_core/utils/generate_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from docling_core.utils.generate_jsonschema import generate_json_schema
2020

21-
MODELS: Final = ["Document", "Record", "Generic"]
21+
MODELS: Final = ["DoclingDocument", "Record", "Generic"]
2222

2323

2424
def _prepare_directory(folder: str, clean: bool = False) -> None:

0 commit comments

Comments
 (0)