Giter Club home page Giter Club logo

ipython-elasticsearch's Introduction

ipython-elasticsearch

Author: Gilad Raphaelli, http://g.raphaelli.com

Adds %elasticsearch magic.

Examples

notebook example
In [1]: %load_ext elasticsearch

In [2]: %%elasticsearch
...: PUT twitter
...: {
...:   "mappings": {
...:     "tweet": {
...:       "properties": {
...:         "message": {
...:           "type": "string"
...:         }
...:       }
...:     }
...:   }
...: }
...:
Out[2]: {'acknowledged': True}

Defaults endpoint http://localhost:9200:

In [3]: %elasticsearch
Using: http://localhost:9200/

Configure endpoint for the whole notebook:

In [4]: %elasticsearch http://my.host.es:1234/
Using: http://my.host.es:1234/

In [5]: %elasticsearch
Using: http://my.host.es:1234/

In [6]: %elasticsearch http://localhost:9200/
Using: http://localhost:9200/

Use a different endpoint for one cell:

In [7]: %%elasticsearch http://my.host.es:1234/
        GET /

Out[7]:
{'cluster_name': 'elasticsearch',
 'name': 'my.host.es',
 'tagline': 'You Know, for Search',
 'version': {'build_hash': 'de54438d6af8f9340d50c5c786151783ce7d6be5',
 'build_snapshot': False,
 'build_timestamp': '2015-10-22T08:09:48Z',
 'lucene_version': '5.2.1',
 'number': '2.0.0'}}

In [8]: %elasticsearch
Using: http://localhost:9200/

Installing

Install the lastest release with:

pip install ipython-elasticsearch

or clone from https://github.com/graphaelli/ipython-elasticsearch and:

cd ipython-elasticsearch
python setup.py install

Development

https://github.com/graphaelli/ipython-elasticsearch

Todo

  • configurables - default elasticsearch endpoint - renderjson styles
  • appropriate default output in console
  • contextual help

Credit

ipython-elasticsearch's People

Contributors

graphaelli avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.