<commit_before># imongo
A MongoDB kernel for Jupyter.

This kernel wrappes the Mongo shell using [pexpect](https://github.com/pexpect/pexpect).
Meant to be used for educational purposes.

**Still in alpha. Use at own your risk**

Insipred by [bash_kernel](https://github.com/takluyver/bash_kernel) and [ipython_mysql_kernel](https://github.com/mmisono/ipython_mysql_kernel)

## TODO:
- Implement code completion functionality
- Add install script/instructions<commit_msg>Update README with install instructions<commit_after># imongo
A MongoDB kernel for Jupyter.

This kernel wrappes the Mongo shell using 
[pexpect](https://github.com/pexpect/pexpect).
Meant to be used for educational purposes.

Insipred by [bash_kernel](https://github.com/takluyver/bash_kernel)
 and [ipython_mysql_kernel](https://github.com/mmisono/ipython_mysql_kernel)

-----------
## How to install:

### Requirements
IMongo requires IPython/Jupyter and MongoDB.

#### MongoDB
On macOS, use [Homebrew](http://brew.sh/): `brew install mongodb`
For other platforms, please refer to the MongoDB [documentation](https://docs.mongodb.com/manual/installation/) 

#### IPython/Jupyter
I recommend using the [Anaconda](https://www.continuum.io/downloads) Python distribution.
To setup a minimal test environment for the kernel:
```
$ conda create -n imongoenv jupyter
```

### Kernel installation:

Using `pip`: `pip install git+https://github.com/gusutabopb/imongo`

Using `setuptools`:
```
$ git clone https://github.com/gusutabopb/imongo
$ cd imongo
$ python setup.py install
```

Both methods install the `imongo` package and configure
Jupyter to be used with the new kernel by installing a 
[kernel spec](https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernel-specs)

-----------

## Uninstall:

- Remove library: `pip uninstall imongo`
- Remove kernel spec: `jupyter kernelspec remove imongo`

-----------

## TODO:
- Implement code completion functionality
{'fraction_non_alphanumeric': 0.12815234173957799, 'fraction_numerical': 0.0, 'mean_word_length': 4.684210526315789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 11, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1706554', 'n_tokens_mistral': 652, 'n_tokens_neox': 613, 'n_words': 177}