<commit_before>cmd_utils
=========

Simple wrapper for subprocess and paramiko to enable simpler command execution both locally and remotely.


## Install ##
```
pip install cmd_utils
```
or
```
python setup.py install
```

## Examples ##
### Local ###
```python
import cmd_utils

working_dir = "/home/mark/a-git-repo"
command = "git diff-index --quiet HEAD --"

output = cmd_utils.run_cmd(command, target_dir)
```
### Remote ###
```python
import cmd_utils

host = "host.example.com"
username = "mark"
working_dir = "/home/mark/a-git-repo"
command = "git diff-index --quiet HEAD --"

output = cmd_utils.run_cmd(host, username, command, working_dir)
```
See `examples.py` for more usage examples.

Versions<commit_msg>Updated Readme to include dependancies and testing information.<commit_after>cmd_utils
=========

Simple wrapper for subprocess and paramiko to enable simpler command execution both locally and remotely.


## Install ##
```
pip install cmd_utils
```
or
```
python setup.py install
```

On Debian/Ubuntu `python-setuptools` and `python-dev` are required.

## Tests ##
Test are done with nosetests and require installation of nose
```
pip install nose

python setup.py test
```

## Examples ##
### Local ###
```python
import cmd_utils

working_dir = "/home/mark/a-git-repo"
command = "git diff-index --quiet HEAD --"

output = cmd_utils.run_cmd(command, target_dir)
```
### Remote ###
```python
import cmd_utils

host = "host.example.com"
username = "mark"
working_dir = "/home/mark/a-git-repo"
command = "git diff-index --quiet HEAD --"

output = cmd_utils.run_cmd(host, username, command, working_dir)
```
See `examples.py` for more usage examples.

Versions
{'fraction_non_alphanumeric': 0.1480597014925373, 'fraction_numerical': 0.0, 'mean_word_length': 4.605351170568562, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6550191', 'n_tokens_mistral': 556, 'n_tokens_neox': 518, 'n_words': 162}