rws-waterinfo


Namerws-waterinfo JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://gitlab.com/rwsdatalab/public/codebase/tools/rws-waterinfo
Summary
upload_time2023-03-29 13:29:18
maintainer
docs_urlNone
authorRWS Datalab
requires_python
license
keywords rws_waterinfo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ################
rws_waterinfo
################

.. begin-inclusion-intro-marker-do-not-remove



.. end-inclusion-intro-marker-do-not-remove


.. begin-inclusion-usage-marker-do-not-remove

How to use
----------

Provide user documentation here.

.. end-inclusion-usage-marker-do-not-remove


.. begin-inclusion-installation-marker-do-not-remove

Installation
------------

To install rws_waterinfo, do:

.. code-block:: console

  pip install rws-waterinfo


Run tests (including coverage) with:

.. code-block:: console

  pip install -r requirements-dev.txt
  python setup.py test

.. end-inclusion-installation-marker-do-not-remove


Example
-------

Get observation data from Waterinfo
Here we retrieve observation data from Waterinfo. It takes in
three arguments, two of which are optional, and returns a Pandas dataframe
or None. The first argument, params, is a list of lists that contains the
necessary parameters to retrieve observations. The second argument,
filepath, is an optional string that specifies the directory and file name
where the data will be saved. If filepath is not specified, the data will
not be saved. The third argument, return_df, is an optional boolean that
specifies whether the function should return the observations as a Pandas
dataframe or not. If return_df is set to False, the function will not
return anything.

.. code-block:: python

	import pandas as pd
	import rws_waterinfo as rw
	# Initialize rws_waterinfo library
	#
	params  = [['OW', 'm3/s', 156, 'Q', 'OLST', 711556.219876449,
	5803627.64455833, '2022-01-01', '2023-01-01']]
	filepath = 'observations.csv'
	#
	data = rw.get_data(params=params, filepath=filepath, return_df=True)
	#
	print(data.head())
	#
	# Locatie_MessageID Coordinatenstelsel  ...  WaardeBewerkingsmethode.Code
	WaardeBewerkingsmethode.Omschrijving
	# 0              18878              25831  ... NaN                                   NaN
	# 1              18878              25831  ... NaN                                   NaN
	# 2              18878              25831  ... NaN                                   NaN
	# 3              18878              25831  ... NaN                                   NaN
	# 4              18878              25831  ... NaN                                   NaN
	# [5 rows x 54 columns]




This function sends a request to Waterinfo for parameter information
and parses the response into a Pandas DataFrame. The DataFrame contains
the locations and parameters combined into a single table.

.. code-block:: python

	import pandas as pd
	# Initialize rws_waterinfo library
	import rws_waterinfo as rw
	#
	catalog = rw.get_catalog()
	#
	catalog.head()
	#
	# AquoMetaData_MessageID	Locatie_MessageID	Coordinatenstelsel	X	Y
	# 0	12746	22317	25831	717567.392073	5.782901e+06
	# 1	17619	22366	25831	706152.313357	5.725423e+06
	# 2	7941	17613	25831	580241.163781	5.723650e+06
	# 3	14352	21173	25831	705635.738484	5.835367e+06
	# 4	18676	21173	25831	705635.738484	5.835367e+06
	# 5 rows × 44 columns
	#


.. begin-inclusion-license-marker-do-not-remove

License
-------

Copyright (c) 2023, Rijkswaterstaat



