Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Shevtsov committed Sep 19, 2023
1 parent 8a5101e commit e20ca3b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dedoc/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = ""
__version__ = "0.11.2"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from docs.source._static.code_examples.djvu_converter import DjvuConverter
from docs.source._static.code_examples.pdf_reader import PdfReader
from dedoc import DedocManager
from djvu_converter import DjvuConverter
from pdf_reader import PdfReader
import os
import mimetypes

Expand Down Expand Up @@ -27,3 +28,11 @@

document = pdf_reader.read(file_path, parameters={"with_attachments": "true"})
print(list(vars(document))) # ['tables', 'lines', 'attachments', 'warnings', 'metadata']


manager = DedocManager()
result = manager.parse(file_path=file_path, parameters={})

print(result) # <dedoc.data_structures.ParsedDocument>
print(result.to_dict()) # OrderedDict([('version', ''), ('warnings', []), ('content', OrderedDict([('structure', OrderedDict([('node_id', '0'), ('text', ''), ('annotations', []), ('metadata', OrderedDict([('page_id', 0), ('line_id', 0), ('paragraph_type', 'root'), ('other_fields', {})])), ...

2 changes: 1 addition & 1 deletion docs/source/_static/code_examples/pdf_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from dedoc.data_structures.unstructured_document import UnstructuredDocument
from dedoc.extensions import recognized_extensions, recognized_mimes
from dedoc.readers.base_reader import BaseReader
from docs.source._static.code_examples.pdf_attachment_extractor import PdfAttachmentsExtractor
from pdf_attachment_extractor import PdfAttachmentsExtractor


class PdfReader(BaseReader):
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/add_new_doc_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ The imports of the classes described above should be added to the beginning of t
Then you need to add classes to the dictionary in function :meth:`get_manager_config` as follows:

.. literalinclude:: ../_static/code_examples/get_manager_config_example_new_doctype.py
.. literalinclude:: ../_static/code_examples/manager_config_example_new_doctype.py
:language: python
:lines: 9-29

Expand Down

0 comments on commit e20ca3b

Please sign in to comment.