Code Monkey home page Code Monkey logo

imongo's Introduction

imongo

This repository is a non-official fork of the IMongo project.

It differs from the official version in the following ways:

  • it works with Jupyter Books;
  • it does not prettify the outputs;
  • the install method described below is supposed to work properly.

A MongoDB kernel for Jupyter. Mainly for educational purposes.

This kernel wraps the Mongo shell using pexpect and was inspired by bash_kernel and ipython_mysql_kernel. It uses Renderjson for JSON pretty-printing.

IMongo in action

IMongo in action

How to install

Major requirements

IMongo requires Jupyter and MongoDB.

Install MongoDB

On macOS, use Homebrew: brew install mongodb

For other platforms, please refer to the MongoDB documentation

Install Jupyter and IMongo Kernel from this github repository

To install Jupyter, IMongo and all other dependencies from this repository, use pip install:

$ pip install git+git://github.com/rtavenar/imongo.git#egg=imongo-kernel

The following installation instructions rather install the official IMongo versions.

Install Jupyter and IMongo Kernel using conda

Although the installation with pip works fine , we recommend using the conda package manager to create a virtual environment. You need to have either Anaconda or Miniconda installed.

$ conda create -n imongo jupyter "python>3.6"
$ source activate imongo
$ pip install imongo-kernel

Both methods install the imongo package and configure Jupyter to be used with the new kernel by installing a kernel spec.

Configuration (optional)

MongoDB configuration such as host/port can be passed as a YAML file, located at the Jupyter configuration directory. The default path for UNIX systems is ~/.jupyter/imongo_config.yml. The options available are the same as the ones available for the mongo CLI tool. This configuration is necessary in case your MongoDB instance has authentication enabled, runs at a non-standard port, or runs on a remote (non-localhost) location.

Sample imongo_config.yml:

host: some.host.io
port: 27017
username: username
password: password
authenticationDatabase: admin
quiet: null

If imongo_config.yml doesn't exist or is empty, IMongo will attempt to connect to the MongoDB instance at localhost:27017, without any user authentication.

Uninstall:

# Remove library:
$ pip uninstall imongo
# Remove kernel spec
$ jupyter kernelspec remove imongo

TODO:

  • Implement code completion functionality
  • Fix long command issue
  • Send Mongo shell Javascript errors/exceptions to stderr

imongo's People

Contributors

gusutabopb avatar rtavenar avatar

Stargazers

 avatar

Watchers

 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.