Quick Start Guide

This guide provides a quick overview of how to set up and start using GroupDocs.Parser for Python via .NET. The library opens a document and extracts its text, tables, images, metadata and more, whatever the format.

Prerequisites

To proceed, make sure you have:

  1. Configured environment as described in the System Requirements topic.
  2. Optionally you may Get a Temporary License to test all the product features.

Set Up Your Development Environment

For best practices, use a virtual environment to manage dependencies in Python applications. Learn more about virtual environments at the Create and Use Virtual Environments documentation topic.

Create and Activate a Virtual Environment

Create a virtual environment:

py -m venv .venv
python3 -m venv .venv
python3 -m venv .venv

Activate a virtual environment:

.venv\Scripts\activate
source .venv/bin/activate
source .venv/bin/activate

Install groupdocs-parser-net Package

After activating the virtual environment, run the following command in your terminal to install the latest version of the package:

py -m pip install groupdocs-parser-net
python3 -m pip install groupdocs-parser-net
python3 -m pip install groupdocs-parser-net

Ensure the package is installed successfully. You should see the message

Successfully installed groupdocs-parser-net-*
Note
Version 26.10 is not on PyPI yet: until it is, pip install groupdocs-parser-net installs 25.12. Install the 26.10 wheel for your platform from the GroupDocs Releases website instead, as described in Install from a Pre-Downloaded Wheel.

Example 1: Extract text

To quickly test the library, let’s extract the text of a PDF report.

import os
from groupdocs.parser import Parser, License

def extract_text():
    # Optionally set a license
    license_path = os.path.abspath("./GroupDocs.Parser.lic")
    if os.path.exists(license_path):
        License().set_license(license_path)

    # Open the document and extract its text
    with Parser("./sample.pdf") as parser:
        text = parser.get_text()

        if text is None:
            print("Text extraction isn't supported for this format")
        else:
            print(text)

if __name__ == "__main__":
    extract_text()

sample.pdf is the sample file used in this example. Click here to download it.

Investor relations


Annual Report 2025  |  Port Ellery
Annual Report 2025


1. Overview
Harbor Lane Provisions supplies specialty food to 1,265 independent grocers, cafes and restaurants from its
Quayside warehouse in Port Ellery. In 2025 net revenue grew 15.1% to $21.4 million, driven by the Autumn
[TRUNCATED]

Download full output

Your folder tree should look similar to the following directory structure:

📂 demo-app
 ├──extract_text.py
 ├──sample.pdf
 └──GroupDocs.Parser.lic (Optionally)

Run the App

py extract_text.py
python3 extract_text.py
python3 extract_text.py

After running the app you can deactivate the virtual environment by executing deactivate or closing your shell.

Explanation

  • Parser("./sample.pdf"): Opens the document. Used as a context manager so the native document handle is released.
  • parser.get_text(): Extracts the text of the whole document as a str, or returns None for a format that has no text extraction. Pass a page index, as in get_text(0), to extract one page.

Example 2: Read metadata

In this example we read the document properties of the same report: its title, subject, author and dates.

import os
from groupdocs.parser import Parser, License

def extract_metadata():
    # Optionally set a license
    license_path = os.path.abspath("./GroupDocs.Parser.lic")
    if os.path.exists(license_path):
        License().set_license(license_path)

    # Open the document and print each metadata item
    with Parser("./sample.pdf") as parser:
        metadata = parser.get_metadata()

        if metadata is None:
            print("Metadata extraction isn't supported for this format")
        else:
            for item in metadata:
                print(item.name, "=", item.value)

if __name__ == "__main__":
    extract_metadata()

sample.pdf is the sample file used in this example. Click here to download it.

title = Harbor Lane Provisions - Annual Report 2025
subject = Annual report and financial summary
keywords = annual report, wholesale, Autumn Harvest, revenue, logistics
author = Amara Osei
application = Aspose Pty Ltd.
last-saved-time = 2/16/2026 12:00:00 PM

Download full output

Run the App

py extract_metadata.py
python3 extract_metadata.py
python3 extract_metadata.py

Explanation

  • parser.get_metadata(): Returns the document’s metadata items, or None for a format without metadata extraction.
  • item.name / item.value: The name and the value of each property, such as title or author.

Example 3: Extract tables

Sometimes you need the data of a document rather than its text. get_tables() returns each table with its rows and cells.

import os
from groupdocs.parser import Parser, License

def extract_tables():
    # Optionally set a license
    license_path = os.path.abspath("./GroupDocs.Parser.lic")
    if os.path.exists(license_path):
        License().set_license(license_path)

    # Open the document and print each table row by row
    with Parser("./sample.pdf") as parser:
        tables = parser.get_tables()

        if tables is None:
            print("Table extraction isn't supported for this format")
            return

        for table in tables:
            print("Table on page", table.page.index + 1)
            for row in range(table.row_count):
                cells = [table[row, column].text for column in range(table.column_count)]
                print(" | ".join(cells))

if __name__ == "__main__":
    extract_tables()

sample.pdf is the sample file used in this example. Click here to download it.

Table on page 1
Metric | 2024 | 2025 | Change
Net revenue | $18.6 m | $21.4 m | +15.1%
Gross margin | 31.2% | 32.8% | +1.6 pts
Orders shipped | 48,900 | 55,300 | +13.1%
Wholesale customers | 1,140 | 1,265 | +11.0%
On-time delivery | 96.1% | 97.4% | +1.3 pts
Table on page 3
Category | Revenue | Share | Growth
Coffee & Tea | $5.9 m | 27.6% | +18.4%
[TRUNCATED]

Download full output

Run the App

py extract_tables.py
python3 extract_tables.py
python3 extract_tables.py

Explanation

  • parser.get_tables(): Returns the tables of the document, or None for a format without table extraction.
  • table.page.index: The zero-based index of the page the table is on.
  • table[row, column].text: The text of one cell; row_count and column_count give the table’s size.

Next Steps

After completing the basics, explore additional resources to enhance your usage:

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.