<commit_before># ipython-pip
Allows IPython notebook extension writers to make their extension pip installable!

Specifically, if you have a module that you've written which is intended for use in the IPython notebook and also has Javascript associated with it, this is designed to solve the distribution problem.

## Copy&paste
In setup.py

```python
try:
    from ipythonpip import cmdclass
except:
    cmdclass = lambda *args: None
```

and inside the `setup(...)` call

```python
    install_requires=["ipython-pip"],
    cmdclass=cmdclass('myplugin', 'myplugin/init'),
```

## Details
You **don't** need to download this to use it!  Instead you just need to modify your package's `setup.py` to download it at install time.

The following example assumes a folder structure like this:
```
./myplugin/__init__.py
./myplugin/init.js
./setup.py
```

Starting with a setup.py file that looks like this:
```python
# -*- coding: utf-8 -*-
from setuptools import setup

setup(
    name='myplugin',
    packages=['myplugin'],
    # ... more setup.py stuff here ...
)
```

All you need to do is add a try import block and two entries to the setup call to make the project nbextension compatabile:
```python
# -*- coding: utf-8 -*-
from setuptools import setup

try:
    from ipythonpip import cmdclass
except:
    cmdclass = lambda *args: None

setup(
    name='myplugin',
    packages=['myplugin'],
    # ... more setup.py stuff here ...<commit_msg>Fix bug in copy&paste code<commit_after># ipython-pip
Allows IPython notebook extension writers to make their extension pip installable!

Specifically, if you have a module that you've written which is intended for use in the IPython notebook and also has Javascript associated with it, this is designed to solve the distribution problem.

## Copy&paste
In setup.py

```python
try:
    from ipythonpip import cmdclass
except:
    import pip, importlib
    pip.main(['install', 'ipython-pip']); cmdclass = importlib.import_module('ipythonpip').cmdclass
```

and inside the `setup(...)` call

```python
    install_requires=["ipython-pip"],
    cmdclass=cmdclass('myplugin', 'myplugin/init'),
```

## Details
You **don't** need to download this to use it!  Instead you just need to modify your package's `setup.py` to download it at install time.

The following example assumes a folder structure like this:
```
./myplugin/__init__.py
./myplugin/init.js
./setup.py
```

Starting with a setup.py file that looks like this:
```python
# -*- coding: utf-8 -*-
from setuptools import setup

setup(
    name='myplugin',
    packages=['myplugin'],
    # ... more setup.py stuff here ...
)
```

All you need to do is add a try import block and two entries to the setup call to make the project nbextension compatabile:
```python
# -*- coding: utf-8 -*-
from setuptools import setup

try:
    from ipythonpip import cmdclass
except:
    import pip, importlib
    pip.main(['install', 'ipython-pip']); cmdclass = importlib.import_module('ipythonpip').cmdclass

setup(
    name='myplugin',
    packages=['myplugin'],
    # ... more setup.py stuff here ...
{'fraction_non_alphanumeric': 0.11499838030450275, 'fraction_numerical': 0.0012957563977972141, 'mean_word_length': 3.847723704866562, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2418932', 'n_tokens_mistral': 944, 'n_tokens_neox': 896, 'n_words': 364}