{"id":15039401,"url":"https://github.com/toblerity/fiona","last_synced_at":"2025-05-13T15:12:01.320Z","repository":{"id":2136942,"uuid":"3080628","full_name":"Toblerity/Fiona","owner":"Toblerity","description":"Fiona reads and writes geographic data files","archived":false,"fork":false,"pushed_at":"2025-02-20T23:53:44.000Z","size":4047,"stargazers_count":1184,"open_issues_count":37,"forks_count":208,"subscribers_count":46,"default_branch":"main","last_synced_at":"2025-05-03T03:41:44.507Z","etag":null,"topics":["cli","cython","gdal","gis","ogr","python","vector"],"latest_commit_sha":null,"homepage":"https://fiona.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Toblerity.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-12-31T19:47:00.000Z","updated_at":"2025-05-02T18:39:47.000Z","dependencies_parsed_at":"2024-01-16T14:03:22.229Z","dependency_job_id":"8f7f6923-173e-45b2-8638-03c6327e780a","html_url":"https://github.com/Toblerity/Fiona","commit_stats":{"total_commits":1231,"total_committers":73,"mean_commits":"16.863013698630137","dds":"0.41348497156783104","last_synced_commit":"21ec544adceb95622de026eb06944e6671fd4d76"},"previous_names":[],"tags_count":126,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toblerity%2FFiona","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toblerity%2FFiona/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toblerity%2FFiona/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toblerity%2FFiona/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Toblerity","download_url":"https://codeload.github.com/Toblerity/Fiona/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969262,"owners_count":21992263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cython","gdal","gis","ogr","python","vector"],"created_at":"2024-09-24T20:42:42.352Z","updated_at":"2025-05-13T15:11:56.303Z","avatar_url":"https://github.com/Toblerity.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====\nFiona\n=====\n\n.. image:: https://github.com/Toblerity/Fiona/actions/workflows/tests.yml/badge.svg\n   :target: https://github.com/Toblerity/Fiona/actions/workflows/tests.yml\n.. image:: https://github.com/Toblerity/Fiona/actions/workflows/test_gdal_latest.yml/badge.svg\n   :target: https://github.com/Toblerity/Fiona/actions/workflows/test_gdal_latest.yml\n.. image:: https://img.shields.io/pypi/v/fiona\n   :target: https://pypi.org/project/fiona/\n.. image:: https://api.securityscorecards.dev/projects/github.com/Toblerity/Fiona/badge\n   :target: https://securityscorecards.dev/viewer/?uri=github.com/Toblerity/Fiona\n\nFiona streams simple feature data to and from GIS formats like GeoPackage and\nShapefile.\n\nFiona can read and write real-world data using multi-layered GIS formats,\nzipped and in-memory virtual file systems, from files on your hard drive or in\ncloud storage. This project includes Python modules and a command line\ninterface (CLI).\n\nFiona depends on `GDAL \u003chttps://gdal.org\u003e`__ but is different from GDAL's own\n`bindings \u003chttps://gdal.org/api/python_bindings.html\u003e`__. Fiona is designed to\nbe highly productive and to make it easy to write code which is easy to read.\n\nInstallation\n============\n\nFiona has several `extension modules\n\u003chttps://docs.python.org/3/extending/extending.html\u003e`__ which link against\nlibgdal. This complicates installation. Binary distributions (wheels)\ncontaining libgdal and its own dependencies are available from the Python\nPackage Index and can be installed using pip.\n\n.. code-block:: console\n\n    pip install fiona\n\nThese wheels are mainly intended to make installation easy for simple\napplications, not so much for production. They are not tested for compatibility\nwith all other binary wheels, conda packages, or QGIS, and omit many of GDAL's\noptional format drivers. If you need, for example, GML support you will need to\nbuild and install Fiona from a source distribution. It is possible to install\nFiona from source using pip (version \u003e= 22.3) and the `--no-binary` option. A\nspecific GDAL installation can be selected by setting the GDAL_CONFIG\nenvironment variable.\n\n.. code-block:: console\n\n    pip install -U pip\n    pip install --no-binary fiona fiona\n\nMany users find Anaconda and conda-forge a good way to install Fiona and get\naccess to more optional format drivers (like GML).\n\nFiona 1.10 requires Python 3.8 or higher and GDAL 3.4 or higher.\n\nPython Usage\n============\n\nFeatures are read from and written to file-like ``Collection`` objects returned\nfrom the ``fiona.open()`` function. Features are data classes modeled on the\nGeoJSON format. They don't have any spatial methods of their own, so if you\nwant to transform them you will need Shapely or something like it. Here is an\nexample of using Fiona to read some features from one data file, change their\ngeometry attributes using Shapely, and write them to a new data file.\n\n.. code-block:: python\n\n    import fiona\n    from fiona import Feature, Geometry\n    from shapely.geometry import mapping, shape\n\n    # Open a file for reading. We'll call this the source.\n    with fiona.open(\n        \"zip+https://github.com/Toblerity/Fiona/files/11151652/coutwildrnp.zip\"\n    ) as src:\n\n        # The file we'll write to must be initialized with a coordinate\n        # system, a format driver name, and a record schema. We can get\n        # initial values from the open source's profile property and then\n        # modify them as we need.\n        profile = src.profile\n        profile[\"schema\"][\"geometry\"] = \"Point\"\n        profile[\"driver\"] = \"GPKG\"\n\n        # Open an output file, using the same format driver and coordinate\n        # reference system as the source. The profile mapping fills in the\n        # keyword parameters of fiona.open.\n        with fiona.open(\"centroids.gpkg\", \"w\", **profile) as dst:\n\n            # Process only the feature records intersecting a box.\n            for feat in src.filter(bbox=(-107.0, 37.0, -105.0, 39.0)):\n\n                # Get the feature's centroid.\n                centroid_shp = shape(feat.geometry).centroid\n                new_geom = Geometry.from_dict(centroid_shp)\n\n                # Write the feature out.\n                dst.write(\n                    Feature(geometry=new_geom, properties=f.properties)\n                )\n\n        # The destination's contents are flushed to disk and the file is\n        # closed when its with block ends. This effectively\n        # executes ``dst.flush(); dst.close()``.\n\nCLI Usage\n=========\n\nFiona's command line interface, named \"fio\", is documented at `docs/cli.rst\n\u003chttps://github.com/Toblerity/Fiona/blob/main/docs/cli.rst\u003e`__. The CLI has a\nnumber of different commands. Its ``fio cat`` command streams GeoJSON features\nfrom any dataset.\n\n.. code-block:: console\n\n    $ fio cat --compact tests/data/coutwildrnp.shp | jq -c '.'\n    {\"geometry\":{\"coordinates\":[[[-111.73527526855469,41.995094299316406],...]]}}\n    ...\n\nDocumentation\n=============\n\nFor more details about this project, please see:\n\n* Fiona `home page \u003chttps://github.com/Toblerity/Fiona\u003e`__\n* `Docs and manual \u003chttps://fiona.readthedocs.io/\u003e`__\n* `Examples \u003chttps://github.com/Toblerity/Fiona/tree/main/examples\u003e`__\n* Main `user discussion group \u003chttps://fiona.groups.io/g/main\u003e`__\n* `Developers discussion group \u003chttps://fiona.groups.io/g/dev\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoblerity%2Ffiona","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoblerity%2Ffiona","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoblerity%2Ffiona/lists"}