Metadata-Version: 2.1
Name: gsrest
Version: 0.1.1
Summary: GeoServer python REST API client
Home-page: https://github.com/esuarezsantana/gsrest
License: GPL-3.0-or-later
Keywords: geoserver
Author: Eduardo Suarez-Santana
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Dist: pytest-docker (>=0.7.2,<0.8.0)
Requires-Dist: pyyaml (>=5.3.1,<6.0.0)
Project-URL: Repository, https://github.com/esuarezsantana/gsrest
Description-Content-Type: text/markdown

# gsrest

GeoServer python REST API client.

## About

This package is on an early stage, but may be functional for your needs.

At this point, the only documentation is the one on source files and the tests
themself.

## Features

  * HTTP only. *Warning*: your geoserver credentials may be publicly exposed.
  * Python >= 3.7.
  * No runtime dependencies (pure python).
  * Static setup of the connection for all GeoServer elements.
  * Easily extendable.
  * Support to load elements from a YAML file.

## Installation

```
pip install gsrest
```

## Sample usage

To test the client, you need a geoserver instance. For simplicity, in this
example we will use the [geoserver docker image from
kartoza](https://hub.docker.com/r/kartoza/geoserver/):

```
$ docker run -d --rm -p 8080:8080 --name geoserver kartoza/geoserver:2.17.0
```

Let's setup the client credentials. Default values work fine with the docker
instance.

```
$ python
>>> from gsrest import client
>>> client.GsClient()  # will setup the connection for all elements
```

Next, let's create a local workspace and sync (upload) it to the server.

```
>>> from gsrest.elements import workspace
>>> wsp = workspace.WorkSpace("wsp1")
>>> wsp.uri = "http://my.uri/"
>>> wsp.sync()
```

Then, you can check the new workspace at http://localhost:8080/geoserver
(user `admin` / password `geoserver`).

Finally, do not forget to kill the docker instance.

```
$ docker kill geoserver
```

## License

Licensed under the term of `GPL-3.0-or-later LICENSE`. See [LICENSE](LICENSE).

