Quickstart: Extract text from a file in Python
mainTo extract the text content and metadata from a local file as a string using Python, use the Extractor.extract_file_to_string method. You can also configure the maximum length of the extracted string using set_extract_string_max_length.
from extractous import Extractor
# Create a new extractor
extractor = Extractor()
extractor = extractor.set_extract_string_max_length(1000)
# if you need an xml
# extractor = extractor.set_xml_output(True)
# Extract text from a file
result, metadata = extractor.extract_file_to_string("README.md")
print(result)
print(metadata)