@@ -2412,11 +2412,36 @@ class StataWriter(StataParser):
24122412 variable_labels : dict
24132413 Dictionary containing columns as keys and variable labels as values.
24142414 Each label must be 80 characters or smaller.
2415- {compression_options}
2415+ compression : str or dict, default 'infer'
2416+ For on-the-fly compression of the output data. If 'infer' and 'fname' is
2417+ path-like, then detect compression from the following extensions: '.gz',
2418+ '.bz2', '.zip', '.xz', '.zst', '.tar', '.tar.gz', '.tar.xz' or '.tar.bz2'
2419+ (otherwise no compression).
2420+ Set to ``None`` for no compression.
2421+ Can also be a dict with key ``'method'`` set
2422+ to one of {``'zip'``, ``'gzip'``, ``'bz2'``, ``'zstd'``, ``'xz'``, ``'tar'``}
2423+ and other key-value pairs are forwarded to
2424+ ``zipfile.ZipFile``, ``gzip.GzipFile``,
2425+ ``bz2.BZ2File``, ``zstandard.ZstdCompressor``, ``lzma.LZMAFile`` or
2426+ ``tarfile.TarFile``, respectively.
2427+ As an example, the following could be passed for faster compression and to
2428+ create a reproducible gzip archive:
2429+ ``compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}``.
2430+
2431+ .. versionadded:: 1.5.0
2432+ Added support for `.tar` files.
24162433
24172434 .. versionchanged:: 1.4.0 Zstandard support.
24182435
2419- {storage_options}
2436+ storage_options : dict, optional
2437+ Extra options that make sense for a particular storage connection, e.g.
2438+ host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
2439+ are forwarded to ``urllib.request.Request`` as header options. For other
2440+ URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
2441+ forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
2442+ details, and for more examples on storage options refer `here
2443+ <https://pandas.pydata.org/docs/user_guide/io.html?
2444+ highlight=storage_options#reading-writing-remote-files>`_.
24202445
24212446 value_labels : dict of dicts
24222447 Dictionary containing columns as keys and dictionaries of column value
0 commit comments