{ "info": { "author": "Wil Selwood", "author_email": "wil.selwood@sa.catapult.org.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 3.7" ], "description": "# sedas_pyapi\n\nA small collection of useful functions to get data from SeDAS. Works with the API documented [here](https://geobrowser.satapps.org/docs/index.html)\n\nRequires python 3+ has been tested with 3.7\n\n## Installing\n\nThe project is available in PyPI. Just a pip install away.\n\n```bash\npip install sedas_pyapi\n```\n\nIf you want to build manually we will be providing a contributing guide soon which will include information about \nbuilding and testing the project.\n\n## Usage\n\nCreate an instance of `sedas_pyapi.sedas_api.SeDASAPI` passing in your username and password.\n\nThen call `search_optical`, `search_sar` or `search_product` to find the details of a product.\n\nOnce you have a list of things you want to download you can use the `sedas_pyapi.bulk_download.SeDASBulkDownload` to \ndownload all of them. There are also download methods on the `SeDASAPI` if you need to do something a bit different.\n\nDue to the way the SeDAS system works sometimes when you do a search you will not get a download url in the result \nobject. If this happens it means that the data is available but in the long term archive (lta) and must be requested \nfirst. Use the `request` and `is_request_ready` methods to make a request and then wait for it to be fulfilled. If you \nuse the `SeDASBulkDownload` this will take care of LTA requests for you.\n\nFor more details see the examples below\n\n## Examples\n\n### Creating a client\n\n```python\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\n# This is a suggestion for how to get your username and password\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\n```\n\nThe SeDASAPI object can then be used to access the rest of the api.\n\n### Search for an optical AOI with cloud cover filters\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nwkt = \"POLYGON ((-1.3295 51.5881,\" \\\n \"-1.3013 51.5872,\" \\\n \"-1.3020 51.5621,\" \\\n \"-1.3300 51.5622,\" \\\n \"-1.3295 51.5881))\"\nstartDate = \"2019-04-30T00:00:00Z\"\nendDate = \"2019-05-12T23:59:59Z\"\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_optical = sedas.search_optical(wkt, startDate, endDate, maxCloudPercent=50)\nprint(json.dumps(result_optical, sort_keys=True, indent=4, separators=(',', ': ')))\n```\n\nReturns a SeDAS search result object. [See more](https://geobrowser.satapps.org/docs/json_SearchResponse.html)\n\n### Search for a SAR AOI\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nwkt = \"POLYGON ((-1.3295 51.5881,\" \\\n \"-1.3013 51.5872,\" \\\n \"-1.3020 51.5621,\" \\\n \"-1.3300 51.5622,\" \\\n \"-1.3295 51.5881))\"\nstartDate = \"2019-04-30T00:00:00Z\"\nendDate = \"2019-05-12T23:59:59Z\"\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_sar = sedas.search_sar(wkt, startDate, endDate)\nprint(json.dumps(result_sar, sort_keys=True, indent=4, separators=(',', ': ')))\n```\n\nReturns a SeDAS search result object. [See more](https://geobrowser.satapps.org/docs/json_SearchResponse.html)\n\n### List the source groups available to the user\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_groups = sedas.list_sensor_groups()\nprint(json.dumps(result_groups, sort_keys=True, indent=4, separators=(',', ': ')))\n\ngroups = []\nfor i in range(0, len(result_groups)):\n groups.append(result_groups[i]['name'])\n\nprint(f\"Available groups are: {', '.join(groups)}\")\n```\n\nReturns a list of SeDAS source group objects. [See more](https://geobrowser.satapps.org/docs/json_SourceGroup.html)\n\n### List the satellites available to the user\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_sats = sedas.list_satellites()\nprint(json.dumps(result_sats, sort_keys=True, indent=4, separators=(',', ': ')))\n\nsatellites = []\nfor i in range(0, len(result_sats)):\n satellites.append(result_sats[i]['name'])\n\nprint(f\"Available satellites are: {', '.join(satellites)}\")\n```\n\nReturns a list of SeDAS satellite objects. [See more](https://geobrowser.satapps.org/docs/json_Satellite.html)\n\n### Filtering on a group of sources\nUse sedas.list_sensor_groups to get the list of source groups available for a user ([see above](#List-the-source-groups-available-to-the-user)).\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nwkt = \"POLYGON ((-1.3295 51.5881,\" \\\n \"-1.3013 51.5872,\" \\\n \"-1.3020 51.5621,\" \\\n \"-1.3300 51.5622,\" \\\n \"-1.3295 51.5881))\"\nstartDate = \"2019-04-30T00:00:00Z\"\nendDate = \"2019-05-12T23:59:59Z\"\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_optical = sedas.search_optical(wkt, startDate, endDate, source_group=\"S2\")\nprint(json.dumps(result_optical, sort_keys=True, indent=4, separators=(',', ': ')))\n```\n\n### Filtering on a specific satellite\nUse sedas.list_satellites to get the list of satellites available for a user ([see above](#List-the-satellites-available-to-the-user)).\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nwkt = \"POLYGON ((-1.3295 51.5881,\" \\\n \"-1.3013 51.5872,\" \\\n \"-1.3020 51.5621,\" \\\n \"-1.3300 51.5622,\" \\\n \"-1.3295 51.5881))\"\nstartDate = \"2019-04-30T00:00:00Z\"\nendDate = \"2019-05-12T23:59:59Z\"\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nresult_sar = sedas.search_sar(wkt, startDate, endDate, satellite_name=\"Sentinel-1A\")\nprint(json.dumps(result_sar, sort_keys=True, indent=4, separators=(',', ': ')))\n```\n\n### Search for a single product\n\n```python\nimport json\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nsingleProduct = sedas.search_product(\"S1B_IW_GRDH_1SDV_20190528T105030_20190528T105055_016443_01EF3E_5E4F\")\nprint(json.dumps(singleProduct, sort_keys=True, indent=4, separators=(',', ': ')))\n```\n\nThis returns an array containing SeDAS products. [See more](https://geobrowser.satapps.org/docs/json_Product.html)\n\n### Download a single product\n\n```python\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\nsingleProduct = sedas.search_product(\"S1B_IW_GRDH_1SDV_20190528T105030_20190528T105055_016443_01EF3E_5E4F\")\n\nsedas.download(singleProduct[0], \"/output/path/S1B_IW_GRDH_1SDV_20190528T105030_20190528T105055_016443_01EF3E_5E4F.zip\")\n```\n\n### Bulk download many products\nNote with historical request this can take a while to recover the images from the archive.\n```python\nfrom sedas_pyapi.bulk_download import SeDASBulkDownload\nfrom sedas_pyapi.sedas_api import SeDASAPI\nfrom getpass import getpass\nimport time\n\nwkt = \"POLYGON ((-1.3295 51.5881,\" \\\n \"-1.3013 51.5872,\" \\\n \"-1.3020 51.5621,\" \\\n \"-1.3300 51.5622,\" \\\n \"-1.3295 51.5881))\"\nstartDate = \"2019-04-30T00:00:00Z\"\nendDate = \"2019-05-12T23:59:59Z\"\n\nusername = input(\"Please enter your username:\")\npassword = getpass(\"Please enter your password:\")\n\nsedas = SeDASAPI(username, password)\n\n# Search for some images.\nresult_sar = sedas.search_sar(wkt, startDate, endDate, sarProductType=\"SLC\")\n# Create a downloader. This will spawn a number of background threads to actually do the downloading and waiting for \n# the long term archive requests.\ndownloader = SeDASBulkDownload(sedas, \"/output/path/\", parallel=3)\n\n# Add the things we want to download to the queue\ndownloader.add(result_sar['products'])\n\n# Wait for the downloader to be finished.\nwhile not downloader.is_done():\n time.sleep(5)\n\n# clean up the background threads.\ndownloader.shutdown()\n\n```\n\n# History\n\n## 0.4.2 (2019-09-11)\n* Add useragent header to stop the SeDAS firewall getting cross\n\n## 0.4.1 (2019-07-30)\n* Fix bulk download threads stopping on errors\n\n## 0.4.0 (2019-07-12)\nThis release contains potentially backwards incompatible changes.\n\n* Add source group lookup\n* Add satellite lookup\n* Make source group and satellite name optional on type specific searches\n* Remove underscores from parameter names on all SeDASAPI functions (this may break existing code with named parameters)\n\n## 0.3.0 (2019-07-11)\n* Add Source Group search parameter\n* Add Satellite Name search parameter\n\n## 0.2.1 (2019-07-03)\n* Documentation updates\n* Download done queue added to bulk downloader\n\n## 0.2.0 (2019-07-02)\n* Initial release on PyPI\n\n## 0.0.1 (2019-06-04)\n* Initial code release without packaging\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SatelliteApplicationsCatapult/sedas_pyapi", "keywords": "SeDAS API Client", "license": "apache2", "maintainer": "", "maintainer_email": "", "name": "sedas-pyapi", "package_url": "https://pypi.org/project/sedas-pyapi/", "platform": "", "project_url": "https://pypi.org/project/sedas-pyapi/", "project_urls": { "Homepage": "https://github.com/SatelliteApplicationsCatapult/sedas_pyapi" }, "release_url": "https://pypi.org/project/sedas-pyapi/0.4.2/", "requires_dist": null, "requires_python": "", "summary": "client library to easily access the SeDAS API", "version": "0.4.2" }, "last_serial": 5826424, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "7708d1b98157c826e8dc48fe3cf58d27", "sha256": "cec728553730e0279c5c3a21863426a4dbe408518e1f4326df3ee834a138d7aa" }, "downloads": -1, "filename": "sedas_pyapi-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7708d1b98157c826e8dc48fe3cf58d27", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13620, "upload_time": "2019-07-02T14:52:44", "url": "https://files.pythonhosted.org/packages/f7/34/0799242a77e5fde30f2cacd58d7bf08820a8c1df7d50c343d8c089c5a1cb/sedas_pyapi-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11f51b2b0ffb36428ab065672bddd902", "sha256": "be4434eb25cb65403fae8405b084231f8ad1b55e7a606caaad08820d3497b112" }, "downloads": -1, "filename": "sedas_pyapi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "11f51b2b0ffb36428ab065672bddd902", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8610, "upload_time": "2019-07-02T14:52:46", "url": "https://files.pythonhosted.org/packages/3d/56/5d76bd288f03ca25e56caad3fe4e5117fac1ddbaa65c165bafa00d63a61e/sedas_pyapi-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4b8304b5896eacef57de5f74e5396a34", "sha256": "552bc91fa092084c2b758b1f6fa0c8a7a9ce909773ed969544d9d1467e9fd952" }, "downloads": -1, "filename": "sedas_pyapi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4b8304b5896eacef57de5f74e5396a34", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13773, "upload_time": "2019-07-03T10:01:27", "url": "https://files.pythonhosted.org/packages/0f/9d/5c8e4107bdd5d15261e08d9798b9703d06f2d808d797dd7f9dd68c7b23a3/sedas_pyapi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3dce32b0ec03ab11f737f46ee3dd0e8", "sha256": "3dda4299d5f6aecfee9ac26719d124b77f8fc40c266f673d292b77ca1b3cc0aa" }, "downloads": -1, "filename": "sedas_pyapi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c3dce32b0ec03ab11f737f46ee3dd0e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8896, "upload_time": "2019-07-03T10:01:29", "url": "https://files.pythonhosted.org/packages/cd/6c/1bafa29ca5b0ae554f5a61e68b7b97ce342f284698a525818305b0872a9d/sedas_pyapi-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "7449e51976d475ead57c264dea0786c8", "sha256": "a653d75eec8327e515c9f3e20f578c5480f2f5c78b2c551779d19c3a35671747" }, "downloads": -1, "filename": "sedas_pyapi-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7449e51976d475ead57c264dea0786c8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13959, "upload_time": "2019-07-11T15:59:32", "url": "https://files.pythonhosted.org/packages/c9/0e/df50111ea18daed01fed5683d5d748b65ca04978f19e96397fb0d00553e1/sedas_pyapi-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09fe966b48df3e292708b311ac229fd6", "sha256": "23e3cb1abfae8e191106aa1dec1773252da2b7affd0a7e58944bc7243cad57f7" }, "downloads": -1, "filename": "sedas_pyapi-0.3.0.tar.gz", "has_sig": false, "md5_digest": "09fe966b48df3e292708b311ac229fd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9711, "upload_time": "2019-07-11T15:59:34", "url": "https://files.pythonhosted.org/packages/a5/34/7b9d1265665a78b0053b62efc58dca20e65f1aa8eb3a62675d70e8183fee/sedas_pyapi-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "dfb1cb449d5e71654ea2878f2ca28922", "sha256": "83160bec41c5c542f07449841daf86bdee6c76e010994ad455123e30927d7c8b" }, "downloads": -1, "filename": "sedas_pyapi-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dfb1cb449d5e71654ea2878f2ca28922", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14501, "upload_time": "2019-07-12T15:11:41", "url": "https://files.pythonhosted.org/packages/a4/d4/10688c126d0a105e36eedc6e1838797d7e365fd97e209bdda072f09c8094/sedas_pyapi-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f211261f8273600ce0cff205a29f8fda", "sha256": "1f3abd0d9e54740781a8183a1fe15bfacddccad6d05147936859e7f240628045" }, "downloads": -1, "filename": "sedas_pyapi-0.4.0.tar.gz", "has_sig": false, "md5_digest": "f211261f8273600ce0cff205a29f8fda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10857, "upload_time": "2019-07-12T15:11:43", "url": "https://files.pythonhosted.org/packages/24/9f/4c3097ad38887f8444f4f0922f819e6e74ad44f60d369bc755c5636dc490/sedas_pyapi-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "2c2e428c5f4bc75e92923e03b98c2a49", "sha256": "543baa56e2bfd69c4855f3fde7e758b4a2cae31b164592b3d4e00be0982d7c53" }, "downloads": -1, "filename": "sedas_pyapi-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2c2e428c5f4bc75e92923e03b98c2a49", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14765, "upload_time": "2019-07-30T10:39:42", "url": "https://files.pythonhosted.org/packages/2d/74/1bf1d643f54ae5716bba9ead533daf450f54a35d50c6ae4b24d41e9c10c0/sedas_pyapi-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b349930eb1b5956d12d5a47bd1e9aaa4", "sha256": "3e4818db1d91165c6601157cc2cad90806f747d1d7225b762be5c1c790bdc747" }, "downloads": -1, "filename": "sedas_pyapi-0.4.1.tar.gz", "has_sig": false, "md5_digest": "b349930eb1b5956d12d5a47bd1e9aaa4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11110, "upload_time": "2019-07-30T10:39:44", "url": "https://files.pythonhosted.org/packages/09/62/1ecc4355af0148402f26f010b15fa72dbbb592a7710289488968ca18ad1c/sedas_pyapi-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "643d7c4be4672a672c8d8ab72f181948", "sha256": "dc524869c1b93a223ef99e3ab7c33472fcfd8c28d022814e0b2bffe47b573497" }, "downloads": -1, "filename": "sedas_pyapi-0.4.2-py3-none-any.whl", "has_sig": false, "md5_digest": "643d7c4be4672a672c8d8ab72f181948", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14821, "upload_time": "2019-09-11T12:55:08", "url": "https://files.pythonhosted.org/packages/05/1e/edea1771f02f5e25e061ad7103c100570772e7b58307b980d7ac1e304e14/sedas_pyapi-0.4.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f021454837fb088e9b7c463114b93f36", "sha256": "5087ea603c108eb970766fa83c20187254a08c87c914d683048e1872b1df1b05" }, "downloads": -1, "filename": "sedas_pyapi-0.4.2.tar.gz", "has_sig": false, "md5_digest": "f021454837fb088e9b7c463114b93f36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11155, "upload_time": "2019-09-11T12:55:10", "url": "https://files.pythonhosted.org/packages/35/f8/74ca9b60b412bffef646a2f4aa6b5774ecb1e01f296fa394c695d3a758d2/sedas_pyapi-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "643d7c4be4672a672c8d8ab72f181948", "sha256": "dc524869c1b93a223ef99e3ab7c33472fcfd8c28d022814e0b2bffe47b573497" }, "downloads": -1, "filename": "sedas_pyapi-0.4.2-py3-none-any.whl", "has_sig": false, "md5_digest": "643d7c4be4672a672c8d8ab72f181948", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14821, "upload_time": "2019-09-11T12:55:08", "url": "https://files.pythonhosted.org/packages/05/1e/edea1771f02f5e25e061ad7103c100570772e7b58307b980d7ac1e304e14/sedas_pyapi-0.4.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f021454837fb088e9b7c463114b93f36", "sha256": "5087ea603c108eb970766fa83c20187254a08c87c914d683048e1872b1df1b05" }, "downloads": -1, "filename": "sedas_pyapi-0.4.2.tar.gz", "has_sig": false, "md5_digest": "f021454837fb088e9b7c463114b93f36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11155, "upload_time": "2019-09-11T12:55:10", "url": "https://files.pythonhosted.org/packages/35/f8/74ca9b60b412bffef646a2f4aa6b5774ecb1e01f296fa394c695d3a758d2/sedas_pyapi-0.4.2.tar.gz" } ] }