{"id":31947604,"url":"https://github.com/vizzuality/sql2gee","last_synced_at":"2025-10-14T11:46:27.584Z","repository":{"id":55479156,"uuid":"77681807","full_name":"Vizzuality/sql2gee","owner":"Vizzuality","description":"Library to parse SQL-like queries to Google's Earth Engine syntax","archived":false,"fork":false,"pushed_at":"2020-12-15T15:54:12.000Z","size":2231,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2024-08-09T04:38:40.866Z","etag":null,"topics":["google-earth-engine","python","sql"],"latest_commit_sha":null,"homepage":"https://vizzuality.github.io/sql2gee/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vizzuality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-30T11:17:10.000Z","updated_at":"2023-01-12T07:37:07.000Z","dependencies_parsed_at":"2022-08-15T01:20:15.083Z","dependency_job_id":null,"html_url":"https://github.com/Vizzuality/sql2gee","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/Vizzuality/sql2gee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizzuality%2Fsql2gee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizzuality%2Fsql2gee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizzuality%2Fsql2gee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizzuality%2Fsql2gee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vizzuality","download_url":"https://codeload.github.com/Vizzuality/sql2gee/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizzuality%2Fsql2gee/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019073,"owners_count":26086518,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["google-earth-engine","python","sql"],"created_at":"2025-10-14T11:46:13.914Z","updated_at":"2025-10-14T11:46:27.569Z","avatar_url":"https://github.com/Vizzuality.png","language":"Python","readme":"[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/Vizzuality/sql2gee/blob/develop/LICENSE)\n[![Build Status](https://travis-ci.org/Vizzuality/sql2gee.svg?branch=develop)](https://travis-ci.org/Vizzuality/sql2gee)\n[![codecov](https://codecov.io/gh/Vizzuality/sql2gee/branch/develop/graph/badge.svg)](https://codecov.io/gh/Vizzuality/sql2gee)\n\n# sql2gee\n\n[Read the docs](https://vizzuality.github.io/sql2gee/)\n\nA Python 3 library to make SQL-like queries to Google's Earth Engine Main asset data types (Feature Collections, and Fusion Tables, Image Collections and Images).  It is able to perform\nPostgis-like operations, including returning summary statistics, and histogram data and subsetting by geojson vector data.\n\n\n### Example usage\n\n1. Import the SQL2GEE class from the sql2gee library in python.\n\n```python\nimport ee\nfrom sql2gee import SQL2GEE\nfrom utils.jsonSql import JsonSql\nee.Initialize()\n\nsql = \"SELECT ST_HISTOGRAM(raster, lossyear, 15, true) FROM 'UMD/hansen/global_forest_change_2015'\"\nquery = SQL2GEE(JsonSql(sql).to_json())\nprint(\"Result of my query: \", query.response())\n```\n\n```\nResult of my query: [{'st_histogram': {'lossyear': [[0.0, 6929647.301960737], [1.0, 0.0], [2.0, 3.0], [3.0, 1.0], [4.0, 13.0], [5.0, 5.0], [6.0, 5.250980392156863], [7.0, 1.0], [8.0, 5.0], [9.0, 9.0], [10.0, 12.0], [11.0, 3.0], [12.0, 6.0], [13.0, 1.0], [14.0, 16.0]]}}]\n```\n\n### Execute tests\n\nTest run queries on GEE servers, so you need a GCP service account with access to GEE. Specifically, you need:\n\n- The service account name (a string formatted like `\u003cname\u003e@\u003cproject\u003e.iam.gserviceaccount.com`) that has permissions to access GEE.\n- A JSON access key for that account.\n\nThe account name needs to be set as the `EE_ACCOUNT` environment variable. \nThe JSON account key needs to be saved as a `privatekey.json` file at the root of the project.\n\nOnce both values are set, you can run the tests using tox: \n\n```bash\ntox\n```\n\n## Development\n\n\n### Notes\n\n### Want to Contribute?\n\nSubmit a pull request and we will review it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizzuality%2Fsql2gee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvizzuality%2Fsql2gee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizzuality%2Fsql2gee/lists"}