{ "info": { "author": "Chris Mutel", "author_email": "cmutel@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "===============\nPandarus_remote\n===============\n\nPandarus_remote is a web service for processing and managing data for regionalized life cycle assessment using `pandarus `__. It is meant to be used by the `brightway2-regional `__ library.\n\n.. contents::\n\nInstallation\n============\n\n``pandarus_remote`` can be installed using pip, but your life will be much easier if you use ``conda`` to get consistent dependencies:\n\n.. code-block:: bash\n\n conda config --add channels conda-forge cmutel\n conda create -n pandarus python=3.5\n source activate pandarus\n conda install pandarus_remote\n\nRequirements\n------------\n\n``pandarus_remote`` requires the following Python libraries:\n\n* `appdirs `__\n* `docopt `__\n* `fiona `__\n* `flask `__\n* `pandarus `__\n* `peewee `__\n* `redis `__\n* `rasterio `__\n* `requests `__\n* `rq `__\n\nIn addition, ``pandarus_remote`` requires that `Redis `__ be installed.\n\nRunning the web service\n=======================\n\nA Redis server must be running on the local machine.\n\nA worker process for ``rq`` should be started with the command ``rq worker``.\n\nFinally, run the ``flask`` application any way you want. For example, to run the test server (not in production!), do:\n\n.. code-block:: bash\n\n export FLASK_APP=/path/to/pandarus_remote/__init__.py\n flask run\n\nEnvironment variables\n---------------------\n\nThe following environment variables can be used to configure ``pandarus_remote``:\n\n* ``PANDARUS_EXPORT_FORMAT``: A string specifying the Fiona driver to use, like \"GPKG\" or \"GeoJSON\"\n* ``PANDARUS_CPUS``: The number of CPUs to use when performing intersection calculations\n\nAPI endpoints\n=============\n\nThe following API endpoints are supported:\n\n/\n-\n\nPing the server. Returns something like ``pandarus_remote web service, version (1, 0)``.\n\nHTTP method: **GET**\n\n/catalog\n--------\n\nGet the list of spatial datasets and results currently available on the server.\n\nHTTP method: **GET**\n\nResponse\n````````\n\n* 200: Return a JSON payload of the form:\n\n.. code-block:: javascript\n\n [\n 'files': [\n ('file name', 'hex-encoded sha256 hash of file contents', 'type of file')\n ],\n 'intersections': [\n ('input file 1 sha256 hash', 'input file 2 sha256 hash')\n ],\n 'remaining': [\n ('input file 1 sha256 hash', 'input file 2 sha256 hash')\n ],\n 'rasterstats': [\n ('vector file sha256 hash', 'raster file sha256 hash')\n ]\n ]\n\n/upload\n-------\n\nUpload a spatial data file. The provided file must be openable by `fiona `__ or `rasterio `__.\n\nHTTP method: **POST**\n\nParameters\n``````````\n\nPost the following required form data:\n\n* ``name``: File name\n* ``sha256``: SHA 256 hash of file\n* ``band``: Raster band number. This field is required; pass ``''`` if single-band raster or vector dataset.\n* ``layer``: Vector layer name. This field is required; pass ``''`` if single-layer vector or raster dataset.\n* ``field``: Vector field that uniquely identifies spatial features. This field is required; pass ``''`` if raster dataset.\n\nThe file should be in the field ``file``.\n\nResponses\n`````````\n\n* 201: The file was uploaded and registered. Returns a JSON payload:\n\n.. code-block:: javascript\n\n {\n 'filename': 'some file name',\n 'sha256': 'hex-encoded sha256 hash of file contents'\n }\n\n* 400: The request form was missing a required field\n* 406: The input data was invalid (either the hash wasn't correct or the file isn't a readable geospatial dataset)\n* 409: File already exists\n* 413: The uploaded file was too large (current limit is 250 MB)\n\n/intersection\n-------------\n\nRequest the download of a pandarus intersections JSON data file for two spatial datasets. Both spatial datasets should already be on the server (see ``/upload``), and the intersection should already be calculated (see ``/calculate-intersection``).\n\nHTTP method: **POST**\n\nParameters\n``````````\n\nPost the following form data:\n\n* ``first``: SHA 256 hash of first input file\n* ``second``: SHA 256 hash of second input file\n\nResponses\n`````````\n\n* 200: The requested file will be returned\n* 400: The request form was missing a required field\n* 404: An intersections file for this combination was not found\n\n/intersection-file\n------------------\n\nRequest the download of the new geospatial vector file created when calculating the intersection of two spatial datasets. Both spatial datasets should already be on the server (see ``/upload``), and the intersection should already be calculated (see ``/calculate-intersection``).\n\nHTTP method: **POST**\n\nParameters\n``````````\n\nPost the following form data:\n\n* ``first``: SHA 256 hash of first input file\n* ``second``: SHA 256 hash of second input file\n\nResponses\n`````````\n\n* 200: The requested file will be returned\n* 400: The request form was missing a required field\n* 404: An intersections file for this combination was not found\n\n/calculate-intersection\n-----------------------\n\nCalculate a pandarus intersections file for two vector spatial datasets. Both spatial datasets should already be on the server (see ``/upload``). The second vector dataset must have the geometry type ``Polygon`` or ``MultiPolygon``.\n\nHTTP method: **POST**\n\nParameters\n``````````\nPost the following form data:\n\n* ``first``: SHA 256 hash of first input file\n* ``second``: SHA 256 hash of second input file\n\nResponses\n`````````\n\n* 200: The requested intersections file will be calculated. Returns the URL of the job status resource (see `/status`) which can be polled to see when the calculation is finished.\n* 400: The request form was missing a required field\n* 404: One of the files were not found\n* 406: Error in the files: Either the hashes were identical, or the files weren't vector datasets, or the second file didn't have the correct geometry type.\n* 409: The requested intersection file already exists\n\n/remaining\n----------\n\nRequest the download of the JSON data file from a remaining areas calculation. Both spatial datasets should already be on the server (see ``/upload``), and the remaining areas should already be calculated (see ``/calculate-remaining``).\n\nHTTP method: **POST**\n\nParameters\n``````````\n\nPost the following form data:\n\n* ``first``: SHA 256 hash of first input file\n* ``second``: SHA 256 hash of second input file\n\nResponses\n`````````\n\n* 200: The requested file will be returned\n* 400: The request form was missing a required field\n* 404: An remaining areas file for this combination was not found\n\n/calculate-remaining\n--------------------\n\nCalculate a pandarus remaining areas file for two vector spatial datasets. See the Pandarus documentation for more details on remaining areas. Both spatial datasets should already be on the server (see ``/upload``), and their intersection should already be calculated.\n\nHTTP method: **POST**\n\nParameters\n``````````\nPost the following form data:\n\n* ``first``: SHA 256 hash of first input file\n* ``second``: SHA 256 hash of second input file\n\nResponses\n`````````\n\n* 200: The requested remaining areas file will be calculated. Returns the URL of the job status resource (see `/status`) which can be polled to see when the calculation is finished.\n* 400: The request form was missing a required field\n* 404: One of the files or the calculated intersection result were not found\n* 409: The requested remaining areas file already exists\n\n/rasterstats\n------------\n\nRequest the download of the JSON data file from a raster stats calculation. Both spatial datasets should already be on the server (see ``/upload``), and the raster stats should already be calculated (see ``/calculate-rasterstats``).\n\nHTTP method: **POST**\n\nParameters\n``````````\n\nPost the following form data:\n\n* ``vector``: SHA 256 hash of vector input file\n* ``raster``: SHA 256 hash of raster input file\n\nResponses\n`````````\n\n* 200: The requested file will be returned\n* 400: The request form was missing a required field\n* 404: An raster stats file for this combination was not found\n\n/calculate-rasterstats\n----------------------\n\nCalculate a pandarus raster stats file for two vector spatial datasets. See the Pandarus documentation for more details on raster stats. Both spatial datasets should already be on the server (see ``/upload``), and their intersection should already be calculated.\n\nHTTP method: **POST**\n\nParameters\n``````````\nPost the following form data:\n\n* ``vector``: SHA 256 hash of vector input file\n* ``raster``: SHA 256 hash of raster input file\n\nResponses\n`````````\n\n* 200: The requested raster stats file will be calculated. Returns the URL of the job status resource (see `/status`) which can be polled to see when the calculation is finished.\n* 400: The request form was missing a required field\n* 404: One of the files was not found\n* 406: One of the files had an incorrect data type\n* 409: The requested remaining areas file already exists\n\n/status/\n----------------\n\nGet the status of a currently running job. Job status URLs are returned by the ``/calculate-intersection`` and ``/calculate-area`` endpoints.\n\nHTTP method: **GET**\n\nReponse\n```````\n\n* 200: Returns a text response giving the current job status. If the job is finished, the response will be ``finished``.\n* 404: The requested job id was not found\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cmutel/pandarus_remote", "keywords": "", "license": "Copyright (c) 2016, Chris Mutel and Paul Scherrer Institut\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer. Redistributions in binary\nform must reproduce the above copyright notice, this list of conditions and the\nfollowing disclaimer in the documentation and/or other materials provided\nwith the distribution.\n\nNeither the name of Paul Scherrer Institut nor the names of its contributors \nmay be used to endorse or promote products derived from this software without \nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", "maintainer": "", "maintainer_email": "", "name": "pandarus_remote", "package_url": "https://pypi.org/project/pandarus_remote/", "platform": "", "project_url": "https://pypi.org/project/pandarus_remote/", "project_urls": { "Homepage": "https://github.com/cmutel/pandarus_remote" }, "release_url": "https://pypi.org/project/pandarus_remote/1.0/", "requires_dist": null, "requires_python": "", "summary": "", "version": "1.0" }, "last_serial": 2722673, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c812df142f0cabae522d2ac7f994d85a", "sha256": "d9106bef6dd7f94d5c3172a63a4c3fa53523f7148f7cdd0a4b2c1382c23664aa" }, "downloads": -1, "filename": "pandarus_remote-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c812df142f0cabae522d2ac7f994d85a", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 14922, "upload_time": "2017-03-22T10:14:43", "url": "https://files.pythonhosted.org/packages/13/44/0a5fdb43ad8eef04e1378ee099371dc1d9b729c371069c3f0ff86080cdc4/pandarus_remote-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9335f9e928b529f2985798c92593a0ea", "sha256": "52e8bd053609e792521ce181855b3acaa26af0c7da1009fc0b5f4a6e8e619661" }, "downloads": -1, "filename": "pandarus_remote-1.0.tar.gz", "has_sig": false, "md5_digest": "9335f9e928b529f2985798c92593a0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10190, "upload_time": "2017-03-22T10:14:41", "url": "https://files.pythonhosted.org/packages/0d/3c/266683eeeec27dd0e83b909344926896a643c57281ed3a31cef570dc27d6/pandarus_remote-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c812df142f0cabae522d2ac7f994d85a", "sha256": "d9106bef6dd7f94d5c3172a63a4c3fa53523f7148f7cdd0a4b2c1382c23664aa" }, "downloads": -1, "filename": "pandarus_remote-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c812df142f0cabae522d2ac7f994d85a", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 14922, "upload_time": "2017-03-22T10:14:43", "url": "https://files.pythonhosted.org/packages/13/44/0a5fdb43ad8eef04e1378ee099371dc1d9b729c371069c3f0ff86080cdc4/pandarus_remote-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9335f9e928b529f2985798c92593a0ea", "sha256": "52e8bd053609e792521ce181855b3acaa26af0c7da1009fc0b5f4a6e8e619661" }, "downloads": -1, "filename": "pandarus_remote-1.0.tar.gz", "has_sig": false, "md5_digest": "9335f9e928b529f2985798c92593a0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10190, "upload_time": "2017-03-22T10:14:41", "url": "https://files.pythonhosted.org/packages/0d/3c/266683eeeec27dd0e83b909344926896a643c57281ed3a31cef570dc27d6/pandarus_remote-1.0.tar.gz" } ] }