markitdown

(★ 175,168)

Python tool for converting files and office documents to Markdown.

File Explorer

  • .dockerignore
  • .gitattributes
  • .gitignore
  • .pre-commit-config.yaml
  • CODE_OF_CONDUCT.md
  • Dockerfile
  • LICENSE
  • README.md
  • SECURITY.md
  • SUPPORT.md

# Installation Guide

python
Prerequisites

Setup Steps

git clone https://github.com/microsoft/markitdown.git

Clone the repository locally.

python -m venv .venv

Create a Python virtual environment.

source .venv/bin/activate

Activate the virtual environment.

pip install -e 'packages/markitdown[all]'

Install the package in editable mode with all optional dependencies.

Key Commands

pip install 'markitdown[all]'

Install MarkItDown and optional dependencies.

markitdown path-to-file.pdf -o document.md

Convert files to markdown.

Sanitize your inputs in untrusted environments as it performs I/O operations.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Release Timeline

Actively Maintained

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

conda activate

View Details ▼

Activate a conda environment.
See also: `conda deactivate`.

conda activate myenv

Activate an existing environment named `myenv`:

conda activate {{path/to/myenv}}

Activate an existing environment located at custom path:

conda activate --stack myenv

Stack `myenv` environment on top of a previous environment making libraries/commands/variables from both accessible:

🔍

conda create

View Details ▼

Create new conda environments.

conda create {{[-y|--yes]}} {{[-n|--name]}} py39 python=3.9 "numpy>=1.11" scipy

Create a new environment named `py39`, install Python 3.9, NumPy v1.11 or above in it, and the latest stable version of SciPy. Say yes to all confirmations:

conda create {{[-n|--name]}} myenv --file {{file1.yml}} --file {{file2.yml}}

Create a new environment named `myenv` and install packages listed in files:

conda create {{[-p|--prefix]}} {{path/to/myenv}}

Create a new environment at a custom path (i.e. prefix):

🔍

docker build

View Details ▼

Build an image from a Dockerfile.

docker build .

Build a Docker image using the Dockerfile in the current directory:

docker build {{github.com/creack/docker-firefox}}

Build a Docker image from a Dockerfile at a specified URL:

docker build {{[-t|--tag]}} {{name:tag}} .

Build a Docker image and tag it:

🔍

docker run

View Details ▼

This command is an alias of `docker container run`.

tldr docker container run

View documentation for the original command:

🔍

git clone

View Details ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

hatch

View Details ▼

Modern, extensible Python project manager.
See also: `poetry`.

hatch new {{project_name}}

Create a new Hatch project:

hatch new --init

Initialize Hatch for an existing project:

hatch build

Build a Hatch project:

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

pre-commit

View Details ▼

Create Git hooks that run before commits.

pre-commit install

Install pre-commit into your Git hooks:

pre-commit run

Run pre-commit hooks on all staged files:

pre-commit run --all-files

Run pre-commit hooks on all files, staged or unstaged:

🔍

python

View Details ▼

Python language interpreter.

python

Start a REPL (interactive shell):

python {{path/to/file.py}}

Execute a specific Python file:

python -i {{path/to/file.py}}

Execute a specific Python file and start a REPL:

🔍

uv venv

View Details ▼

Create an isolated Python environment for installing packages.

uv venv

Create a virtual environment in the default location (`.venv`):

uv venv {{path/to/venv}}

Create a virtual environment at a specific path:

uv venv {{[-p|--python]}} {{3.12}}

Create using a specific Python version:

# Project Badges

  • PyPI PyPI Visit
  • PyPI - Downloads PyPI - Downloads
  • Built by AutoGen Team Built by AutoGen Team Visit
// repository documentation