How to run examples

We offer multiple ways to run GroupDocs.Markdown for Python via .NET code examples — build a project from scratch, run the examples repository from GitHub, or use Docker.

Build a project from scratch

Create a new Python project, install the package from PyPI, and run a minimal conversion script.

  1. Make sure you have Python 3.5 or later installed (64-bit).

  2. Create a directory for your project:

    mkdir my-markdown-app
    cd my-markdown-app
    
  3. Create and activate a virtual environment:

    python -m venv .venv
    # On Windows
    .venv\Scripts\activate
    # On Linux/macOS
    source .venv/bin/activate
    
  4. Install the GroupDocs.Markdown package:

    pip install groupdocs-markdown-net
    
  5. Create convert.py with the following code:

from groupdocs.markdown import MarkdownConverter

def convert():
    """Convert a document to Markdown using the instance API."""
    with MarkdownConverter("business-plan.docx") as converter:
        converter.convert("run-example-basic.md")

if __name__ == "__main__":
    convert()

business-plan.docx is sample file used in this example. Click here to download it.

![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAC0CAYAAABIf1IMAAAABHNCSVQICAgIfAhkiAAADcJJREFUeJzt3VFo3VWeB/BfF2EfdJraSWKkpovabiokaRZcfWiM4jCS0mELjvgwzlZt16fdlUFpKbLCgDKELQ7Oum+yNdYdH4StCLMkdBexSfow7sC0SUA7TZVJW0zbWI1OF/ap+xD+/97k/u/Nze1JbJLPBwo9/3vu/Z1/L5Qv55x7/uumJkauBQAAyfzZdz0AAIDVRsACAEhMwAIASEzAAgBI7Jaii//67/8dZ89dSlbkH576Qdy7+Y4F+6Wqq5566qmnnnrqqbdc9YoUBqyJyYsxevrcDQ2q1LdX/6+mfqnqqqeeeuqpp5566i1XvSKFAWvL5jti3bp1cXbyYvzpf+v/cACAtWhZZrAAANaSdUUHjf7sF7+eE7D+/qkfxL2t9a1BRszOiN12658v2O
[TRUNCATED]

Download full output

  1. Replace the document_path value with the actual path to the document you want to convert.

  2. Run the script:

    python convert.py
    
  3. The converted Markdown file converted.md will appear in the project directory.

Run examples from GitHub

A complete set of runnable examples is published in our GitHub repository. You can either clone the repository or download it as a ZIP archive.

  1. Clone the repository:

    git clone https://github.com/groupdocs-markdown/GroupDocs.Markdown-for-Python-via-.NET.git
    cd GroupDocs.Markdown-for-Python-via-.NET/Examples
    
  2. Create a virtual environment and install the dependencies:

    python -m venv .venv
    source .venv/bin/activate        # or .venv\Scripts\activate on Windows
    pip install -r requirements.txt
    
  3. (Optional) Place your GroupDocs license file named GroupDocs.Markdown.lic in the Examples directory to avoid evaluation watermarks.

  4. Run all examples at once:

    python run_all_examples.py
    
  5. Or run an individual example by executing its .py file directly. Each example is a small, self-contained script that converts a sample document.

Run examples in Docker

The repository ships with a Dockerfile so you can run the examples in an isolated Linux environment without installing Python locally:

docker build -t groupdocs-markdown-python .
docker run --rm -v "$(pwd)/output:/app/output" groupdocs-markdown-python

IDE setup

Any Python-capable IDE works with GroupDocs.Markdown for Python via .NET:

  • Visual Studio Code with the Python extension — auto-detects the .venv interpreter and provides IntelliSense from the installed package.
  • PyCharm — configure the project interpreter to point at your virtual environment, then run any example as a standard Python file.

Contribute

If you like to add or improve an example, we encourage you to contribute to the project. All examples in the repository are open source and can be freely used in your own applications. To contribute, fork the repository, edit the code, and open a pull request. We will review the changes and include them if they are useful.

Close
Loading

Analyzing your prompt, please hold on...

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