pastastore


Namepastastore JSON
Version 1.4.0 PyPI version JSON
download
home_pageNone
SummaryTools for managing Pastas time series models.
upload_time2024-03-22 13:13:25
maintainerNone
docs_urlNone
authorD.A. Brakenhoff
requires_python>=3.7
licenseThe MIT License (MIT) Copyright (c) 2020 D.A. Brakenhoff Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords hydrology groundwater time series analysis database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![pastastore](https://github.com/pastas/pastastore/workflows/pastastore/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/pastastore/badge/?version=latest)](https://pastastore.readthedocs.io/en/latest/?badge=latest)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/81b1e0294f5247cfa4eca657a8eebc61)](https://www.codacy.com/gh/pastas/pastastore?utm_source=github.com&utm_medium=referral&utm_content=pastas/pastastore&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/81b1e0294f5247cfa4eca657a8eebc61)](https://www.codacy.com/gh/pastas/pastastore/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pastas/pastastore&utm_campaign=Badge_Coverage)
![PyPI](https://img.shields.io/pypi/v/pastastore)

# pastastore

This module stores 
[Pastas](https://pastas.readthedocs.io/en/latest/) time series and models in a
database.

Storing time series and models in a database allows the user to manage time
series and Pastas models on disk, which allows the user to pick up where they
left off without having to reload everything.

## Installation

Install the module with `pip install pastastore`.

For installing in development mode, clone the repository and install by typing
`pip install -e .` from the module root directory.

For plotting background maps, the `contextily` and `pyproj` packages are
required. For a full install, including optional dependencies for plotting and
labeling data on maps, use: `pip install pastastore[optional]` Windows users
are asked to install `rasterio` themselves since it often cannot be installed
using `pip`. `rasterio` is a dependency of `contextily`.

## Usage

The following snippets show typical usage. The first step is to define a
so-called `Connector` object. This object contains methods to store time series
or models to the database, or read objects from the database.

The following code creates a PasConnector, which uses Pastas JSON-styled
"`.pas`-files" to save models in a folder on your computer (in this case a
folder called `pastas_db` in the current directory).

```python
import pastastore as pst

# create connector instance
conn = pst.PasConnector(name="pastas_db", path=".")
```

The next step is to pass that connector to the `PastaStore` object. This object
contains all kinds of useful methods to analyze and visualize time series, and
build and analyze models.

```python
# create PastaStore instance
pstore = pst.PastaStore(conn)
```

Now the user can add time series, models or analyze or visualize existing
objects in the database. Some examples showing the functionality of the
PastaStore object are shown below:

```python
import pandas as pd
import pastas as ps

# load oseries from CSV and add to database
oseries = pd.read_csv("oseries.csv")
pstore.add_oseries(oseries, "my_oseries", metadata={"x": 100_000, "y": 400_000})

# read oseries from database
oseries = pstore.get_oseries("my_oseries")

# view oseries metadata DataFrame
pstore.oseries

# plot oseries location on map
ax = pstore.maps.oseries()
pstore.maps.add_background_map(ax)  # add a background map

# plot my_oseries time series
ax2 = pstore.plot.oseries(names=["my_oseries"])

# create a model with pastas
ml = ps.Model(oseries, name="my_model")

# add model to database
pstore.add_model(ml)

# load model from database
ml2 = pstore.get_models("my_model")

# export whole database to a zip file
pstore.to_zip("my_backup.zip")
```

For more elaborate examples, refer to the
[Notebooks](https://pastastore.readthedocs.io/en/latest/examples.html#example-notebooks).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pastastore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "\"D.A. Brakenhoff\" <d.brakenhoff@artesia-water.nl>, \"R. Calje\" <r.calje@artesia-water.nl>, \"M.A. Vonk\" <m.vonk@artesia-water.nl>",
    "keywords": "hydrology, groundwater, time series, analysis, database",
    "author": "D.A. Brakenhoff",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/3f/54/a7c1fbc3e05a5919f2ec935a73a36ee92ddb202440e81dc27aaa338385b6/pastastore-1.4.0.tar.gz",
    "platform": null,
    "description": "![pastastore](https://github.com/pastas/pastastore/workflows/pastastore/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/pastastore/badge/?version=latest)](https://pastastore.readthedocs.io/en/latest/?badge=latest)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/81b1e0294f5247cfa4eca657a8eebc61)](https://www.codacy.com/gh/pastas/pastastore?utm_source=github.com&utm_medium=referral&utm_content=pastas/pastastore&utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/81b1e0294f5247cfa4eca657a8eebc61)](https://www.codacy.com/gh/pastas/pastastore/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pastas/pastastore&utm_campaign=Badge_Coverage)\n![PyPI](https://img.shields.io/pypi/v/pastastore)\n\n# pastastore\n\nThis module stores \n[Pastas](https://pastas.readthedocs.io/en/latest/) time series and models in a\ndatabase.\n\nStoring time series and models in a database allows the user to manage time\nseries and Pastas models on disk, which allows the user to pick up where they\nleft off without having to reload everything.\n\n## Installation\n\nInstall the module with `pip install pastastore`.\n\nFor installing in development mode, clone the repository and install by typing\n`pip install -e .` from the module root directory.\n\nFor plotting background maps, the `contextily` and `pyproj` packages are\nrequired. For a full install, including optional dependencies for plotting and\nlabeling data on maps, use: `pip install pastastore[optional]` Windows users\nare asked to install `rasterio` themselves since it often cannot be installed\nusing `pip`. `rasterio` is a dependency of `contextily`.\n\n## Usage\n\nThe following snippets show typical usage. The first step is to define a\nso-called `Connector` object. This object contains methods to store time series\nor models to the database, or read objects from the database.\n\nThe following code creates a PasConnector, which uses Pastas JSON-styled\n\"`.pas`-files\" to save models in a folder on your computer (in this case a\nfolder called `pastas_db` in the current directory).\n\n```python\nimport pastastore as pst\n\n# create connector instance\nconn = pst.PasConnector(name=\"pastas_db\", path=\".\")\n```\n\nThe next step is to pass that connector to the `PastaStore` object. This object\ncontains all kinds of useful methods to analyze and visualize time series, and\nbuild and analyze models.\n\n```python\n# create PastaStore instance\npstore = pst.PastaStore(conn)\n```\n\nNow the user can add time series, models or analyze or visualize existing\nobjects in the database. Some examples showing the functionality of the\nPastaStore object are shown below:\n\n```python\nimport pandas as pd\nimport pastas as ps\n\n# load oseries from CSV and add to database\noseries = pd.read_csv(\"oseries.csv\")\npstore.add_oseries(oseries, \"my_oseries\", metadata={\"x\": 100_000, \"y\": 400_000})\n\n# read oseries from database\noseries = pstore.get_oseries(\"my_oseries\")\n\n# view oseries metadata DataFrame\npstore.oseries\n\n# plot oseries location on map\nax = pstore.maps.oseries()\npstore.maps.add_background_map(ax)  # add a background map\n\n# plot my_oseries time series\nax2 = pstore.plot.oseries(names=[\"my_oseries\"])\n\n# create a model with pastas\nml = ps.Model(oseries, name=\"my_model\")\n\n# add model to database\npstore.add_model(ml)\n\n# load model from database\nml2 = pstore.get_models(\"my_model\")\n\n# export whole database to a zip file\npstore.to_zip(\"my_backup.zip\")\n```\n\nFor more elaborate examples, refer to the\n[Notebooks](https://pastastore.readthedocs.io/en/latest/examples.html#example-notebooks).\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2020 D.A. Brakenhoff  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Tools for managing Pastas time series models.",
    "version": "1.4.0",
    "project_urls": {
        "documentation": "https://pastastore.readthedocs.io/en/latest/",
        "homepage": "https://github.com/pastas/pastastore",
        "repository": "https://github.com/pastas/pastastore"
    },
    "split_keywords": [
        "hydrology",
        " groundwater",
        " time series",
        " analysis",
        " database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f73c6736c4fdb98c50ce5235d1b7146cbb6eccff261424fcdde4f8e5b829fe5",
                "md5": "336d0218a7bb9981e1084ab660c741dd",
                "sha256": "3327b4dfcc6b68cf096642658a01deff0336831df03ae6ba8d68db40ebfda761"
            },
            "downloads": -1,
            "filename": "pastastore-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "336d0218a7bb9981e1084ab660c741dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 54921,
            "upload_time": "2024-03-22T13:13:23",
            "upload_time_iso_8601": "2024-03-22T13:13:23.580007Z",
            "url": "https://files.pythonhosted.org/packages/5f/73/c6736c4fdb98c50ce5235d1b7146cbb6eccff261424fcdde4f8e5b829fe5/pastastore-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f54a7c1fbc3e05a5919f2ec935a73a36ee92ddb202440e81dc27aaa338385b6",
                "md5": "84647c6f65adccf6effd61849ce8cea8",
                "sha256": "01ab149100c008ac011980e4bc23cfbad93a14f7dbb6c8825b10ecb22f5804d1"
            },
            "downloads": -1,
            "filename": "pastastore-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "84647c6f65adccf6effd61849ce8cea8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 59280,
            "upload_time": "2024-03-22T13:13:25",
            "upload_time_iso_8601": "2024-03-22T13:13:25.106402Z",
            "url": "https://files.pythonhosted.org/packages/3f/54/a7c1fbc3e05a5919f2ec935a73a36ee92ddb202440e81dc27aaa338385b6/pastastore-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 13:13:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pastas",
    "github_project": "pastastore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pastastore"
}
        
Elapsed time: 0.21472s