{ "info": { "author": "C. Ryan Manzer", "author_email": "ryan@gensci.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7" ], "description": "# NDBC\n\n![alt text](http://www.ndbc.noaa.gov/images/nws/noaaleft.jpg \"NOAA\") ![alt text](http://www.ndbc.noaa.gov/images/nws/ndbc_title.jpg \"NDBC\")\n\nThis repository represents my attempts to build out Python class(es)\nto facilitate the acquisition, analysis, and visualization of National\nData Buoy Center (NDBC) data. The goal is to develop a set of APIs to\nfacilitate rapid discovery of data resources, exploratory data analysis,\nand allow integration into automated data workflows.\n\n## NDBC.py\n\nThis file defines the DataBuoy class. The purpose of this class is to\nallow a user to define a specific data buoy they wish to gather data\nfrom and provide the user with methods to collect and analyze this data.\n\nDependencies are listed in `requirements.txt`\n\n## Usage\n\n#### Installation\n\nInstall using pip from PyPI\n\n```\npip install NDBC\n```\n\nThen you are ready to start using this module in exploratory data analyses and scripted workflows.\n\n#### Methods of DataBuoy Class\n\n`.set_station_id`\n\nIf a DataBuoy class has been instantiated without any `station_id` argument, this method allows for setting a station id\n\n```\nfrom NDBC.NDBC import DataBuoy\nDB = DataBuoy()\nDB.set_station_id('46042') # <- Either strings or numbers are acceptable\n```\n\n`.get_station_metadata()`\n\nPerform a scrape of the public webpage for a specified data station and save a dictionary of available metadata to the `.station_info` property. This is only available if a DataBuoy has a valid `station_id` set (either during class instantiation or using\nthe `set_station_id` method).\n\n```\nfrom NDBC.NDBC import DataBuoy\nDB = DataBuoy(46042)\nDB.get_station_metadata()\nDB.station_info\n{ 'Air temp height': '4 m above site elevation',\n 'Anemometer height': '5 m above site elevation',\n 'Barometer elevation': 'sea level',\n 'Sea temp depth': '0.6 m below water line',\n 'Site elevation': 'sea level',\n 'Watch circle radius': '1789 yards',\n 'Water depth': '1645.9 m',\n 'lat': '36.785 N',\n 'lon': '122.398 W'}\n```\n\n- `.get_data(datetime_index=False)`\n\nAfter importing, the DataBuoy class is instantiated with the ID of the\nstation from which historical data is sought. Then data may be gathered for\nthe years and months specified. If no time period is specified, the most recent\nfull month available is retrieved.\n\nThe default behavior is to append datetime values built from date part columns (YY, MM, DD, etc.) to a column 'datetime'. If value `True` is passed as the `datetime_index` argument, the datetime values will be used as index values for the returned dataframe. In some cases this is advantageous for time series analyses.\n\n```\nfrom NDBC.NDBC import DataBuoy\n\nn42 = DataBuoy(46042) # <- String or numeric station ids are valid\n\nn42.get_data(datetime_index=True) # <- no year, month argumets so latest full month is retrieved. Default data type is 'stdmet'\n\nOct not available. # <- Where data is missing, messages are returned to the terminal via a logger.warning() call\nSep not available.\n\nn42.data # <- anticipating additional data collection methods, the .data property returns a dictionary. Indiviudual\n data products are returned as pandas DataFrame objects\n\n# Datetime objects are compiled from individual year, month, day, hour, minute columns and used as the index to support\n# slicing data by time frames.\n\n{'stdmet': WDIR WSPD GST WVHT DPD APD MWD PRES ATMP WTMP DEWP VIS TIDE\n2019-07-31 23:50:00 298 3.6 5.2 1.25 7.69 5.37 303 1015.1 13.4 15.2 999.0 99.0 99.00\n2019-08-01 00:50:00 301 5.7 7.2 1.26 7.14 5.42 306 1014.8 13.4 15.3 999.0 99.0 99.00\n2019-08-01 01:50:00 323 6.6 8.3 1.33 7.14 5.47 312 1014.5 13.2 15.1 999.0 99.0 99.00\n2019-08-01 02:50:00 347 5.8 7.7 1.32 7.69 5.15 319 1014.5 12.7 15.1 999.0 99.0 99.00\n2019-08-01 03:50:00 353 5.6 7.2 1.26 7.69 5.31 325 1014.9 12.6 15.0 999.0 99.0 99.00\n... ... ... ... ... ... ... ... ... ... ... ... ... ...\n2019-08-31 18:50:00 999 6.2 7.4 0.87 13.79 4.67 186 1014.6 17.0 17.2 999.0 99.0 99.00\n2019-08-31 19:50:00 999 6.8 8.3 0.83 13.79 4.56 178 1014.2 17.2 17.3 999.0 99.0 99.00\n2019-08-31 20:50:00 999 6.5 7.8 0.89 13.79 4.38 195 1013.8 17.5 17.4 999.0 99.0 99.00\n2019-08-31 21:50:00 999 7.5 8.9 0.95 13.79 4.52 190 1013.1 17.5 17.3 999.0 99.0 99.00\n2019-08-31 22:50:00 999 8.0 9.4 0.95 13.79 4.09 171 1012.7 17.7 17.1 999.0 99.0 99.00\n\n[741 rows x 13 columns]}\n```\n\nBy default the `get_data()` function will fetch the most current month's data. However, the function can take lists of years & months ([int]) to specify a timeframe.\n\n```\n>>> n42 = NDBC.DataBuoy('46042')\n>>> n42.get_data(months=[1,2], years=range(2019, 2020), datetime_index=True, data_type='swden)\nYear 2019 not available.\nYear 2020 not available.\n\n>>> n42.data\n{'swden': {'data': .0200 .0325 .0375 .0425 .0475 .0525 .0575 .0625 .0675 .0725 .0775 .0825 .0875 ... .3000 .3100 .3200 .3300 .3400 .3500 .3650 .3850 .4050 .4250 .4450 .4650 .4850\n2021-01-01 00:40:00 0.0 0.0 0.0 0.00 1.17 9.11 24.25 24.95 15.84 20.44 26.48 20.63 12.72 ... 0.28 0.31 0.19 0.20 0.13 0.07 0.06 0.05 0.03 0.01 0.01 0.00 0.0\n2021-01-01 01:40:00 0.0 0.0 0.0 0.00 0.00 13.76 26.55 22.40 24.12 30.09 23.41 15.74 14.95 ... 0.25 0.16 0.12 0.16 0.06 0.16 0.06 0.03 0.05 0.02 0.01 0.00 0.0\n2021-01-01 02:40:00 0.0 0.0 0.0 0.00 0.93 4.40 16.03 33.95 41.48 38.02 31.47 18.88 14.59 ... 0.21 0.15 0.18 0.14 0.14 0.10 0.07 0.05 0.03 0.02 0.01 0.00 0.0\n2021-01-01 03:40:00 0.0 0.0 0.0 0.07 1.14 6.95 27.94 45.68 41.92 30.11 25.03 19.52 10.93 ... 0.22 0.20 0.16 0.09 0.08 0.15 0.09 0.04 0.02 0.01 0.00 0.01 0.0\n2021-01-01 04:40:00 0.0 0.0 0.0 0.00 0.76 3.64 11.23 18.23 29.84 27.19 12.85 11.20 9.77 ... 0.13 0.17 0.14 0.16 0.08 0.08 0.07 0.08 0.05 0.01 0.01 0.00 0.0\n... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...\n2021-02-28 19:40:00 0.0 0.0 0.0 0.00 0.00 0.00 0.06 0.25 1.42 2.50 9.48 11.48 8.46 ... 0.21 0.13 0.11 0.08 0.10 0.04 0.02 0.02 0.03 0.01 0.00 0.00 0.0\n2021-02-28 20:40:00 0.0 0.0 0.0 0.02 0.05 0.08 0.24 1.02 3.97 4.97 4.99 8.31 10.09 ... 0.21 0.07 0.09 0.06 0.05 0.10 0.04 0.03 0.01 0.01 0.00 0.00 0.0\n2021-02-28 21:40:00 0.0 0.0 0.0 0.00 0.00 0.15 0.30 0.36 1.63 4.18 6.85 7.82 7.98 ... 0.12 0.11 0.09 0.08 0.04 0.05 0.06 0.02 0.01 0.01 0.00 0.00 0.0\n2021-02-28 22:40:00 0.0 0.0 0.0 0.00 0.01 0.09 0.10 0.32 2.84 3.82 3.91 4.92 5.17 ... 0.17 0.09 0.13 0.05 0.05 0.08 0.06 0.03 0.01 0.01 0.00 0.00 0.0\n2021-02-28 23:40:00 0.0 0.0 0.0 0.00 0.00 0.00 0.18 0.25 1.78 3.97 5.08 4.98 5.40 ... 0.07 0.10 0.11 0.08 0.08 0.06 0.03 0.02 0.01 0.01 0.00 0.00 0.0\n\n[1413 rows x 47 columns]}}\n\n```\n\nLikely due to my own biases in my research interests, the `get_data()` function will default to fetching\nstandard meteorological data. However, users can specify different data packages like so `get_data(data_type='cwind')`. To view which data packages\nare currently supported examine the `DataBuoy.DATA_PACKAGES` attribute:\n```\n{'cwind': {'name': 'Continous Wind Data', 'url_char': 'c'},\n 'srad': {'name': 'Solar radiation data', 'url_char': 'r'},\n 'stdmet': {'name': 'Standard meteoroligcal data', 'url_char': 'h'},\n 'swden': {'name': 'Spectral Wave Density data', 'url_char': 'w'},\n 'swdir': {'name': 'Spectral wave (alpha1) direction data', 'url_char': 'd'},\n 'swdir2': {'name': 'Spectral wave (alpha2) direction data', 'url_char': 'i'},\n 'swr1': {'name': 'Spectral wave (r1) direction data', 'url_char': 'j'},\n 'swr2': {'name': 'Spectral wave (r2) direction data', 'url_char': 'k'}}\n\n```\n\nUsing the pandas DataFrame to store the returned data provides access to the wide array of methods the pandas package\nprovides.\n\n- `.save(filename(optional))`\n\nSaves an instantiated DataBuoy object as JSON to a file. If `filename` is not specified the file name will follow the\n`databuoy_{station_id}.json` convention.\n\n```\ndb = DataBuoy(46042)\ndb.save('/path/to/file/my_filename.json')\n```\n\n_classmethod_\n\n- `.load(filename)`\n Instantiate a DataBuoy object from a file, generated by the `.save()` method.\n\n```\ndb = DataBuoy.load('/path/to/file.json')\n```\n\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/GenSci/NDBC", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "NDBC", "package_url": "https://pypi.org/project/NDBC/", "platform": "", "project_url": "https://pypi.org/project/NDBC/", "project_urls": { "Homepage": "https://github.com/GenSci/NDBC" }, "release_url": "https://pypi.org/project/NDBC/1.1.1/", "requires_dist": null, "requires_python": ">=3.7", "summary": "A package to automate the loading of NDBC data to a custom object.", "version": "1.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 10296393, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e1b90e99736a7d5d62b265357b994af3", "sha256": "869f6b439e2696cb3a024a5ac5abd683fa175a0749707b2576e2e1488c968542" }, "downloads": -1, "filename": "NDBC-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e1b90e99736a7d5d62b265357b994af3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5355, "upload_time": "2018-06-17T00:37:41", "upload_time_iso_8601": "2018-06-17T00:37:41.169370Z", "url": "https://files.pythonhosted.org/packages/a8/b2/77499abd1fce9b23e4c5b32b90c8e689d9be3b7a751eced09913df0f66a3/NDBC-0.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1dabceec74795348a709bc3196ec73f3", "sha256": "9e6af4186fc1c25872b6f4e79986b47ed987e14d0856ce6835413f98d9df2c73" }, "downloads": -1, "filename": "NDBC-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1dabceec74795348a709bc3196ec73f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4892, "upload_time": "2018-06-17T00:37:42", "upload_time_iso_8601": "2018-06-17T00:37:42.490832Z", "url": "https://files.pythonhosted.org/packages/c2/9a/f7c5d728f1a224dddbf6faf6377b0b7ca5c446fd575eb40467384ea66a78/NDBC-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "92f7641c29876fb20c63a149e1ebda53", "sha256": "120ddecb2548c894345a1b9f79ec9bc8d75accf86a36d5cc6ae13d0c8c3c031a" }, "downloads": -1, "filename": "NDBC-0.1.0.tar.gz", "has_sig": false, "md5_digest": "92f7641c29876fb20c63a149e1ebda53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7520, "upload_time": "2019-10-27T21:15:24", "upload_time_iso_8601": "2019-10-27T21:15:24.157836Z", "url": "https://files.pythonhosted.org/packages/e7/54/e0c1adcc014453e70f6c6803aac0b33ac524ef81b370e7e2f36a838e82ff/NDBC-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6f9686cb73d0160548524e7761b8508a", "sha256": "df7510d1691be26e3ffb0d1349ad8a87783ce56fe5b158171534573656b42771" }, "downloads": -1, "filename": "NDBC-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6f9686cb73d0160548524e7761b8508a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8202, "upload_time": "2019-11-30T21:01:26", "upload_time_iso_8601": "2019-11-30T21:01:26.946978Z", "url": "https://files.pythonhosted.org/packages/41/22/9e17318a2cd8ca31d75e92709483a6200d0c31918f20fe0f7e719d044d53/NDBC-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "3462f46764224db8802afabbedb076d6", "sha256": "b57770eb18568ad96fbd8c5fa22da8484ce7ee19a8704c2448391e6554de6f9d" }, "downloads": -1, "filename": "NDBC-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3462f46764224db8802afabbedb076d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 11300, "upload_time": "2020-06-28T17:06:04", "upload_time_iso_8601": "2020-06-28T17:06:04.971467Z", "url": "https://files.pythonhosted.org/packages/9c/e8/eb9258ebcc3eddfae2b88c1fe4e3e1419ca681627ac89986d1a837b9b139/NDBC-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "2eb3ceeb17c7761508dd6f454f82d9a0", "sha256": "67e5a26aaadc363b34fb987b35e85224361bbc38db2401b2614df1823fc3d6f2" }, "downloads": -1, "filename": "NDBC-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2eb3ceeb17c7761508dd6f454f82d9a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11753, "upload_time": "2020-06-28T17:06:06", "upload_time_iso_8601": "2020-06-28T17:06:06.762184Z", "url": "https://files.pythonhosted.org/packages/14/d3/6e54d50e7314c168c02beb9b0f42b591c5b3824f663eb541273e13895096/NDBC-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "72861125f0db37075a76d8112451709e", "sha256": "a509390824af1d738032b6f1a7d6ad21a00650a9883ff9c25b68450f7e758647" }, "downloads": -1, "filename": "NDBC-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "72861125f0db37075a76d8112451709e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 11498, "upload_time": "2021-02-06T20:33:58", "upload_time_iso_8601": "2021-02-06T20:33:58.987769Z", "url": "https://files.pythonhosted.org/packages/92/9a/490b6dcccd8e1fa534ec9cdf2489719c789577daa4b48e3703bb6ffacec5/NDBC-1.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "666d0ea5eb7c880dadb045afc6a22ad3", "sha256": "696b8c61e423129fc8e32f545f7923d99c470283da2095245f36f38b69c51cda" }, "downloads": -1, "filename": "NDBC-1.0.1.tar.gz", "has_sig": false, "md5_digest": "666d0ea5eb7c880dadb045afc6a22ad3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 12169, "upload_time": "2021-02-06T20:34:00", "upload_time_iso_8601": "2021-02-06T20:34:00.712168Z", "url": "https://files.pythonhosted.org/packages/3c/e4/9ed950f62107a45574a69f74bbfb22d2523aaa13bb1b7aa3b35ba7c1f5ca/NDBC-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "bff12e9533486a5605774dafc28cf8d7", "sha256": "1c906806ac02fe996f129d124d0da5f97ed837abfb56d7bbd4fc9e4e5e20c03f" }, "downloads": -1, "filename": "NDBC-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bff12e9533486a5605774dafc28cf8d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 13403, "upload_time": "2021-04-04T21:05:30", "upload_time_iso_8601": "2021-04-04T21:05:30.651459Z", "url": "https://files.pythonhosted.org/packages/77/7a/1a64a12fb550a9874d40fa1b3e3fe17589bb5914a37f366a01d20dcd39d3/NDBC-1.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "304b4872cdd49945c8d6ac3238e8a367", "sha256": "f45506693c409817c8fbff17d69ac480533497cce24bdbc065e434efc53d0cb8" }, "downloads": -1, "filename": "NDBC-1.1.0.tar.gz", "has_sig": false, "md5_digest": "304b4872cdd49945c8d6ac3238e8a367", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 13913, "upload_time": "2021-04-04T21:05:33", "upload_time_iso_8601": "2021-04-04T21:05:33.407301Z", "url": "https://files.pythonhosted.org/packages/ad/82/79becd5891f3584b9f132cfa0723915131bfadfbf7bcfe3d19a5f766438a/NDBC-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "e5fd24fd864b64efd69a845bb27def8b", "sha256": "af6faffeca173ce865caee68771ef25dbacf389689d505cf18ae28c68d0d43ea" }, "downloads": -1, "filename": "NDBC-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e5fd24fd864b64efd69a845bb27def8b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 14099, "upload_time": "2021-05-08T19:14:28", "upload_time_iso_8601": "2021-05-08T19:14:28.991758Z", "url": "https://files.pythonhosted.org/packages/56/42/39a1fd669313e36b2ee57424319cd80b1a7d5313aea106e872e63389dbcd/NDBC-1.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "aa913af36922641a15059d98744c92c5", "sha256": "c2595be60202d8eee89385d1b4e7867269ea54f2384d376c4d591f6d282be776" }, "downloads": -1, "filename": "NDBC-1.1.1.tar.gz", "has_sig": false, "md5_digest": "aa913af36922641a15059d98744c92c5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 13259, "upload_time": "2021-05-08T19:14:30", "upload_time_iso_8601": "2021-05-08T19:14:30.081536Z", "url": "https://files.pythonhosted.org/packages/a8/3b/b60df4dd92e8bf8c982bd7cc03fb7c715c6f34a52fd8984dccb6696113f1/NDBC-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5fd24fd864b64efd69a845bb27def8b", "sha256": "af6faffeca173ce865caee68771ef25dbacf389689d505cf18ae28c68d0d43ea" }, "downloads": -1, "filename": "NDBC-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e5fd24fd864b64efd69a845bb27def8b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 14099, "upload_time": "2021-05-08T19:14:28", "upload_time_iso_8601": "2021-05-08T19:14:28.991758Z", "url": "https://files.pythonhosted.org/packages/56/42/39a1fd669313e36b2ee57424319cd80b1a7d5313aea106e872e63389dbcd/NDBC-1.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "aa913af36922641a15059d98744c92c5", "sha256": "c2595be60202d8eee89385d1b4e7867269ea54f2384d376c4d591f6d282be776" }, "downloads": -1, "filename": "NDBC-1.1.1.tar.gz", "has_sig": false, "md5_digest": "aa913af36922641a15059d98744c92c5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 13259, "upload_time": "2021-05-08T19:14:30", "upload_time_iso_8601": "2021-05-08T19:14:30.081536Z", "url": "https://files.pythonhosted.org/packages/a8/3b/b60df4dd92e8bf8c982bd7cc03fb7c715c6f34a52fd8984dccb6696113f1/NDBC-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }