# pynasapower

[](https://github.com/alekfal/pynasapower/actions/workflows/python_package.yml)
[](https://pynasapower.readthedocs.io/en/latest/?badge=latest)
[](https://codecov.io/gh/alekfal/pynasapower)
[](https://pypi.org/project/pynasapower/)
[](https://pepy.tech/project/pynasapower)
[](https://pepy.tech/project/pynasapower)
Download meteorological data from NASA POWER restful API (https://power.larc.nasa.gov/) using pynasapower API client.
The NASA POWER database is a global database of daily meteorological data designed for agrometeorological applications and more.
Data are retrieced from in-situ observations in combination with satellite data. For more information on the NASA POWER database see the documentation at: https://power.larc.nasa.gov/.
### Installation from source
```bash
git clone https://github.com/alekfal/pynasapower.git
cd pynasapower/
pip install .
```
### Installation from PyPI
```bash
pip install pynasapower
```
### NASA POWER API client arguments
- `geometry`: Single point or polygon geometry as `geopandas.GeoDataFrame`. User can use methods pynasapower.geometry.point() or
pynasapower.geometry.bbox() to create an input geometry for this client.
- `start`: Start date as `datetime.date` format. In the examples the value is `datetime.date(2022, 1, 1)`.
- end: End date as `datetime.date` format. In the examples the value
is `datetime.date(2022, 2, 1)`.
- `path`: Local path to store the downloaded data. In the examples `"./"` is used.
- `to_file`: Boolean argument to save data locally. By default is `True`.
- `community`: The default POWER `community` is agroclimatology (`"ag"`). Other available communities are sustainable buildings (`"sb"`) and renewable energy (`"re"`). Find more about the POWER communities [here](https://power.larc.nasa.gov/docs/methodology/communities/).
- `parameters`: The default parameters for downloading (`["TOA_SW_DWN", "ALLSKY_SFC_SW_DWN", "T2M", "T2M_MIN", "T2M_MAX", "T2MDEW", "WS2M", "PRECTOTCORR"]`) are selected for downloading if an empty list (`[]`) is provided by the user. Find more for the POWER parameters in [here](https://power.larc.nasa.gov/#resources).
- temporal_api: Temporal resolution of the data. The default value is `"daily"`. Other selections are `"hourly"`, `"monthly"`, `"climatology"`. Read more about the temporal resolution of the data [here](https://power.larc.nasa.gov/docs/services/api/temporal/).
- `spatial_api`: Spatial resolution of the data. By default `"point"` is selected, but a user can also use `"regional"`. Note that in order to download a region a polygon geometry must be used in the `geometry` argument.
- `format`: Output format of the data. The default is `"csv"`. Other selections supported by the API client are: `"netcdf"`, `"json"` and `"ascii"`.
### Quickstart
Download meteorological data for a point in Athens, Greece and save result in `*.csv` format.
```python
from pynasapower.get_data import query_power
from pynasapower.geometry import point, bbox
import datetime
# Run for point in Athens and save the result in csv format
gpoint = point(23.727539, 37.983810, "EPSG:4326")
start = datetime.date(2022, 1, 1)
end = datetime.date(2022, 2, 1)
data = query_power(geometry = gpoint, start = start, end = end, path = "./data", to_file = True, community = "ag", parameters = [], temporal_api = "daily", spatial_api = "point", format = "csv")
```
Download meteorological data for a polygon in Athens, Greece and save result in `*.csv` format.
```python
# Run for small bbox in Athens and save the result in csv format
gbbox = bbox(23.727539, 26.73, 37.983810, 40.99, "EPSG:4326")
start = datetime.date(2022, 1, 1)
end = datetime.date(2022, 2, 1)
data = query_power(geometry = gbbox, start = start, end = end, path = "./data", to_file = True, community = "ag", parameters = [], temporal_api = "daily", spatial_api = "point", format = "csv")
```
Read more about the software in project's [readthedocs](https://pynasapower.readthedocs.io/en/latest/).
Raw data
{
"_id": null,
"home_page": "https://github.com/alekfal/pynasapower",
"name": "pynasapower",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Alekos Falagas <alek.falagas@gmail.com>",
"keywords": "",
"author": "Falagas Alekos",
"author_email": "Alekos Falagas <alek.falagas@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/3c/85/2f8ee710883b0a36baa6c64495fa9030b3e6701211ef7b434317906298bf/pynasapower-0.0.1a1.tar.gz",
"platform": null,
"description": "# pynasapower\n\n\n[](https://github.com/alekfal/pynasapower/actions/workflows/python_package.yml)\n[](https://pynasapower.readthedocs.io/en/latest/?badge=latest)\n[](https://codecov.io/gh/alekfal/pynasapower)\n[](https://pypi.org/project/pynasapower/)\n[](https://pepy.tech/project/pynasapower)\n[](https://pepy.tech/project/pynasapower)\n\nDownload meteorological data from NASA POWER restful API (https://power.larc.nasa.gov/) using pynasapower API client.\n\nThe NASA POWER database is a global database of daily meteorological data designed for agrometeorological applications and more. \nData are retrieced from in-situ observations in combination with satellite data. For more information on the NASA POWER database see the documentation at: https://power.larc.nasa.gov/.\n\n### Installation from source\n\n```bash\ngit clone https://github.com/alekfal/pynasapower.git\ncd pynasapower/\npip install .\n```\n\n### Installation from PyPI\n\n```bash\npip install pynasapower\n```\n\n### NASA POWER API client arguments\n\n- `geometry`: Single point or polygon geometry as `geopandas.GeoDataFrame`. User can use methods pynasapower.geometry.point() or\npynasapower.geometry.bbox() to create an input geometry for this client.\n- `start`: Start date as `datetime.date` format. In the examples the value is `datetime.date(2022, 1, 1)`. \n- end: End date as `datetime.date` format. In the examples the value\nis `datetime.date(2022, 2, 1)`.\n- `path`: Local path to store the downloaded data. In the examples `\"./\"` is used.\n- `to_file`: Boolean argument to save data locally. By default is `True`.\n- `community`: The default POWER `community` is agroclimatology (`\"ag\"`). Other available communities are sustainable buildings (`\"sb\"`) and renewable energy (`\"re\"`). Find more about the POWER communities [here](https://power.larc.nasa.gov/docs/methodology/communities/).\n- `parameters`: The default parameters for downloading (`[\"TOA_SW_DWN\", \"ALLSKY_SFC_SW_DWN\", \"T2M\", \"T2M_MIN\", \"T2M_MAX\", \"T2MDEW\", \"WS2M\", \"PRECTOTCORR\"]`) are selected for downloading if an empty list (`[]`) is provided by the user. Find more for the POWER parameters in [here](https://power.larc.nasa.gov/#resources).\n- temporal_api: Temporal resolution of the data. The default value is `\"daily\"`. Other selections are `\"hourly\"`, `\"monthly\"`, `\"climatology\"`. Read more about the temporal resolution of the data [here](https://power.larc.nasa.gov/docs/services/api/temporal/).\n- `spatial_api`: Spatial resolution of the data. By default `\"point\"` is selected, but a user can also use `\"regional\"`. Note that in order to download a region a polygon geometry must be used in the `geometry` argument.\n- `format`: Output format of the data. The default is `\"csv\"`. Other selections supported by the API client are: `\"netcdf\"`, `\"json\"` and `\"ascii\"`. \n\n\n### Quickstart\n\nDownload meteorological data for a point in Athens, Greece and save result in `*.csv` format.\n\n```python\nfrom pynasapower.get_data import query_power\nfrom pynasapower.geometry import point, bbox\nimport datetime\n\n# Run for point in Athens and save the result in csv format\ngpoint = point(23.727539, 37.983810, \"EPSG:4326\")\nstart = datetime.date(2022, 1, 1)\nend = datetime.date(2022, 2, 1)\ndata = query_power(geometry = gpoint, start = start, end = end, path = \"./data\", to_file = True, community = \"ag\", parameters = [], temporal_api = \"daily\", spatial_api = \"point\", format = \"csv\")\n```\n\nDownload meteorological data for a polygon in Athens, Greece and save result in `*.csv` format.\n\n```python\n# Run for small bbox in Athens and save the result in csv format\ngbbox = bbox(23.727539, 26.73, 37.983810, 40.99, \"EPSG:4326\")\nstart = datetime.date(2022, 1, 1)\nend = datetime.date(2022, 2, 1)\ndata = query_power(geometry = gbbox, start = start, end = end, path = \"./data\", to_file = True, community = \"ag\", parameters = [], temporal_api = \"daily\", spatial_api = \"point\", format = \"csv\")\n```\n\nRead more about the software in project's [readthedocs](https://pynasapower.readthedocs.io/en/latest/).\n",
"bugtrack_url": null,
"license": "GPL3",
"summary": "Download meteorological data from NASA POWER API (https://power.larc.nasa.gov/)",
"version": "0.0.1a1",
"project_urls": {
"Homepage": "https://github.com/alekfal/pynasapower"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b8ac5d97fef68d59835a24ef598a599b52419d6065b09db918205c4c2a017313",
"md5": "aba233ac117cd38707fba1db357a157b",
"sha256": "fc63ff0e8c0b6f86baa99790f132d0653be455b84c1e19074087db0464d676a8"
},
"downloads": -1,
"filename": "pynasapower-0.0.1a1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aba233ac117cd38707fba1db357a157b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 19660,
"upload_time": "2023-11-13T13:39:25",
"upload_time_iso_8601": "2023-11-13T13:39:25.463513Z",
"url": "https://files.pythonhosted.org/packages/b8/ac/5d97fef68d59835a24ef598a599b52419d6065b09db918205c4c2a017313/pynasapower-0.0.1a1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3c852f8ee710883b0a36baa6c64495fa9030b3e6701211ef7b434317906298bf",
"md5": "ee2e0cbd52d95fd2c7bfc885509056b9",
"sha256": "501b4761154ccf79fb4d36fcdad43511712aab978a510ad5cc2fc38551df43b9"
},
"downloads": -1,
"filename": "pynasapower-0.0.1a1.tar.gz",
"has_sig": false,
"md5_digest": "ee2e0cbd52d95fd2c7bfc885509056b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 21774,
"upload_time": "2023-11-13T13:39:26",
"upload_time_iso_8601": "2023-11-13T13:39:26.939937Z",
"url": "https://files.pythonhosted.org/packages/3c/85/2f8ee710883b0a36baa6c64495fa9030b3e6701211ef7b434317906298bf/pynasapower-0.0.1a1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-13 13:39:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alekfal",
"github_project": "pynasapower",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pandas",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "geopandas",
"specs": []
},
{
"name": "shapely",
"specs": []
},
{
"name": "xarray",
"specs": []
},
{
"name": "scipy",
"specs": []
}
],
"lcname": "pynasapower"
}