Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Shevtsov committed Oct 19, 2023
1 parent 020f5ff commit 5bdfb90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def extract_metadata(self,
other_fields: Optional[dict] = None) -> Dict[str]:
"""
Add the predefined list of metadata for the pdf documents.
Look to the :meth:`~dedoc.metadata_extractors.AbstractMetadataExtractor.add_metadata` documentation to get the information about parameters.
Look to the :meth:`~dedoc.metadata_extractors.AbstractMetadataExtractor.extract_metadata` documentation to get the information about parameters.
"""
result = super().extract_metadata(directory=directory, filename=filename, converted_filename=converted_filename,
original_filename=original_filename, parameters=parameters, other_fields=other_fields)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/_static/code_examples/dedoc_usage_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@

"""Using metadata extractors"""
metadata_extractor = DocxMetadataExtractor()
metadata_extractor.can_extract(document, file_dir, file_name, file_name, file_name) # True
document = metadata_extractor.add_metadata(document, file_dir, file_name, file_name, file_name)
metadata_extractor.can_extract(file_dir, file_name, file_name, file_name) # True
document.metadata = metadata_extractor.extract_metadata(file_dir, file_name, file_name, file_name)
document.metadata # {'file_name': 'example.docx', 'file_type': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'size': 373795,
# 'access_time': 1686825619, 'created_time': 1686825617, 'modified_time': 1686823541, 'other_fields': {'document_subject': '', 'keywords': '',
# 'category': '', 'comments': '', 'author': '', 'last_modified_by': '', 'created_date': 1568725611, 'modified_date': 1686752726,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ the metadata extractor can extract metadata from the given file:
:language: python
:lines: 78

To extract metadata, one can add them to the document using :meth:`~dedoc.metadata_extractors.DocxMetadataExtractor.add_metadata` method.
To extract metadata, one can add them to the document using :meth:`~dedoc.metadata_extractors.DocxMetadataExtractor.extract_metadata` method.

.. literalinclude:: ../_static/code_examples/dedoc_usage_tutorial.py
:language: python
:lines: 79-83
:lines: 77-83

As we see, the attribute ``metadata`` has been filled with some metadata fields.
The list of common fields for any metadata extractor along with the specific fields
Expand Down

0 comments on commit 5bdfb90

Please sign in to comment.