<commit_before># AppDash: Python

## Setup

To install appdash for python you'll first need to install Google's protobuf, the Twisted networking library, and a RFC3339 support library through the standard `easy_install` and `pip` python package manager commands:

```
# (Ubuntu/Linux) Install easy_install and pip:
sudo apt-get install python-setuptools python-pip

# Install Google's protobuf:
easy_install protobuf

# Install Twisted networking:
easy_install twisted

# Install strict-rfc3339
pip install strict-rfc3339
```

Depending on where Python is installed and/or what permissions the directory has, you may need to run the above `easy_install` and `pip` commands as root.

## Testing

If all is well with your setup, you should be able to change directory to here and run the example:

```
# Run appdash server in separate terminal:
appdash serve

# Run the example script:
cd $GOPATH/src/sourcegraph.com/sourcegraph/appdash/python
./example.py
```

## Integration

TODO(slimsag): integrate nicely with common Python HTTP frameworks.
TODO(slimsag): provide way to easily install python' appdash module.
<commit_msg>python: update README.md to mention separate Twisted integration.<commit_after># AppDash: Python

## Setup

To install appdash for python you'll first need to install a few things through the standard `easy_install` and `pip` python package managers:

```
# (Ubuntu/Linux) Install easy_install and pip:
sudo apt-get install python-setuptools python-pip

# Install Google's protobuf:
easy_install protobuf

# Install Twisted networking (optional, only needed for Twisted integration):
easy_install twisted

# Install strict-rfc3339
pip install strict-rfc3339
```

Depending on where Python is installed and/or what permissions the directory has, you may need to run the above `easy_install` and `pip` commands as root.

## Twisted Example

If all is well with your setup, you should be able to change directory to `sourcegraph.com/sourcewgraph/appdash/python` and run the Twisted example:

```
# Run appdash server in separate terminal:
appdash serve

# Run the example script:
cd $GOPATH/src/sourcegraph.com/sourcegraph/appdash/python
./example_twisted.py
```

## TODO

- Integrate nicely with common Python HTTP frameworks.
- Provide a way to easily install python' appdash module.

{'fraction_non_alphanumeric': 0.07149046793760831, 'fraction_numerical': 0.008665511265164644, 'mean_word_length': 5.013020833333333, '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': '1019358', 'n_tokens_mistral': 686, 'n_tokens_neox': 633, 'n_words': 283}