{"id":24743,"library":"turfpy","title":"turfpy","description":"A Python library for geospatial data analysis that reimplements turf.js. Current version 0.0.8, released periodically with incremental improvements.","status":"active","version":"0.0.8","language":"python","source_language":"en","source_url":"https://github.com/omanges/turfpy","tags":["geospatial","geojson","turf","gis","data-analysis"],"install":[{"cmd":"pip install turfpy","lang":"bash","label":"latest"}],"dependencies":[{"reason":"used for spatial operations","package":"geopandas","optional":false},{"reason":"geometry backend","package":"shapely","optional":false},{"reason":"numerical operations","package":"numpy","optional":false}],"imports":[{"note":"Common pattern: import turfpy and call turfpy.function().","wrong":"from turfpy import ...","symbol":"turfpy","correct":"import turfpy"},{"note":"measurement is a submodule, not top-level.","wrong":"import measurement","symbol":"measurement","correct":"from turfpy import measurement"}],"quickstart":{"code":"import turfpy\nfrom turfpy import measurement\nfrom geojson import Point, Feature\n\npoint1 = Feature(geometry=Point((-3.0, 53.0)))\npoint2 = Feature(geometry=Point((-2.0, 55.0)))\ndistance = measurement.distance(point1, point2)\nprint(f'Distance: {distance}')","lang":"python","description":"Calculate distance between two points using turfpy."},"warnings":[{"fix":"Use geojson library to wrap geometries: Feature(geometry=Polygon(...))","message":"turfpy expects GeoJSON Feature objects, not raw shapely geometries. Convert polygons to GeoJSON features before passing to functions like area or length.","severity":"gotcha","affected_versions":"all"},{"fix":"Use from turfpy import boolean_ops or from turfpy.boolean_ops import ...","message":"Boolean operations like intersect, union, difference were moved to a separate submodule in v0.0.8. Importing from top-level turfpy may break.","severity":"deprecated","affected_versions":">=0.0.8"},{"fix":"Use turfpy.measurement.area with appropriate coordinate system or convert output.","message":"The area function returns square meters for geographic coordinates, not degrees. If you need other units, convert beforehand.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use from turfpy import measurement; measurement.distance(...)","cause":"distance is in turfpy.measurement submodule, not top-level.","error":"AttributeError: module 'turfpy' has no attribute 'distance'"},{"fix":"Convert to GeoJSON: from geojson import Feature; Feature(geometry=your_shapely_polygon)","cause":"turfpy expects GeoJSON Feature or geometry dict, not raw shapely object.","error":"TypeError: Object of type Polygon is not JSON serializable"},{"fix":"Run 'pip install turfpy' or check that you're in the correct Python environment.","cause":"turfpy not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'turfpy'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}