> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GeoDataFrame.from_file

> Alternate constructor to create a GeoDataFrame from a file.

Alternate constructor to create a `GeoDataFrame` from a file.

## Signature

```python theme={"system"}
GeoDataFrame.from_file(
    filename: str,
    format: str | None = None,
    **kwargs,
) -> GeoDataFrame
```

## Parameters

<ParamField path="filename" type="str" required>
  File path or file handle to read from. If the path is a directory,
  Sedona will read all files in that directory.
</ParamField>

<ParamField path="format" type="str | None" default="None">
  The format of the file to read, by default None. If None, Sedona
  infers the format from the file extension. Note that format
  inference is not supported for directories. Available formats are
  "shapefile", "geojson", "geopackage", and "geoparquet".
</ParamField>

<ParamField path="table_name" type="str">
  The name of the table to read from a GeoPackage file, by default
  None. This is required if `format` is "geopackage".
</ParamField>

<ParamField path="kwargs">
  Additional keyword arguments passed to the file reader.
</ParamField>

## Returns

<ResponseField name="return" type="GeoDataFrame">
  A new GeoDataFrame created from the file.
</ResponseField>

**See also**

* `GeoDataFrame.to_file`: Write a `GeoDataFrame` to a file.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.