import requests


def upload(data):
    r = requests.post('https://coveralls.io/api/v1/jobs', files={
        'json_file': data
    })

    try:
        print(r.json())
    except ValueError:
        raise Exception('Failure to submit data. Response [%s]: %s' % (r.status_code, r.text))  # NOQA

@@ -1,8 +1,20 @@
+import gzip%0A
 import r
@@ -128,20 +128,63 @@
 _file': 
-data
+('json_file', gzip.compress(data), 'gzip/json')
 %0A    %7D)%0A

Compress data sent to Coveralls using gzip