Python HOW: Migrate Prodigy Database to MySQL or PostgreSQL Using Python

Gabriel Harris Ph.D.
3 min readOct 13, 2020

Learn how to save Prodigy annotations in a remote database for collaborative annotating

Photo edited by the author from prodi.gy

Prodigy is developed by Explosion AI, the folks behind spaCy, so it integrates with it organically 🍻. This article describes in detail how to migrate the default local SQLite database schema into a remote MySQL or PostgreSQL database

TL;DR: full code

Default Database 📍

The first time you run Prodigy, it will create a folder names .prodigy in your home directory with 2 files:

By default, Prodigy looks for its configuration in prodigy.json which has the default database "db": "sqlite”. So, by default, annotations are saved in the SQLite database prodigy.db. This is great to start labelling your data straight away without having to worry about where to save them

Remote Server 🌍

If the task requires multiple annotators, or you want to save your annotations on a remote MySQL or PostgreSQL server, you…

--

--

Gabriel Harris Ph.D.

I’m an End-to-End Lead Data Scientist and Data Science Manager. My articles are love letters to my future self