# Prodigy input stream as MySQL

**URL:** <https://support.prodi.gy/t/prodigy-input-stream-as-mysql/1241>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [February 26, 2019, 12:03pm UTC](https://support.prodi.gy/t/prodigy-input-stream-as-mysql/1241 "2019-02-26T12:03:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilayparikh](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nilayparikh/32/645_2.png) [@nilayparikh](https://support.prodi.gy/u/nilayparikh)\
**Post date:** [February 26, 2019, 12:03pm UTC](https://support.prodi.gy/t/prodigy-input-stream-as-mysql/1241/1 "2019-02-26T12:03:13Z")

</div>

Hi,

I have data collector jobs creating (to be) annotation batches in MySQL, is there an example or reference to look up for the customs recipes, where I can load data directly into annotation tool, instead of JSONP.

Any guidance would be great.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 26, 2019, 3:33pm UTC](https://support.prodi.gy/t/prodigy-input-stream-as-mysql/1241/2 "2019-02-26T15:33:45Z")

</div>

Prodigy streams are Python generators that yield examples – so if you can write a function that loads data from your MySQL database and yields out a dictionary for each example, you can plug it into Prodigy. You can do this via a [custom recipe](https://prodi.gy/docs/workflow-custom-recipes) or with a [custom loader script](https://prodi.gy/docs/cookbook#loaders) whose output you pipe forward.

Here’s a pseudocode example:

```python
def custom_stream():
    texts = load_data_from_your_mysql_database()
    for text in texts:
        yield {'text': text}

```

---

<div class="post-metadata">

**Author:** ![nilayparikh](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nilayparikh/32/645_2.png) [@nilayparikh](https://support.prodi.gy/u/nilayparikh)\
**Post date:** [February 26, 2019, 5:47pm UTC](https://support.prodi.gy/t/prodigy-input-stream-as-mysql/1241/3 "2019-02-26T17:47:30Z")

</div>

Thanks, really appreciate.
