{"library":"pyogrio","title":"Pyogrio: Vectorized Spatial Vector File I/O","description":"Pyogrio provides fast, bulk-oriented read and write access to GDAL/OGR vector data sources such as ESRI Shapefile, GeoPackage, GeoJSON, and FlatGeobuf. It significantly optimizes performance for geospatial data operations by leveraging pre-compiled GDAL/OGR bindings, thereby minimizing Python data type conversions. The library is actively maintained, with frequent releases that may include breaking changes between major minor versions. The current stable version is 0.12.1.","status":"active","version":"0.12.1","language":"en","source_language":"en","source_url":"https://github.com/geopandas/pyogrio","tags":["geospatial","GIS","GDAL","OGR","vector","io","pandas","geopandas","shapefile","geopackage","geojson","performance"],"install":[{"cmd":"pip install pyogrio","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge pyogrio","lang":"bash","label":"Conda-forge"}],"dependencies":[{"reason":"Required Python version.","package":"python","version":">=3.10"},{"reason":"Core underlying C/C++ library for spatial vector file I/O. Often bundled with Pyogrio wheels or managed by conda-forge.","package":"GDAL/OGR","version":">=3.6"},{"reason":"For reading and writing GeoDataFrames, which is the typical use case.","package":"geopandas","version":">=0.12"},{"reason":"Required by GeoPandas for geometry operations.","package":"shapely","version":">=2"},{"reason":"Optional dependency for significantly faster I/O when `use_arrow=True` is specified.","package":"pyarrow","optional":true}],"imports":[{"symbol":"read_dataframe","correct":"from pyogrio import read_dataframe"},{"symbol":"write_dataframe","correct":"from pyogrio import write_dataframe"},{"symbol":"list_drivers","correct":"from pyogrio import list_drivers"},{"symbol":"read_info","correct":"from pyogrio import read_info"}],"quickstart":{"code":"import geopandas as gpd\nfrom pyogrio import read_dataframe, write_dataframe\nfrom shapely.geometry import Point\nimport os\n\n# Create a dummy GeoDataFrame\ndata = {'name': ['Location A', 'Location B'], 'value': [10, 20]}\ngeometry = [Point(1, 1), Point(2, 2)]\ngdf = gpd.GeoDataFrame(data, geometry=geometry, crs=\"EPSG:4326\")\n\n# Define output path\noutput_file = \"my_geodata.gpkg\"\n\n# Write GeoDataFrame to a GeoPackage file\nprint(f\"Writing data to {output_file}...\")\nwrite_dataframe(gdf, output_file, driver=\"GPKG\", layer=\"my_points\")\nprint(\"Write complete.\")\n\n# Read GeoDataFrame from the GeoPackage file\nprint(f\"Reading data from {output_file}...\")\nread_gdf = read_dataframe(output_file, layer=\"my_points\")\nprint(\"Read complete.\")\nprint(read_gdf)\n\n# Clean up the created file\n# os.remove(output_file)\n# print(f\"Cleaned up {output_file}.\")","lang":"python","description":"This quickstart demonstrates how to create a basic GeoPandas GeoDataFrame, write it to a GeoPackage file using `pyogrio.write_dataframe`, and then read the data back into a GeoDataFrame using `pyogrio.read_dataframe`."},"warnings":[{"fix":"Update your code to expect `dict` or `list` types for JSON columns read from data sources.","message":"In version 0.12.0, the `read_dataframe` function started returning JSON fields as Python `dict`s or `list`s, whereas they were previously returned as raw strings. This change affects how JSON-type columns are handled programmatically.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Ensure your environment has GDAL 3.6 or a newer compatible version installed. Conda-forge installations typically handle this dependency.","message":"As of version 0.12.0, Pyogrio dropped official support for GDAL versions 3.4 and 3.5. Users are now required to use GDAL 3.6 or newer.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Check the GDAL version Pyogrio is using via `pyogrio.__gdal_version_string__`. If conflicts arise, consider uninstalling then reinstalling Fiona with `--no-binary fiona` (e.g., `pip uninstall fiona; pip install fiona --no-binary fiona`) or use a conda-forge environment for consistent GDAL versions.","message":"Pyogrio's binary wheels often bundle a specific GDAL version, which might conflict with a system-installed GDAL or one linked by other geospatial libraries like Fiona. This can lead to `DriverError` or `NullPointerError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To retain original offsets or convert datetimes to strings, use the `datetime_as_string=True` or `mixed_offsets_as_utc=False` parameters in `read_dataframe`.","message":"In `read_dataframe`, datetime columns with mixed time zone offsets are converted to UTC by default. This might alter original offset information if not explicitly handled.","severity":"gotcha","affected_versions":">=0.12.0"},{"fix":"Upgrade macOS to version 12+ or follow the instructions for building Pyogrio from source if on an older OS.","message":"MacOS binary wheels for Pyogrio are built specifically for macOS 12 and newer. Users on older macOS versions (e.g., macOS 11 or earlier) will need to build Pyogrio from source, which requires a pre-installed GDAL development environment.","severity":"gotcha","affected_versions":">=0.9.0"},{"fix":"Install `pyarrow` (`pip install pyarrow`) and ensure your GDAL version meets the minimum requirements (3.6 for reading, 3.8 for writing).","message":"Utilizing the `use_arrow=True` option in `read_dataframe` or `write_dataframe` for performance benefits requires the `pyarrow` library to be installed. Additionally, writing with Arrow (`use_arrow=True` in `write_dataframe`) specifically requires GDAL >= 3.8, while reading with Arrow requires GDAL >= 3.6.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that the data types in your GeoDataFrame columns are compatible with the target OGR driver's schema before writing. Convert incompatible types (e.g., lists, tuples) to supported formats (e.g., strings) if necessary.","message":"Pyogrio does not perform validation of attribute values or geometry types before attempting to write data to an output file. Providing invalid types may result in crashes during the write operation with cryptic error messages.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}