OWSLib


NameOWSLib JSON
Version 0.32.0 PyPI version JSON
download
home_pagehttps://owslib.readthedocs.io
SummaryOGC Web Service utility library
upload_time2024-10-24 13:29:04
maintainerTom Kralidis
docs_urlNone
authorSean Gillies
requires_python>=3.10
licenseBSD
keywords gis ogc ogcapi ows opensearch iso 19115 fgdc dif ows wfs wms sos csw wps wcs capabilities metadata wmts connectedsystems
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OWSLib

[![Build](https://github.com/geopython/OWSLib/workflows/main.yml/badge.svg)](https://github.com/geopython/OWSLib/actions)
[![License](https://img.shields.io/github/license/geopython/OWSLib.svg)](https://github.com/geopython/OWSLib/blob/master/LICENSE)
[![Chat](https://badges.gitter.im/geopython/OWSLib.svg)](https://app.gitter.im/#/room/#geopython_owslib:gitter.im)

## Overview

OWSLib is a Python package for client programming with Open Geospatial
Consortium (OGC) web service (hence OWS) interface standards, and their
related content models.

Full documentation is available at https://owslib.readthedocs.io

OWSLib provides a common API for accessing service metadata and wrappers for
numerous OGC Web Service interfaces.

## Installation

The easiest way to install pywis-pubsub is via the Python [pip](https://pip.pypa.io)
utility:

```bash
pip3 install OWSLib
```

## Requirements

- Python 3
- [virtualenv](https://virtualenv.pypa.io)

### Dependencies

Dependencies are listed in [requirements.txt](requirements.txt). Dependencies
are automatically installed during OWSLib installation.

### Installing OWSLib

```bash
# setup virtualenv
python3 -m venv owslib
cd owslib
source bin/activate

# clone codebase and install
git clone https://github.com/geopython/OWSLib.git
cd OWSLib
python3 setup.py install
```

## Running

Find out what a WMS has to offer. Service metadata:

```python

>>> from owslib.wms import WebMapService
>>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')
>>> wms.identification.type
'OGC:WMS'
>>> wms.identification.version
'1.1.1'
>>> wms.identification.title
'JPL Global Imagery Service'
>>> wms.identification.abstract
'WMS Server maintained by JPL, worldwide satellite imagery.'

Available layers::

    >>> list(wms.contents)
    ['us_landsat_wgs84', 'modis', 'global_mosaic_base', 'huemapped_srtm',
    'srtm_mag', 'daily_terra', 'us_ned', 'us_elevation', 'global_mosaic',
    'daily_terra_ndvi', 'daily_aqua_ndvi', 'daily_aqua_721', 'daily_planet',
    'BMNG', 'srtmplus', 'us_colordem', None, 'daily_aqua', 'worldwind_dem',
    'daily_terra_721']

Details of a layer::

    >>> wms['global_mosaic'].title
    'WMS Global Mosaic, pan sharpened'
    >>> wms['global_mosaic'].boundingBoxWGS84
    (-180.0, -60.0, 180.0, 84.0)
    >>> wms['global_mosaic'].crsOptions
    ['EPSG:4326', 'AUTO:42003']
    >>> wms['global_mosaic'].styles
    {'pseudo_bright': {'title': 'Pseudo-color image (Uses IR and Visual bands,
    542 mapping), gamma 1.5'}, 'pseudo': {'title': '(default) Pseudo-color
    image, pan sharpened (Uses IR and Visual bands, 542 mapping), gamma 1.5'},
    'visual': {'title': 'Real-color image, pan sharpened (Uses the visual
    bands, 321 mapping), gamma 1.5'}, 'pseudo_low': {'title': 'Pseudo-color
    image, pan sharpened (Uses IR and Visual bands, 542 mapping)'},
    'visual_low': {'title': 'Real-color image, pan sharpened (Uses the visual
    bands, 321 mapping)'}, 'visual_bright': {'title': 'Real-color image (Uses
    the visual bands, 321 mapping), gamma 1.5'}}

Available methods, their URLs, and available formats::

    >>> [op.name for op in wms.operations]
    ['GetTileService', 'GetCapabilities', 'GetMap']
    >>> wms.getOperationByName('GetMap').methods
    {'Get': {'url': 'http://wms.jpl.nasa.gov/wms.cgi?'}}
    >>> wms.getOperationByName('GetMap').formatOptions
    ['image/jpeg', 'image/png', 'image/geotiff', 'image/tiff']

That's everything needed to make a request for imagery::

    >>> img = wms.getmap(   layers=['global_mosaic'],
    ...                     styles=['visual_bright'],
    ...                     srs='EPSG:4326',
    ...                     bbox=(-112, 36, -106, 41),
    ...                     size=(300, 250),
    ...                     format='image/jpeg',
    ...                     transparent=True
    ...                     )
    >>> out = open('jpl_mosaic_visb.jpg', 'wb')
    >>> out.write(img.read())
    >>> out.close()
```

A very similar API exists for WebFeatureService. See
tests/wfs_MapServerWFSCapabilities.txt for details.

There is also support for Web Coverage Service (WCS), Catalogue
Service for the Web (CSW), Web Processing Service (WPS), and Web
Map Tile Service (WMTS). Some of those are beta quality.


Logging
-------
OWSLib logs messages to module-based named Python loggers. You may
configure your application to use the log messages like so:

```python
    >>> import logging
    >>> LOGGER = logging.getLogger(__name__)
    >>> # Add formatting and handlers as needed, for example to log to the console
    >>> ch = logging.StreamHandler()
    >>> ch.setLevel(logging.DEBUG)
    >>> ch.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
    >>> # add the handler to the logger
    >>> LOGGER.addHandler(ch)
    >>> LOGGER.setLevel(logging.DEBUG)
```

Releasing
---------

```bash
  # update version
  vi owslib/__init__.py
  git commit -m 'update release version' owslib/__init__.py
  # push changes
  git push origin master
  git tag -a x.y.z -m 'tagging OWSLib release x.y.z'
  # push tag
  git push --tags
  # update on PyPI (must be a maintainer)
  rm -fr build dist *.egg-info
  python3 setup.py sdist bdist_wheel --universal
  twine upload dist/*
```

Support
-------

- https://lists.osgeo.org/mailman/listinfo/owslib-users
- https://lists.osgeo.org/mailman/listinfo/owslib-devel

            

Raw data

            {
    "_id": null,
    "home_page": "https://owslib.readthedocs.io",
    "name": "OWSLib",
    "maintainer": "Tom Kralidis",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "tomkralidis@gmail.com",
    "keywords": "gis ogc ogcapi ows opensearch iso 19115 fgdc dif ows wfs wms sos csw wps wcs capabilities metadata wmts connectedsystems",
    "author": "Sean Gillies",
    "author_email": "sean.gillies@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/33/53/e853a6038e62b749d3cd8a564b69ec1b6882d76b739b6050ff2e88cea599/OWSLib-0.32.0.tar.gz",
    "platform": null,
    "description": "# OWSLib\r\n\r\n[![Build](https://github.com/geopython/OWSLib/workflows/main.yml/badge.svg)](https://github.com/geopython/OWSLib/actions)\r\n[![License](https://img.shields.io/github/license/geopython/OWSLib.svg)](https://github.com/geopython/OWSLib/blob/master/LICENSE)\r\n[![Chat](https://badges.gitter.im/geopython/OWSLib.svg)](https://app.gitter.im/#/room/#geopython_owslib:gitter.im)\r\n\r\n## Overview\r\n\r\nOWSLib is a Python package for client programming with Open Geospatial\r\nConsortium (OGC) web service (hence OWS) interface standards, and their\r\nrelated content models.\r\n\r\nFull documentation is available at https://owslib.readthedocs.io\r\n\r\nOWSLib provides a common API for accessing service metadata and wrappers for\r\nnumerous OGC Web Service interfaces.\r\n\r\n## Installation\r\n\r\nThe easiest way to install pywis-pubsub is via the Python [pip](https://pip.pypa.io)\r\nutility:\r\n\r\n```bash\r\npip3 install OWSLib\r\n```\r\n\r\n## Requirements\r\n\r\n- Python 3\r\n- [virtualenv](https://virtualenv.pypa.io)\r\n\r\n### Dependencies\r\n\r\nDependencies are listed in [requirements.txt](requirements.txt). Dependencies\r\nare automatically installed during OWSLib installation.\r\n\r\n### Installing OWSLib\r\n\r\n```bash\r\n# setup virtualenv\r\npython3 -m venv owslib\r\ncd owslib\r\nsource bin/activate\r\n\r\n# clone codebase and install\r\ngit clone https://github.com/geopython/OWSLib.git\r\ncd OWSLib\r\npython3 setup.py install\r\n```\r\n\r\n## Running\r\n\r\nFind out what a WMS has to offer. Service metadata:\r\n\r\n```python\r\n\r\n>>> from owslib.wms import WebMapService\r\n>>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')\r\n>>> wms.identification.type\r\n'OGC:WMS'\r\n>>> wms.identification.version\r\n'1.1.1'\r\n>>> wms.identification.title\r\n'JPL Global Imagery Service'\r\n>>> wms.identification.abstract\r\n'WMS Server maintained by JPL, worldwide satellite imagery.'\r\n\r\nAvailable layers::\r\n\r\n    >>> list(wms.contents)\r\n    ['us_landsat_wgs84', 'modis', 'global_mosaic_base', 'huemapped_srtm',\r\n    'srtm_mag', 'daily_terra', 'us_ned', 'us_elevation', 'global_mosaic',\r\n    'daily_terra_ndvi', 'daily_aqua_ndvi', 'daily_aqua_721', 'daily_planet',\r\n    'BMNG', 'srtmplus', 'us_colordem', None, 'daily_aqua', 'worldwind_dem',\r\n    'daily_terra_721']\r\n\r\nDetails of a layer::\r\n\r\n    >>> wms['global_mosaic'].title\r\n    'WMS Global Mosaic, pan sharpened'\r\n    >>> wms['global_mosaic'].boundingBoxWGS84\r\n    (-180.0, -60.0, 180.0, 84.0)\r\n    >>> wms['global_mosaic'].crsOptions\r\n    ['EPSG:4326', 'AUTO:42003']\r\n    >>> wms['global_mosaic'].styles\r\n    {'pseudo_bright': {'title': 'Pseudo-color image (Uses IR and Visual bands,\r\n    542 mapping), gamma 1.5'}, 'pseudo': {'title': '(default) Pseudo-color\r\n    image, pan sharpened (Uses IR and Visual bands, 542 mapping), gamma 1.5'},\r\n    'visual': {'title': 'Real-color image, pan sharpened (Uses the visual\r\n    bands, 321 mapping), gamma 1.5'}, 'pseudo_low': {'title': 'Pseudo-color\r\n    image, pan sharpened (Uses IR and Visual bands, 542 mapping)'},\r\n    'visual_low': {'title': 'Real-color image, pan sharpened (Uses the visual\r\n    bands, 321 mapping)'}, 'visual_bright': {'title': 'Real-color image (Uses\r\n    the visual bands, 321 mapping), gamma 1.5'}}\r\n\r\nAvailable methods, their URLs, and available formats::\r\n\r\n    >>> [op.name for op in wms.operations]\r\n    ['GetTileService', 'GetCapabilities', 'GetMap']\r\n    >>> wms.getOperationByName('GetMap').methods\r\n    {'Get': {'url': 'http://wms.jpl.nasa.gov/wms.cgi?'}}\r\n    >>> wms.getOperationByName('GetMap').formatOptions\r\n    ['image/jpeg', 'image/png', 'image/geotiff', 'image/tiff']\r\n\r\nThat's everything needed to make a request for imagery::\r\n\r\n    >>> img = wms.getmap(   layers=['global_mosaic'],\r\n    ...                     styles=['visual_bright'],\r\n    ...                     srs='EPSG:4326',\r\n    ...                     bbox=(-112, 36, -106, 41),\r\n    ...                     size=(300, 250),\r\n    ...                     format='image/jpeg',\r\n    ...                     transparent=True\r\n    ...                     )\r\n    >>> out = open('jpl_mosaic_visb.jpg', 'wb')\r\n    >>> out.write(img.read())\r\n    >>> out.close()\r\n```\r\n\r\nA very similar API exists for WebFeatureService. See\r\ntests/wfs_MapServerWFSCapabilities.txt for details.\r\n\r\nThere is also support for Web Coverage Service (WCS), Catalogue\r\nService for the Web (CSW), Web Processing Service (WPS), and Web\r\nMap Tile Service (WMTS). Some of those are beta quality.\r\n\r\n\r\nLogging\r\n-------\r\nOWSLib logs messages to module-based named Python loggers. You may\r\nconfigure your application to use the log messages like so:\r\n\r\n```python\r\n    >>> import logging\r\n    >>> LOGGER = logging.getLogger(__name__)\r\n    >>> # Add formatting and handlers as needed, for example to log to the console\r\n    >>> ch = logging.StreamHandler()\r\n    >>> ch.setLevel(logging.DEBUG)\r\n    >>> ch.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))\r\n    >>> # add the handler to the logger\r\n    >>> LOGGER.addHandler(ch)\r\n    >>> LOGGER.setLevel(logging.DEBUG)\r\n```\r\n\r\nReleasing\r\n---------\r\n\r\n```bash\r\n  # update version\r\n  vi owslib/__init__.py\r\n  git commit -m 'update release version' owslib/__init__.py\r\n  # push changes\r\n  git push origin master\r\n  git tag -a x.y.z -m 'tagging OWSLib release x.y.z'\r\n  # push tag\r\n  git push --tags\r\n  # update on PyPI (must be a maintainer)\r\n  rm -fr build dist *.egg-info\r\n  python3 setup.py sdist bdist_wheel --universal\r\n  twine upload dist/*\r\n```\r\n\r\nSupport\r\n-------\r\n\r\n- https://lists.osgeo.org/mailman/listinfo/owslib-users\r\n- https://lists.osgeo.org/mailman/listinfo/owslib-devel\r\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "OGC Web Service utility library",
    "version": "0.32.0",
    "project_urls": {
        "Homepage": "https://owslib.readthedocs.io"
    },
    "split_keywords": [
        "gis",
        "ogc",
        "ogcapi",
        "ows",
        "opensearch",
        "iso",
        "19115",
        "fgdc",
        "dif",
        "ows",
        "wfs",
        "wms",
        "sos",
        "csw",
        "wps",
        "wcs",
        "capabilities",
        "metadata",
        "wmts",
        "connectedsystems"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f87d4adbeb984b271983f9d56a3a3ca349f002ffa60ab68dc1fecd4b81086c80",
                "md5": "3bbed0815b94ac33abf20b7e511e19a1",
                "sha256": "69d8d64138612b5f3c09fdac69e53651cc2e3b925f292ab7bde872435e78cf17"
            },
            "downloads": -1,
            "filename": "OWSLib-0.32.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3bbed0815b94ac33abf20b7e511e19a1",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.10",
            "size": 240045,
            "upload_time": "2024-10-24T13:29:02",
            "upload_time_iso_8601": "2024-10-24T13:29:02.263697Z",
            "url": "https://files.pythonhosted.org/packages/f8/7d/4adbeb984b271983f9d56a3a3ca349f002ffa60ab68dc1fecd4b81086c80/OWSLib-0.32.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3353e853a6038e62b749d3cd8a564b69ec1b6882d76b739b6050ff2e88cea599",
                "md5": "6f6d8501989560f97c87fed2ce2203b5",
                "sha256": "7513860d3102ae8d4dc5efd8652ff3c61eca3a8cb220d6c8601121357cd2b01a"
            },
            "downloads": -1,
            "filename": "OWSLib-0.32.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6f6d8501989560f97c87fed2ce2203b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 191988,
            "upload_time": "2024-10-24T13:29:04",
            "upload_time_iso_8601": "2024-10-24T13:29:04.072286Z",
            "url": "https://files.pythonhosted.org/packages/33/53/e853a6038e62b749d3cd8a564b69ec1b6882d76b739b6050ff2e88cea599/OWSLib-0.32.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-24 13:29:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "owslib"
}
        
Elapsed time: 0.32433s