# Using Elasticsearch Spark adapter in Jupyter notebooks with Python kernel

**URL:** <https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [November 27, 2015, 1:04pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761 "2015-11-27T13:04:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michele\_crudele](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@michele\_crudele](https://discuss.elastic.co/u/michele_crudele)\
**Post date:** [November 27, 2015, 1:04pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761/1 "2015-11-27T13:04:07Z")

</div>

Hi,

I used in the past the elasticsearch spark adapter in Jupyter notebooks with scala kernel adding the dependencies with the %AddJar file:///.../elasticsearch-spark\_2.10-2.1.0.BUILD-SNAPSHOT.jar

I need to port my notebooks to Python, using the Python kernel. Is the Python binding available for elasticsearch ? And if so, how can I specify the dependency in the notebook ? (%AddDeps and %AddJar not available for python kernel).  
I'd be grateful if you can point me to any documentation available / sample Jupyter notebook that can help me.

Thanks alot,

- Michele

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [November 27, 2015, 1:23pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761/2 "2015-11-27T13:23:05Z")

</div>

ES-Hadoop/Spark is available only for the JVM, there's no native Python binding for it.  
I'm not familiar enough with Python however you could work with ES by relying on the `Input/OutputFormat`; that is by pulling in the Map/Reduce layer as explained [here](https://www.elastic.co/guide/en/elasticsearch/hadoop/master/spark.html#spark-python).  
Note this is still standard Spark and in fact, it is Spark that picks up the formats and uses it internally.

---

<div class="post-metadata">

**Author:** ![michele\_crudele](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@michele\_crudele](https://discuss.elastic.co/u/michele_crudele)\
**Post date:** [November 27, 2015, 4:41pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761/3 "2015-11-27T16:41:28Z")

</div>

Thanks Costin, I'll try the mapreduce layer.  
What are the benefits of using it in comparison with direct usage of  
elasticsearch-py python library in my notebooks?  
Il 27/nov/2015 02:33 PM, "Costin Leau" [noreply@discuss.elastic.co](mailto:noreply@discuss.elastic.co) ha  
scritto:

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [December 8, 2015, 2:04pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761/4 "2015-12-08T14:04:52Z")

</div>

The docs [cover] this aspect as well.

---

<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:** [July 6, 2017, 1:27pm UTC](https://discuss.elastic.co/t/using-elasticsearch-spark-adapter-in-jupyter-notebooks-with-python-kernel/35761/5 "2017-07-06T13:27:01Z")

</div>


