{ "info": { "author": "James Rutherford", "author_email": "james.rutherford@maplecroft.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=======\nWinston\n=======\n\n\n.. image:: https://img.shields.io/pypi/v/winston.svg\n :target: https://pypi.python.org/pypi/winston\n :alt: Latest Release\n\n.. image:: https://pyup.io/repos/github/maplecroft/winston/shield.svg\n :target: https://pyup.io/repos/github/maplecroft/winston/\n :alt: Updates\n\n.. image:: https://pyup.io/repos/github/maplecroft/winston/python-3-shield.svg\n :target: https://pyup.io/repos/github/maplecroft/winston/\n :alt: Python 3\n\n\nA bit like the PostGIS ``ST_SummaryStats`` function for rasters on your filesystem.\nMostly we're just stringing together some awesome libraries:\n\n- `Rasterio`_\n- `Shapely`_\n- `Numpy`_\n- `Tablib`_\n\n\nInstall\n=======\n\nActivate your project virtual environment, and then::\n\n pip install winston\n\nIf you just want to use the command-line features, you could::\n\n pip install --user winston\n\n\nUsage\n=====\n\nYou can either use Winston on the command-line or as a module.\n\nCommand-line\n------------\n\nTo see your options, simply::\n\n winston --help\n\nFor example, to get stats for all WKTs in a text file for a given raster::\n\n winston some_file.tif -f wkts.txt\n\nor just for one point, including raster metadata::\n\n winston /path/to/data/*.tif -w 'POINT (-4.483545 54.150744)' -m\n\nSince we require ``rasterio``, you can also use the ``rio`` command-line tool to inspect your rasters::\n\n rio insp /path/to/geo.tif\n\nRead more in the `Rasterio docs`_.\n\n.. _`Rasterio`: https://mapbox.github.io/rasterio/\n.. _`Shapely`: http://toblerity.org/shapely/manual.html\n.. _`Numpy`: http://docs.scipy.org/doc/numpy/\n.. _`Tablib`: http://docs.python-tablib.org/en/latest/\n.. _`Rasterio docs`: https://mapbox.github.io/rasterio/\n\nModule\n------\n\nYou can also use Winston in your code:\n\n.. code-block:: pycon\n\n >>> import rasterio\n >>> from winston.stats import summary\n >>> from shapely.geometry import Point\n >>> src = rasterio.open('/path/to/raster.tif')\n >>> print summary(src)\n Summary(count=37324800, sum=49041320.0, mean=5.8627439, min=0.0, max=10.0, std=2.2037256)\n >>> print summary(src, bounds=(4, 6))\n Summary(count=37324800, sum=9569182.0, mean=5.1044292, min=4.0, max=5.9999995, std=0.56939822)\n >>> print summary(src, bounds=(4, 6), mean_only=True)\n 5.09\n >>> print summary(src, Point(-2.36, 51.38).buffer(0.25))\n Summary(count=169, sum=1229.4401, mean=8.9740152, min=8.3602285, max=9.4269724, std=0.24473859)\n\nExporting results is reasonably simple with ``tablib``:\n\n.. code-block:: pycon\n\n >>> import rasterio\n >>> import tablib\n >>> from winston.stats import summary\n >>> from shapely.geometry import Point\n >>> src = rasterio.open('/path/to/raster.tif')\n >>> shapes = [Point(x, y).buffer(0.25) for x, y in zip(range(5), range(5, 0, -1))]\n >>> summaries = [summary(src, shape) for shape in shapes]\n >>> d = tablib.Dataset()\n >>> d.dict = [s.__dict__ for s in summaries]\n >>> print d.headers\n ['count', 'sum', 'mean', 'min', 'max', 'std']\n >>> open('output.csv', 'w').write(d.csv)\n\n\nHistory\n=======\n\n0.3.0 (2016-12-19)\n------------------\n\n* Updated CLI defaults to be more... sane\n* Remove ``data_count`` from summary results\n* Now accept a ``exclude_nodata_value`` to be consistent with PostGIS\n* Added some basic tests\n\n0.2.3 (2016-10-13)\n------------------\n\n* Invert default value of ``all_touched`` flag to be consistent with Rasterio\n* Added missing requirement (``six``) and reorganised requirements files\n\n0.2.2 (2016-10-13)\n------------------\n\n* Bugfix in namedtuple parameter ordering (oops!)\n\n0.2.1 (2016-10-12)\n------------------\n\n* Accept WKT strings as well as GeoJSON & Shapely geometries\n* Fix the processing of 'no result' summaries\n\n0.2.0 (2016-10-12)\n------------------\n\n``winston.stats.summary``:\n\n* now accepts Shapely geometries as well as GeoJSON-like objects\n* we no longer round results to 3 decimal places\n* the stats are now returned as a ``namedtuple`` rather than a list\n\n0.1.1 (2016-10-12)\n------------------\n\n* Minor packaging fixes.\n\n0.1.0 (2016-10-12)\n------------------\n\n* First release on PyPI.\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/Maplecroft/Winston", "keywords": "winston", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "winston", "package_url": "https://pypi.org/project/winston/", "platform": "", "project_url": "https://pypi.org/project/winston/", "project_urls": { "Homepage": "https://github.com/Maplecroft/Winston" }, "release_url": "https://pypi.org/project/winston/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "A bit like PostGIS ST_SummaryStats for files on disk", "version": "0.3.0" }, "last_serial": 2528666, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7a5341cc1a15ebbffa23d9af683c6846", "sha256": "3a8bc2961f26a64f317b54928148aabbd1f2f26809eadf1a19b656176e40254f" }, "downloads": -1, "filename": "winston-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7a5341cc1a15ebbffa23d9af683c6846", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8411, "upload_time": "2016-10-12T11:43:03", "url": "https://files.pythonhosted.org/packages/4d/bc/7a35c6d1e43a6a28d1841925012dd22ae2105a069d2fde1df3e1f19402a0/winston-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c25869ea915c613d32879861ddcfdf27", "sha256": "0ab05854294030ad62163338ba6c1aecd5ffac70e1523aab9c938c7e359b61e1" }, "downloads": -1, "filename": "winston-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c25869ea915c613d32879861ddcfdf27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6613, "upload_time": "2016-10-12T11:42:58", "url": "https://files.pythonhosted.org/packages/71/4f/a112b90730a2ff0db44b655dba21331ea78fb2250c17bfa91da9e2dc7c8b/winston-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "215a13a5f1b697c05b1d8b80b16b98fd", "sha256": "6a43f5c5279e3f0a435ed0f1600cc6379b9f3b77e907d2495f3013d2706577c3" }, "downloads": -1, "filename": "winston-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "215a13a5f1b697c05b1d8b80b16b98fd", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8406, "upload_time": "2016-10-12T11:59:39", "url": "https://files.pythonhosted.org/packages/f3/3b/43cb6b54e57c23d17bd713ecc3f98e4fa90c2f8e4264209804646f214a54/winston-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c981e3a964921bfe3757a2d76c5a53a", "sha256": "f1b1adf4f2c43eb187241a1cd0c69ae198928f4c2ff3da9e5ee8cd91380e1de2" }, "downloads": -1, "filename": "winston-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3c981e3a964921bfe3757a2d76c5a53a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6601, "upload_time": "2016-10-12T11:59:34", "url": "https://files.pythonhosted.org/packages/9b/1c/62e230a4935f52bfc09ca7411a8723af58ad8bfa881c4b22a0dbbabb2bf7/winston-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2ef9fd79e45d1ecae8fbfa619f1cde42", "sha256": "8ad33fac56e80249d2f849e7bbec95f85ad9dc5637926d33f4257cf0b4bd53bf" }, "downloads": -1, "filename": "winston-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2ef9fd79e45d1ecae8fbfa619f1cde42", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9225, "upload_time": "2016-10-12T12:54:52", "url": "https://files.pythonhosted.org/packages/14/28/bbf2270d198e80cc7a1081153c4a348824998c024793f8b6984ab8d14972/winston-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b779949f7eafd18e1fa63862f0ff39c", "sha256": "5e04a744ef94407c858f371431fe503f75b20bc2ae6de5784718b6b66495ca84" }, "downloads": -1, "filename": "winston-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3b779949f7eafd18e1fa63862f0ff39c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7144, "upload_time": "2016-10-12T12:54:47", "url": "https://files.pythonhosted.org/packages/ed/0b/eefe45e062948816763c1e989623a38276b00bd60768c1889c4527d2a9b9/winston-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0a5961cea91385e5ae3a654387200b94", "sha256": "40e5a1d2e933aa84a7337270d67bef5b4aa85c19e59aeaa18890c52e67eb4f46" }, "downloads": -1, "filename": "winston-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0a5961cea91385e5ae3a654387200b94", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9575, "upload_time": "2016-10-12T15:53:16", "url": "https://files.pythonhosted.org/packages/d3/9e/9d5c0a9c728cb57a7631caeeb7bf63380bf94e27c7a11b34950dbca4364c/winston-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a6854ba461e5833d359259b1b2abd6b", "sha256": "3d826247626d75d22198b2c78443472ba9ada2a3e1d71f2a475375bcccefb9dc" }, "downloads": -1, "filename": "winston-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1a6854ba461e5833d359259b1b2abd6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2016-10-12T15:53:11", "url": "https://files.pythonhosted.org/packages/50/91/ed7f7caa5ad3b8cba5f73fd4a9ff3397a1b7ab807fb8fd0c365d140ea3ec/winston-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "1e8cd1f8e983e518fd3011cd57621762", "sha256": "2ea7d4b7b8549f85cfaf32c6fa92d46b89cbf91a92025c7f4093958cdb385717" }, "downloads": -1, "filename": "winston-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1e8cd1f8e983e518fd3011cd57621762", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9859, "upload_time": "2016-10-13T09:15:48", "url": "https://files.pythonhosted.org/packages/39/8d/b4c2e3bc952abb04df72bae196b9a6c7c0a5940b665b5bb549cf26c8f1ef/winston-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e8efa9e550fcea6cc7b25fafe400f21", "sha256": "8a80d27c5fc2ceac9d6315337a9436212ca1b70d6aeba6cd12606cdb636c1ae3" }, "downloads": -1, "filename": "winston-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8e8efa9e550fcea6cc7b25fafe400f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7533, "upload_time": "2016-10-13T09:15:43", "url": "https://files.pythonhosted.org/packages/0d/08/2d20c6d2eccd21be743ecfc1794f800b1cf438bb6f55fe9782bf5ef96582/winston-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6582b441d0254b686c677dd2986fca25", "sha256": "ec3e9ee185ddd06acf160c3ef4f84b5db64dcaa74708b6bf5942046358a2bf86" }, "downloads": -1, "filename": "winston-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6582b441d0254b686c677dd2986fca25", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10044, "upload_time": "2016-10-13T10:48:57", "url": "https://files.pythonhosted.org/packages/02/42/80c363f03a785ceb3b4d473d65b084170f14aa16def49cd5db5172ee97bb/winston-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48be9a053d4057ff3260bd393d35b139", "sha256": "ec7641bc0a657193338c0f698ba515b0373b0f6e68cc60c8d300ce41e5f9e816" }, "downloads": -1, "filename": "winston-0.2.3.tar.gz", "has_sig": false, "md5_digest": "48be9a053d4057ff3260bd393d35b139", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7618, "upload_time": "2016-10-13T10:49:04", "url": "https://files.pythonhosted.org/packages/b4/bd/8f4057e8fa96a96219bb27df50cad465450a5e786f334af738d4175576ec/winston-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6ea6ef4b98309fdd09b17ad0d6bb0e66", "sha256": "4ff91b059cb992a70f92e6966746e1c0b4b7aa962a313644e61cf5682b7453b1" }, "downloads": -1, "filename": "winston-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6ea6ef4b98309fdd09b17ad0d6bb0e66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8849, "upload_time": "2016-12-19T17:15:08", "url": "https://files.pythonhosted.org/packages/4f/26/78d7e88f75b2b81c84bf301b2109732d33efffa55dd7945ff8721b5e6fad/winston-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6ea6ef4b98309fdd09b17ad0d6bb0e66", "sha256": "4ff91b059cb992a70f92e6966746e1c0b4b7aa962a313644e61cf5682b7453b1" }, "downloads": -1, "filename": "winston-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6ea6ef4b98309fdd09b17ad0d6bb0e66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8849, "upload_time": "2016-12-19T17:15:08", "url": "https://files.pythonhosted.org/packages/4f/26/78d7e88f75b2b81c84bf301b2109732d33efffa55dd7945ff8721b5e6fad/winston-0.3.0.tar.gz" } ] }