# pandas 3.1.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

    Write a DataFrame to the parquet format.

    Parameters
    ----------
    df : DataFrame
    path : str, path object, file-like object, or None, default None
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a binary ``write()`` function. If None, the result
        is returned as bytes. If a string, it will be used as the root directory
        path when writing a partitioned dataset. The engine fastparquet does
        not accept file-like objects.

        The string could be a URL. Valid URL schemes include http, ftp, s3,
        gs, and file. For file URLs, a host is expected. A local file could be:
        ``file://localhost/path/to/table.parquet``. A remote example could be:
        ``s3://bucket/path/to/table.parquet``.

        Certain URL schemes may require additional packages. For example, S3
        URLs require the ``s3fs`` library. See
        :ref:`install.optional_dependencies` for a full list.
    engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
        Parquet library to use. If 'auto', then the option
        ``io.parquet.engine`` is used. The default ``io.parquet.engine``
        behavior is to try 'pyarrow', falling back to 'fastparquet' if
        'pyarrow' is unavailable.

        When using the ``'pyarrow'`` engine and no storage options are provided
        and a filesystem is implemented by both ``pyarrow.fs`` and ``fsspec``
        (e.g. "s3://"), then the ``pyarrow.fs`` filesystem is attempted first.
        Use the filesystem keyword with an instantiated fsspec filesystem
        if you wish to use its implementation.

        .. deprecated:: 3.1.0
            The ``'fastparquet'`` and ``'auto'`` engine options are
            deprecated. Use ``'pyarrow'`` or do not pass ``engine``
            to use the default.

    compression : {'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None},
        default 'snappy'. Name of the compression to use. Use ``None``
        for no compression.
    index : bool, default None
        If ``True``, include the dataframe's index(es) in the file output. If
        ``False``, they will not be written to the file.
        If ``None``, similar to ``True`` the dataframe's index(es)
        will be saved. However, instead of being saved as values,
        the RangeIndex will be stored as a range in the metadata so it
        doesn't require much space and is faster. Other indexes will
        be included as columns in the file output.
    partition_cols : str or list, optional, default None
        Column names by which to partition the dataset.
        Columns are partitioned in the order they are given.
        Must be None if path is not a string.
    storage_options : dict, optional
        Extra options that make sense for a particular storage connection, e.g.
        host, port, username, password, etc. For HTTP(S) URLs the key-value
        pairs are forwarded to ``urllib.request.Request`` as header options.
        For other URLs (e.g. starting with "s3://", and "gcs://") the
        key-value pairs are forwarded to ``fsspec.open``. Please see ``fsspec``
        and ``urllib`` for more details, and for more examples on storage
        options refer `here <https://pandas.pydata.org/docs/user_guide/io.html?
        highlight=storage_options#reading-writing-remote-files>`_.
    filesystem : fsspec or pyarrow filesystem, default None
        Filesystem object to use when reading the parquet file. Only implemented
        for ``engine="pyarrow"``.

        .. versionadded:: 2.1.0

    **kwargs
        Additional keyword arguments passed to the engine:

        * For ``engine="pyarrow"``: passed to :func:`pyarrow.parquet.write_table`
          or :func:`pyarrow.parquet.write_to_dataset` (when using partition_cols)
        * For ``engine="fastparquet"``: passed to :func:`fastparquet.write`

    Returns
    -------
    bytes if no path argument is provided else None
    
=== parse numpydoc
short_description: 'Write a DataFrame to the parquet format.'
blank_after_short_description: True
blank_after_long_description: False
style: numpydoc
- DocstringParam
  kind: param
  key: 'param'
  arg_name: 'df'
  type_name: 'DataFrame'
  is_optional: False
- DocstringParam
  description: |
    String, path object (implementing ``os.PathLike[str]``), or file-like
    object implementing a binary ``write()`` function. If None, the result
    is returned as bytes. If a string, it will be used as the root directory
    path when writing a partitioned dataset. The engine fastparquet does
    not accept file-like objects.
    
    The string could be a URL. Valid URL schemes include http, ftp, s3,
    gs, and file. For file URLs, a host is expected. A local file could be:
    ``file://localhost/path/to/table.parquet``. A remote example could be:
    ``s3://bucket/path/to/table.parquet``.
    
    Certain URL schemes may require additional packages. For example, S3
    URLs require the ``s3fs`` library. See
    :ref:`install.optional_dependencies` for a full list.
  kind: param
  key: 'param'
  arg_name: 'path'
  type_name: 'str, path object, file-like object, or None'
  is_optional: True
  default: 'None'
  raw_type_name: 'str, path object, file-like object, or None, default None'
- DocstringParam
  description: |
    Parquet library to use. If 'auto', then the option
    ``io.parquet.engine`` is used. The default ``io.parquet.engine``
    behavior is to try 'pyarrow', falling back to 'fastparquet' if
    'pyarrow' is unavailable.
    
    When using the ``'pyarrow'`` engine and no storage options are provided
    and a filesystem is implemented by both ``pyarrow.fs`` and ``fsspec``
    (e.g. "s3://"), then the ``pyarrow.fs`` filesystem is attempted first.
    Use the filesystem keyword with an instantiated fsspec filesystem
    if you wish to use its implementation.
    
    .. deprecated:: 3.1.0
        The ``'fastparquet'`` and ``'auto'`` engine options are
        deprecated. Use ``'pyarrow'`` or do not pass ``engine``
        to use the default.
  kind: param
  key: 'param'
  arg_name: 'engine'
  type_name: "{'auto', 'pyarrow', 'fastparquet'}"
  is_optional: True
  default: "'auto'"
  raw_type_name: "{'auto', 'pyarrow', 'fastparquet'}, default 'auto'"
- DocstringParam
  description: |
    default 'snappy'. Name of the compression to use. Use ``None``
    for no compression.
  kind: param
  key: 'param'
  arg_name: 'compression'
  type_name: "{'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None}"
  is_optional: False
  raw_type_name: "{'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None},"
- DocstringParam
  description: |
    If ``True``, include the dataframe's index(es) in the file output. If
    ``False``, they will not be written to the file.
    If ``None``, similar to ``True`` the dataframe's index(es)
    will be saved. However, instead of being saved as values,
    the RangeIndex will be stored as a range in the metadata so it
    doesn't require much space and is faster. Other indexes will
    be included as columns in the file output.
  kind: param
  key: 'param'
  arg_name: 'index'
  type_name: 'bool'
  is_optional: True
  default: 'None'
  raw_type_name: 'bool, default None'
- DocstringParam
  description: |
    Column names by which to partition the dataset.
    Columns are partitioned in the order they are given.
    Must be None if path is not a string.
  kind: param
  key: 'param'
  arg_name: 'partition_cols'
  type_name: 'str or list'
  is_optional: True
  default: 'None'
  raw_type_name: 'str or list, optional, default None'
- DocstringParam
  description: |
    Extra options that make sense for a particular storage connection, e.g.
    host, port, username, password, etc. For HTTP(S) URLs the key-value
    pairs are forwarded to ``urllib.request.Request`` as header options.
    For other URLs (e.g. starting with "s3://", and "gcs://") the
    key-value pairs are forwarded to ``fsspec.open``. Please see ``fsspec``
    and ``urllib`` for more details, and for more examples on storage
    options refer `here <https://pandas.pydata.org/docs/user_guide/io.html?
    highlight=storage_options#reading-writing-remote-files>`_.
  kind: param
  key: 'param'
  arg_name: 'storage_options'
  type_name: 'dict'
  is_optional: True
  raw_type_name: 'dict, optional'
- DocstringParam
  description: |
    Filesystem object to use when reading the parquet file. Only implemented
    for ``engine="pyarrow"``.
    
    .. versionadded:: 2.1.0
  kind: param
  key: 'param'
  arg_name: 'filesystem'
  type_name: 'fsspec or pyarrow filesystem'
  is_optional: True
  default: 'None'
  raw_type_name: 'fsspec or pyarrow filesystem, default None'
- DocstringParam
  description: |
    Additional keyword arguments passed to the engine:
    
    * For ``engine="pyarrow"``: passed to :func:`pyarrow.parquet.write_table`
      or :func:`pyarrow.parquet.write_to_dataset` (when using partition_cols)
    * For ``engine="fastparquet"``: passed to :func:`fastparquet.write`
  kind: param
  key: 'param'
  arg_name: '**kwargs'
  is_optional: False
- DocstringReturns
  kind: returns
  key: 'returns'
  type_name: 'bytes if no path argument is provided else None'
  is_generator: False
=== detect
numpydoc
=== compose numpydoc
Write a DataFrame to the parquet format.

Parameters
----------
df : DataFrame
path : str, path object, file-like object, or None, default None
    String, path object (implementing ``os.PathLike[str]``), or file-like
    object implementing a binary ``write()`` function. If None, the result
    is returned as bytes. If a string, it will be used as the root directory
    path when writing a partitioned dataset. The engine fastparquet does
    not accept file-like objects.

    The string could be a URL. Valid URL schemes include http, ftp, s3,
    gs, and file. For file URLs, a host is expected. A local file could be:
    ``file://localhost/path/to/table.parquet``. A remote example could be:
    ``s3://bucket/path/to/table.parquet``.

    Certain URL schemes may require additional packages. For example, S3
    URLs require the ``s3fs`` library. See
    :ref:`install.optional_dependencies` for a full list.
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
    Parquet library to use. If 'auto', then the option
    ``io.parquet.engine`` is used. The default ``io.parquet.engine``
    behavior is to try 'pyarrow', falling back to 'fastparquet' if
    'pyarrow' is unavailable.

    When using the ``'pyarrow'`` engine and no storage options are provided
    and a filesystem is implemented by both ``pyarrow.fs`` and ``fsspec``
    (e.g. "s3://"), then the ``pyarrow.fs`` filesystem is attempted first.
    Use the filesystem keyword with an instantiated fsspec filesystem
    if you wish to use its implementation.

    .. deprecated:: 3.1.0
        The ``'fastparquet'`` and ``'auto'`` engine options are
        deprecated. Use ``'pyarrow'`` or do not pass ``engine``
        to use the default.
compression : {'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None},
    default 'snappy'. Name of the compression to use. Use ``None``
    for no compression.
index : bool, default None
    If ``True``, include the dataframe's index(es) in the file output. If
    ``False``, they will not be written to the file.
    If ``None``, similar to ``True`` the dataframe's index(es)
    will be saved. However, instead of being saved as values,
    the RangeIndex will be stored as a range in the metadata so it
    doesn't require much space and is faster. Other indexes will
    be included as columns in the file output.
partition_cols : str or list, optional, default None
    Column names by which to partition the dataset.
    Columns are partitioned in the order they are given.
    Must be None if path is not a string.
storage_options : dict, optional
    Extra options that make sense for a particular storage connection, e.g.
    host, port, username, password, etc. For HTTP(S) URLs the key-value
    pairs are forwarded to ``urllib.request.Request`` as header options.
    For other URLs (e.g. starting with "s3://", and "gcs://") the
    key-value pairs are forwarded to ``fsspec.open``. Please see ``fsspec``
    and ``urllib`` for more details, and for more examples on storage
    options refer `here <https://pandas.pydata.org/docs/user_guide/io.html?
    highlight=storage_options#reading-writing-remote-files>`_.
filesystem : fsspec or pyarrow filesystem, default None
    Filesystem object to use when reading the parquet file. Only implemented
    for ``engine="pyarrow"``.

    .. versionadded:: 2.1.0
**kwargs
    Additional keyword arguments passed to the engine:

    * For ``engine="pyarrow"``: passed to :func:`pyarrow.parquet.write_table`
      or :func:`pyarrow.parquet.write_to_dataset` (when using partition_cols)
    * For ``engine="fastparquet"``: passed to :func:`fastparquet.write`

Returns
-------
bytes if no path argument is provided else None
