<commit_before># round-py: A Python client for the Gem API


`round-py` is still alpha code but is in active development. Bug reports and
patches welcome.


## Installing round-py:

### Ubuntu:

#### Prerequisites:

* A python 2.7 environment (your distro probably does this as part of the base system, but the nicer way is with `pyenv` and/or `virtualenv`). `coinop-py` is currently developed under 2.7.7.

* Git and a python extension build environment.

* libffi

#### Installing:

1. Ask us to add you to the round-py github repo (https://github.com/GemHQ/round-py). While you wait impatiently, continue with the following.


### Linux

1. Clone the git repository and run setup.py:

  ```bash
  $ sudo apt-get install gcc make libffi-dev python-dev python-pip git
  $ git clone <EMAIL>:GemHQ/round-py.git
  $ cd round-py
  $ sudo python setup.py install
  ```

  (if you're using a virtual environment, you obviously don't need to run
setup.py with sudo)

### Mac OSX:

1.  Install Xcode Command Line Tools
  ```bash
  $ xcode-select --install
  ```

1.  ```bash
  $ brew install libffi
  ```

1.  ```bash
  $ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/
  ```

1. clone the git repository and run setup.py:

  ```bash
  $ git clone <EMAIL>:GemHQ/round-py.git
  $ cd round-py
  $ python setup.py install
  ```<commit_msg>Updated README with Heroku/Mac OS X install<commit_after># round-py: A Python client for the Gem API


`round-py` is still alpha code but is in active development. Bug reports and
patches welcome.


## Installing round-py:

### Ubuntu:

#### Prerequisites:

* A python 2.7 environment (your distro probably does this as part of the base system, but the nicer way is with `pyenv` and/or `virtualenv`). `coinop-py` is currently developed under 2.7.7.

* Git and a python extension build environment.

* libffi

#### Installing:

1. Ask us to add you to the round-py github repo (https://github.com/GemHQ/round-py). While you wait impatiently, continue with the following.


### Linux

1. Clone the git repository and run setup.py:

  ```bash
  $ sudo apt-get install gcc make libffi-dev python-dev python-pip git
  $ git clone <EMAIL>:GemHQ/round-py.git
  $ cd round-py
  $ sudo python setup.py install
  ```

  (if you're using a virtual environment, you obviously don't need to run
setup.py with sudo)

### Mac OSX:

1.  Install Xcode Command Line Tools
  ```bash
  $ xcode-select --install
  ```

1.  ```bash
  $ brew install libffi libsodium
  ```

1.  ```bash
  $ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/
  ```

1. ```bash
  $ pip install PyNaCl PyYAML patchboard coinop
  ```

1. clone the git repository and run setup.py:

  ```bash
  $ git clone git@github.com:GemHQ/round-py.git
  $ cd round-py
  $ python setup.py develop **for production environments use `python setup.py install`***
  ```

### Heroku

[Heroku](http://www.heroku.com) introduces some complexities around libsodium ([PyNaCl](https://pynacl.readthedocs.org/en/latest/)), the cryptography library `round` uses.

1. Include the following in your `requirements.txt`.
  ```
  pycrypto
  cffi
  cryptography
  PyNaCl
  git+https://[GH_USERNAME]:[GH_PASSWORD_OR_ACCESS_TOKEN]@github.com/GemHQ/round-py.git#egg=round
  ```

1. Install the [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi) to allow multiple buildpacks
  ```bash
  $ heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
  ```

1. Add these lines to the *top* to your `.buildpacks` file.
  ```
  git://github.com/fletom/heroku-buildpack-python-libffi.git
  git://github.com/fletom/heroku-buildpack-libsodium.git
  ```

1. Set the `SODIUM_INSTALL` environment variable
  ```bash
  $ heroku config:set SODIUM_INSTALL=system
  ```

From here you should be able to `import round` into your heroku project without error. (Most errors related to `round` on Heroku will mention `<sodium.h>` or `cffi` -- this is because PyNaCl compiles on import, which is likely to change in the next major release, see [this discussion](https://github.com/pyca/pynacl/issues/79).)
{'fraction_non_alphanumeric': 0.12136627906976744, 'fraction_numerical': 0.008963178294573644, 'mean_word_length': 3.6550169109357387, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 7, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, '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': '841559', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1364, 'n_words': 463}