To check what examples are available, open the run_examples.py file in your favorite text editor. Uncomment examples you want to run and type python run_examples.py to start them.
Build project from scratch
If you prefer to create a project from scratch, follow these steps:
Step 1: Install GroupDocs.Parser
Install GroupDocs.Parser for Python via .NET using pip:
pip install groupdocs-parser-net
Step 2: Create a Python Script
Create a new Python file (e.g., example.py) and add the following code:
fromgroupdocs.parserimportParserdefextract_text_from_document():# Create an instance of Parser classwithParser("./sample.docx")asparser:# Extract text from the documenttext_reader=parser.get_text()iftext_readerisnotNone:# Print the extracted textextracted_text=text_readerprint(extracted_text)else:print("Text extraction isn't supported for this format")if__name__=="__main__":extract_text_from_document()
The following sample file is used in this example: sample.docx
The following sample file is used in this example: sample.pdf
Contribute
If you like to add or improve an example, we encourage you to contribute to the project. All examples in this repository are open-source and can be freely used in your own applications.
To contribute, you can fork the repository, edit the source code and create a pull request. We will review the changes and include them in the repository if found helpful.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.