<commit_before>Sulley (Beta)
=========================

![<NAME> from Monsters, Inc.](http://i.imgur.com/KvSWLHo.png)

With Sulley, you can build SMS bots in just a few lines of code. Powered by Twilio & Plivo, it requires very minimal configuration and code to bring your SMS bot to life!

This project is inspired from Shuai Lin's [slackbot](https://github.com/lins05/slackbot).

## Installation

### From PyPI

Sulley can be installed from PyPI by running the following command:

```bash
pip install sulley
```

### From source code

* Get the source code by cloning the repository

```bash
git clone https://github.com/sandeepraju/sulley.git
```

* In the project directory, run the `setup.py`

```bash
cd sulley/
python setup.py install
```

## Getting started

Let us create a simple SMS bot using Sulley that greets it's users.

* Create a file called `app.py`.
* Add the following to your `app.py` file.

```python
from sulley import Sulley

bot = Sulley()

bot.reply_to(r'hi')
def say_hello(message):
    message.reply('hello!')

if __name__ == '__main__':
    bot.run()
```

* Grab a copy of `config.json` from [here](./config.json) and place it in the same directory as `app.py`.
* Configure Sulley to use Twilio or Plivo by modifying `key`, `secret` and `phone` in the config.
* Now, run the app using the following command:

```bash
python app.py
```

## More Examples

### Binding functions that reply to simple commands

```python
bot.reply_to(r'hi')
def say_hello(message):
    message.reply('hello!')
```

### Bind multiple commands to a single function

```python
bot.reply_to(r'hi')
bot.reply_to(r'hey')
def say_hello(message):
  message.reply('hello')
```

### More complex command matching rules using regex

```python
bot.reply_to(r'[0-9]abc')
def say_hello(message):
  message.reply('hello')
```

### Pass native regex objects for more flexibility

```python
@bot.reply_to(re.compile('^list', re.IGNORECASE))
def launch(message):
    message.reply('listing items')
```

For more examples, check out the [examples file](./examples.py).

## Configuration details
<commit_msg>fixes typo in a few code snippets on README<commit_after>Sulley (Beta)
=========================

![<NAME> from Monsters, Inc.](http://i.imgur.com/KvSWLHo.png)

With Sulley, you can build SMS bots in just a few lines of code. Powered by Twilio & Plivo, it requires very minimal configuration and code to bring your SMS bot to life!

This project is inspired from <NAME>'s [slackbot](https://github.com/lins05/slackbot).

## Installation

### From PyPI

Sulley can be installed from PyPI by running the following command:

```bash
pip install sulley
```

### From source code

* Get the source code by cloning the repository

```bash
git clone https://github.com/sandeepraju/sulley.git
```

* In the project directory, run the `setup.py`

```bash
cd sulley/
python setup.py install
```

## Getting started

Let us create a simple SMS bot using Sulley that greets it's users.

* Create a file called `app.py`.
* Add the following to your `app.py` file.

```python
from sulley import Sulley

bot = Sulley()

@bot.reply_to(r'hi')
def say_hello(message):
    message.reply('hello!')

if __name__ == '__main__':
    bot.run()
```

* Grab a copy of `config.json` from [here](./config.json) and place it in the same directory as `app.py`.
* Configure Sulley to use Twilio or Plivo by modifying `key`, `secret` and `phone` in the config.
* Now, run the app using the following command:

```bash
python app.py
```

## More Examples

### Binding functions that reply to simple commands

```python
@bot.reply_to(r'hi')
def say_hello(message):
    message.reply('hello!')
```

### Bind multiple commands to a single function

```python
@bot.reply_to(r'hi')
@bot.reply_to(r'hey')
def say_hello(message):
  message.reply('hello')
```

### More complex command matching rules using regex

```python
@bot.reply_to(r'[0-9]abc')
def say_hello(message):
  message.reply('hello')
```

### Pass native regex objects for more flexibility

```python
@bot.reply_to(re.compile('^list', re.IGNORECASE))
def launch(message):
    message.reply('listing items')
```

For more examples, check out the [examples file](./examples.py).

## Configuration details

{'fraction_non_alphanumeric': 0.14417613636363635, 'fraction_numerical': 0.001893939393939394, 'mean_word_length': 4.544619422572178, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2156548', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1348, 'n_words': 487}