# Elasticsearch.py dump conversion

**URL:** <https://discuss.elastic.co/t/elasticsearch-py-dump-conversion/240939>\
**Category:** Elasticsearch\
**Created:** [July 13, 2020, 9:52am UTC](https://discuss.elastic.co/t/elasticsearch-py-dump-conversion/240939 "2020-07-13T09:52:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Koen\_Wouters1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/koen_wouters1/32/49030_2.png) [@Koen\_Wouters1](https://discuss.elastic.co/u/Koen_Wouters1)\
**Post date:** [July 13, 2020, 9:52am UTC](https://discuss.elastic.co/t/elasticsearch-py-dump-conversion/240939/1 "2020-07-13T09:52:06Z")

</div>

Up till now we used simple sh scripts to load JSON files as bulk to ES, but we want to change this to the python client. I am however struggling to figure out how we can do this without completely rewriting our JSON creation workflow.

Our format is very straightforward, one line with the index, next line with the content as in the shakespeare demo used by ES (snippet below)

```auto
{"index":{"_index":"shakespeare","_id":0}}
{"type":"act","line_id":1,"play_name":"Henry IV", "speech_number":"","line_number":"","speaker":"","text_entry":"ACT I"}

```

So my question is how I would be able to use this format (multiline JSON) with the elastic python package. Every example I can find is using either non multiline, and id generation is on the fly etc but preferably I'd like to use the same format as we have already.

or is this simply not feasible and do I need to iterate through each line to reconstruct it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2020, 9:52am UTC](https://discuss.elastic.co/t/elasticsearch-py-dump-conversion/240939/2 "2020-08-10T09:52:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
