https://github.com/eoxserver/pyows
OWS request/response encoding/decoding
https://github.com/eoxserver/pyows
ogc-services ows python xml
Last synced: 12 months ago
JSON representation
OWS request/response encoding/decoding
- Host: GitHub
- URL: https://github.com/eoxserver/pyows
- Owner: EOxServer
- Created: 2019-10-28T09:01:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T10:47:54.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T17:18:17.610Z (over 1 year ago)
- Topics: ogc-services, ows, python, xml
- Language: Python
- Homepage:
- Size: 160 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pyows
[](https://github.com/EOxServer/pyows/actions/workflows/test.yaml)
[](https://badge.fury.io/py/pyows)
[](https://pyows.readthedocs.io/en/latest/?badge=latest)
`pyows` is a library to help building an OWS compatible service or client. It helps building requests and parsing them and also provides object types to be serialized and sent as responses.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install pyows.
```bash
pip install pyows
```
## Usage
`pyows` can be used to both parse/encode OWS requests and to parse/encode objects for the various services.
Example: Parsing a WCS 2.0 GetCoverage request:
```python
>>> from ows.wcs.v20.decoders import xml_decode_get_coverage
>>>
>>> request = b"""
...
... a
...
... """
>>> print(xml_decode_get_coverage(request))
GetCoverageRequest(coverage_id='a', format=None, mediatype=None, subsetting_crs=None, output_crs=None, subsets=[], scalefactor=None, scales=[], interpolation=None, axis_interpolations=[], range_subset=None)
```
The other way around:
```python
>>> from ows.wcs.v20 import GetCoverageRequest, Trim, Slice
>>> request = GetCoverageRequest(
... coverage_id='a',
... subsets=[
... Trim(dimension='x', low=1.2, high=2.2),
... Trim(dimension='y', low=3),
... Slice(dimension='time', point='2018-05-07')
... ]
... )
>>> print(xml_encode_get_coverage(request, pretty_print=True).value.decode('utf-8'))
a
x
1.2
2.2
y
3
time
2018-05-07
```
### Currently supported OWS
- OWS common
- 2.0:
- Capabilities related encoding
- WCS
- 2.0:
- Request encoding/decoding for (both XML/KVP)
- GetCapabilities
- DescribeCoverage
- GetCoverage
- Response encoding
- Capabilities
- CoverageDescriptions
- 2.1
- Response encoding for
- CoverageDescriptions
- WMS
- 1.3:
- Request encoding/decoding KVP
- GetCapabilities
- GetMap
- GetFeatureInfo
- Response encoding
- Capabilities
## Roadmap
- Full support of WCS 2.x including EO-WCS application profile and all extensions
- Support for WPS 2.0 requests and responses
- Support for WMS request and responses for all versions
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)