[issue34393] json.dumps - allow compression

liad report at bugs.python.org
Mon Aug 13 07:34:23 EDT 2018


New submission from liad <liad at mailinator.com>:

The list of arguments of json.dump() can be seen here: https://docs.python.org/2/library/json.html

Notice that there is no way to make compression.

For example pandas allows you to do:
        df.to_csv(path_or_buf=file_name, index=False, encoding='utf-8',
                  compression='gzip',
                  quoting=QUOTE_NONNUMERIC)

I want to be able to compress when I do:
    with open('products.json', 'w') as outfile:
        json.dump(data, outfile, sort_keys=True)


Please add the ability to compress using json.dump()

----------
messages: 323475
nosy: liad100
priority: normal
severity: normal
status: open
title: json.dumps - allow compression
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34393>
_______________________________________


More information about the Python-bugs-list mailing list