Skip to main content

GeoServer python REST API client

Project description

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.
  • Static setup of the connection for all GeoServer elements.
  • Easily extendable.
  • CLI to upload from YAML (great for automation).
  • Just PyYAML as runtime dependency.

Installation

Download from PyPI:

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:

$ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsrest-0.2.1.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gsrest-0.2.1-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

Details for the file gsrest-0.2.1.tar.gz.

File metadata

  • Download URL: gsrest-0.2.1.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.4.24-edu87+

File hashes

Hashes for gsrest-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4cd40d5543a6da06b5f928867d20edf6b05c1391a903b98abd050c7b26a43c64
MD5 8a1a1df14a28b829af15d9977ab2babf
BLAKE2b-256 168f88b38a453004e318021199808f7b816688d7baee7949e0c1e08487398bcb

See more details on using hashes here.

File details

Details for the file gsrest-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gsrest-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 58.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/5.4.24-edu87+

File hashes

Hashes for gsrest-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0b776a7208684805e2bd02c5b85f43f91fb4e8e008a6e6a63ac68e9336f9b3
MD5 2af7cf450b43c13a695d57f9d24d840d
BLAKE2b-256 7691500aff1d6769b62eeee7bcb2c7dde7477e3d7a577172f99d4ac5a2a6c485

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page