.. end-inclusion-license-marker-do-not-remove





            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/rwsdatalab/public/codebase/tools/rws-waterinfo",
    "name": "rws-waterinfo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "rws_waterinfo",
    "author": "RWS Datalab",
    "author_email": "datalab.codebase@rws.nl",
    "download_url": "https://files.pythonhosted.org/packages/55/c8/c88110e0d22ce39e407acf383d20b25d5cbc704586aa208badfffbdab13c/rws_waterinfo-0.1.1.tar.gz",
    "platform": null,
    "description": "################\nrws_waterinfo\n################\n\n.. begin-inclusion-intro-marker-do-not-remove\n\n\n\n.. end-inclusion-intro-marker-do-not-remove\n\n\n.. begin-inclusion-usage-marker-do-not-remove\n\nHow to use\n----------\n\nProvide user documentation here.\n\n.. end-inclusion-usage-marker-do-not-remove\n\n\n.. begin-inclusion-installation-marker-do-not-remove\n\nInstallation\n------------\n\nTo install rws_waterinfo, do:\n\n.. code-block:: console\n\n  pip install rws-waterinfo\n\n\nRun tests (including coverage) with:\n\n.. code-block:: console\n\n  pip install -r requirements-dev.txt\n  python setup.py test\n\n.. end-inclusion-installation-marker-do-not-remove\n\n\nExample\n-------\n\nGet observation data from Waterinfo\nHere we retrieve observation data from Waterinfo. It takes in\nthree arguments, two of which are optional, and returns a Pandas dataframe\nor None. The first argument, params, is a list of lists that contains the\nnecessary parameters to retrieve observations. The second argument,\nfilepath, is an optional string that specifies the directory and file name\nwhere the data will be saved. If filepath is not specified, the data will\nnot be saved. The third argument, return_df, is an optional boolean that\nspecifies whether the function should return the observations as a Pandas\ndataframe or not. If return_df is set to False, the function will not\nreturn anything.\n\n.. code-block:: python\n\n\timport pandas as pd\n\timport rws_waterinfo as rw\n\t# Initialize rws_waterinfo library\n\t#\n\tparams  = [['OW', 'm3/s', 156, 'Q', 'OLST', 711556.219876449,\n\t5803627.64455833, '2022-01-01', '2023-01-01']]\n\tfilepath = 'observations.csv'\n\t#\n\tdata = rw.get_data(params=params, filepath=filepath, return_df=True)\n\t#\n\tprint(data.head())\n\t#\n\t# Locatie_MessageID Coordinatenstelsel  ...  WaardeBewerkingsmethode.Code\n\tWaardeBewerkingsmethode.Omschrijving\n\t# 0              18878              25831  ... NaN                                   NaN\n\t# 1              18878              25831  ... NaN                                   NaN\n\t# 2              18878              25831  ... NaN                                   NaN\n\t# 3              18878              25831  ... NaN                                   NaN\n\t# 4              18878              25831  ... NaN                                   NaN\n\t# [5 rows x 54 columns]\n\n\n\n\nThis function sends a request to Waterinfo for parameter information\nand parses the response into a Pandas DataFrame. The DataFrame contains\nthe locations and parameters combined into a single table.\n\n.. code-block:: python\n\n\timport pandas as pd\n\t# Initialize rws_waterinfo library\n\timport rws_waterinfo as rw\n\t#\n\tcatalog = rw.get_catalog()\n\t#\n\tcatalog.head()\n\t#\n\t# AquoMetaData_MessageID\tLocatie_MessageID\tCoordinatenstelsel\tX\tY\n\t# 0\t12746\t22317\t25831\t717567.392073\t5.782901e+06\n\t# 1\t17619\t22366\t25831\t706152.313357\t5.725423e+06\n\t# 2\t7941\t17613\t25831\t580241.163781\t5.723650e+06\n\t# 3\t14352\t21173\t25831\t705635.738484\t5.835367e+06\n\t# 4\t18676\t21173\t25831\t705635.738484\t5.835367e+06\n\t# 5 rows \u00d7 44 columns\n\t#\n\n\n.. begin-inclusion-license-marker-do-not-remove\n\nLicense\n-------\n\nCopyright (c) 2023, Rijkswaterstaat\n\n\n\n.. end-inclusion-license-marker-do-not-remove\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.1.1",
    "split_keywords": [
        "rws_waterinfo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d00fbde1189caef71a1c3fd56bfbe6bb58da22a19f6b781f64156c75d35a309",
                "md5": "ad6c0d71829a4ca77389b81b8478921d",
                "sha256": "7cad5aa8a22ed2528ee7a9d57cd3e2c39e9eeaf0503ac247bbb210d8d07c7a30"
            },
            "downloads": -1,
            "filename": "rws_waterinfo-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad6c0d71829a4ca77389b81b8478921d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9877,
            "upload_time": "2023-03-29T13:29:16",
            "upload_time_iso_8601": "2023-03-29T13:29:16.306376Z",
            "url": "https://files.pythonhosted.org/packages/4d/00/fbde1189caef71a1c3fd56bfbe6bb58da22a19f6b781f64156c75d35a309/rws_waterinfo-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55c8c88110e0d22ce39e407acf383d20b25d5cbc704586aa208badfffbdab13c",
                "md5": "8c59a2cd495094ae74ef3f18e1752e15",
                "sha256": "20d8a95391c0e30e924fe7b8e32c700a28675dc738b11a286ff98fda9cfe45bd"
            },
            "downloads": -1,
            "filename": "rws_waterinfo-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8c59a2cd495094ae74ef3f18e1752e15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10117,
            "upload_time": "2023-03-29T13:29:18",
            "upload_time_iso_8601": "2023-03-29T13:29:18.455813Z",
            "url": "https://files.pythonhosted.org/packages/55/c8/c88110e0d22ce39e407acf383d20b25d5cbc704586aa208badfffbdab13c/rws_waterinfo-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-29 13:29:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "rws-waterinfo"
}
        
Elapsed time: 0.06199s