<commit_before><commit_msg>Add uploader docs<commit_after># Uploader


## Getting Started
A command-line Python script is available to help automate Heavy builds. It can upload patches, including abstractions, and place the results in the desired location. Any assets that are available through the website, including binary builds, are accessible for download. The script can also be integrated into IDE build processes.

* [Download](https://enzienaudio.com/static/uploader.py) the latest uploader script here.
* If necessary, download and install [Python 2](https://www.python.org/downloads/) for your operating system. Do not use Python 3.
* If necessary, install the `requests` Python module (it ensures that all of your communication with the Heavy Cloud is secure).
  * [Download](https://pip.pypa.io/en/stable/installing/) pip.
  * `pip install requests`


## Basic Usage
The most straightfoward use of the Uploader is to submit a patch, potentially consisting of many abstractions, and download C source code. This can easily be achieved with the following command line on OSX or Unix:

```
python uploader.py /path/to/patch --out /path/to/output --name heavy
```

On Windows you may need to add quotes the paths if there are spaces in any of the directory names:

```
python uploader.py "C:\path\to\patch directory" --out "C:\path\to\output" --name heavy
```

* The name of the patch, in this case heavy, must be the same as an existing project on the Heavy website. If a similarly-named project does not exist, the uploader will fail.
* The input to the uploader must be a directory, and the root patch in that directory must be called `_main.pd`.
* All Pd files in the `/path/to/patch` will be uploaded, including subdirectories. In this way, abstractions can also be included in the project. Files outside of the given root directory will not be uploaded.

The uploader will report basic basic statistics on success, e.g.:

```
c files placed in /path/to/output
Job URL: https://enzienaudio.com/h/dev/heavy/5KFkg
Total request time: 444ms
Heavy version: 2308
```

## Framework Generators
The source code for other frameworks can be downloaded with the `--gen` keyword. For instance the `vst2` argument downloads the VST source code.

```
python uploader.py /path/to/patch --out /path/to/output --name heavy --gen vst2
```

Available generators are:
* `c`: C
* `js`: Javascript
* `pdext`: Pd external
* `vst2`: VST 2.4
* `unity`: Unity audio plugin
* `wwise`: Wwise plugin

The `-b` keyword allows multiple frameworks to be downloaded simultaneously and each placed in their own unique directories.

```
python uploader.py /path/to/patch --out /path/to/output --name heavy --gen vst2 unity -b
```

In this case the output would look like:
```
unity files placed in /path/to/output/unity
vst2 files placed in /path/to/output/vst2
Job URL: https://enzienaudio.com/h/dev/heavy/qQmmj
Total request time: 903ms
Heavy version: 2308
```

## Downloading Binaries
The same `--gen` (or `-g`) keyword can be used to download compiled binaries from Heavy. The full list of supported framework/binary combinations are:
* `pdext-osx`: Pd external OSX Universal 32-/64-bit binary
* `unity-osx`: Unity OSX 64-bit Native plugin and Audio Mixer plugin
* `unity-win-x86`: Unity Windows 32-bit Native plugin and Audio Mixer plugin
* `unity-win-x86_64`: Unity Windows 64-bit Native plugin and Audio Mixer plugin
* `vst2-osx`: VST 2.4 OSX Universal 32-/64-bit plugin
* `vst2-win-x86_64`: VST 2.4 Windows 64-bit plugin
* `wwise-win-x86_64`: Wwise Windows 64-bit binary

For instance, if you were working on a VST and wanted to export the binary directly to the system's VST directory:

```
python uploader.py /path/to/patch --out /path/to/vst/directory --name heavy --gen vst2-osx
```

## Notes
* As Heavy is constantly being updated the upload response will also contain a number that indicates a particular version of the static files. Make sure to use all the files that are returned with each request.
* See a description of all flags with `python uploader.py --help`.
{'fraction_non_alphanumeric': 0.0918492982024132, 'fraction_numerical': 0.015759665107116475, 'mean_word_length': 4.103015075376884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2338372', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1146, 'n_words': 554}