py-qgis-server


Namepy-qgis-server JSON
Version 1.8.8 PyPI version JSON
download
home_pagehttps://github.com/3liz/py-qgis-server
SummaryPy-Qgis-Server is an implementation of the OWS standards standard from the Open Geospatial Consortium.Py-Qgis-Server written in Python and built on top of Qgis serverimplementation
upload_time2023-05-04 15:32:31
maintainerDavid Marteau
docs_urlNone
author3Liz
requires_python>=3.6
license
keywords qgis ows ogc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QGIS embedded WMS/WFS/WCS asynchronous scalable server

[![PyPi version badge](https://badgen.net/pypi/v/py-qgis-server)](https://pypi.org/project/py-qgis-server/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/py-qgis-server)](https://pypi.org/project/py-qgis-server/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-qgis-server)](https://pypi.org/project/py-qgis-server/)
[![Docker Pulls](https://img.shields.io/docker/pulls/3liz/qgis-map-server)](https://hub.docker.com/r/3liz/qgis-map-server/tags)

## Description

This is an asynchronous HTTP QGIS server written in python on top of the [tornado](http://www.tornadoweb.org/en/stable/) framework and the
0MQ messaging framework for distributing requests workers.

It is based on the QGIS 3 server API for efficiently passing requests/responses using 0MQ messaging framework to workers.

The server may run as a self-contained single service or as a proxy server with an arbitrary number of workers running
remotely or locally. Independent workers connect automatically to the front-end proxy with no need of special configuration
on the proxy side. Thus, this is ideal for auto-scaling configuration for use with container orchestrator as Rancher, Swarm or Kubernetes.

The server is aimed at solving some real situations encountered in production environment: zero conf scalability, handle long-running request situation, auto restart...

Py-Qgis-server is constantly tested against QGIS release and ltr version.
See the QGIS [roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule).

## Features

- Multiples workers
- Fair queuing request dispatching
- Timeout for long-running/stalled requests
- Full support of qgis server plugins
- Auto-restart trigger for workers
- Support streamed/chunked responses 
- SSL support
- Support for access control extensions
- Support for Qgis project stored in postgres database
- Support adding new projects cache handlers as python extension 
- Preloading of Qgis projects in static cache
- WFS3 support
- Control exposition of [Qgis API](https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/server.html#custom-apis)
- Management API (experimental)

## Requirements:

- OS: Unix/Posix variants (Linux or OSX) (Windows not officially supported)
- Python >= 3.6
- Qgis >= 3.16
- Some python knowledge about python virtualenv and package installation.
- libzmq >= 4.0.1 and pyzmq >= 17

## Documentation:

Latest documentation is available on [docs.3liz.org](https://docs.3liz.org/py-qgis-server/)

## Installation

### From Pypi

```bash
pip install py-qgis-server
```

### From docker

Docker is the recommended way to deploy py-qgis-server as it ensure a working environment for
running py-qgis-server

Follow the readme in the [docker/](./docker) folder.

### From source 

Install in development mode
```bash
pip install -e .
```

## Running the server

The server does not run as a daemon by itself, there are several ways to run a command as a daemon.

For example:

* Use Supervisor http://supervisord.org/. Will gives you full control over logs and server status notifications.
* Use the `daemon` command.
* Use systemd
* ...


### Running the server

```
usage: qgisserver [-h] [-d] [-c [PATH]]
                  [--version] [-p PORT] [-b IP] [-w NUM] [-j NUM] [-u SETUID]
                  [--rootdir PATH] [--proxy] [--timeout SECONDS]

qgis/HTTP/0MQ scalable server

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           debug mode
  -c [PATH], --config [PATH]
                        Configuration file
  --version             Return version number and exit
  -p PORT, --port PORT  http port
  -b IP, --bind IP      Interface to bind to
  -w NUM, --workers NUM
                        Num workers
  -j NUM, --jobs NUM    Num server instances
  -u SETUID, --setuid SETUID
                        uid to switch to
  --rootdir PATH        Path to qgis projects
  --proxy               Run only as proxy
  --timeout SECONDS     Set client timeout in seconds
```

By default, the command will run server instances with workers and use unix sockets to communicate. This can 
be used to run the server as a single command.

#### Running proxy and workers separately

If the `--proxy` option the server will act as a proxy server to talk to independent qgis workers. 

Qgis workers can be run using the command:

```
qgisserver-worker --host=localhost --rootdir=path/to/projects
```


### Requests to OWS services

The OWS requests use the following format:  `/ows/?<ows_query_params>`

Example:

```
http://myserver:8080/ows/?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities&MAP=<qgis_project_spec>
```

### Requests to WFS3 OAPI

The requests use the following format:  `/wfs3/<wfs3_api_endpoint>?MAP=<qgis_project_spec>`

Example:

```
http://myserver:8080/wfs3/collections.html?MAP=<qgis_project_spec>
```

### Accessing the Qgis landing page and other qgis API

By default, the landing page is not enabled, see the
[documentation](https://docs.3liz.org/py-qgis-server/configuration.html#api-enabled-landing-page) on how to enable the landing page.

Qgis api may be exposed on demand by [configuring the api endpoints](https://docs.3liz.org/py-qgis-server/qgisapi.html)


#### Using with lizmap

In order to use the server with lizmap, you must set the following configuration
in your `lizmapConfig.ini.php`:

```
[services]
wmsServerURL="http://my.domain:<port>/ows/"
...

; Use relative path
relativeWMSPath=true
```

### Configuration

The configuration can be done either as configuration .ini file in or as environment variables.

The precedences of the configuration parameters is the following (from lowest to highest)

- Defaults values
- Environment variables
- Config file
- Command line options

#### Configuration parameters

Please look at [the documentation](https://docs.3liz.org/py-qgis-server/index.html) for configuration options

## Logging

By default, the server log on stdout/stderr and you have to configure redirection and log rotation 
on your infrastructure environment

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/3liz/py-qgis-server",
    "name": "py-qgis-server",
    "maintainer": "David Marteau",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "dmarteau@3liz.com",
    "keywords": "QGIS OWS OGC",
    "author": "3Liz",
    "author_email": "david.marteau@3liz.com",
    "download_url": "https://files.pythonhosted.org/packages/68/2f/5522499db0920b242c1ddb9d3617f9b515d47bf0fe380b5b398430bc83a4/py-qgis-server-1.8.8.tar.gz",
    "platform": null,
    "description": "# QGIS embedded WMS/WFS/WCS asynchronous scalable server\n\n[![PyPi version badge](https://badgen.net/pypi/v/py-qgis-server)](https://pypi.org/project/py-qgis-server/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/py-qgis-server)](https://pypi.org/project/py-qgis-server/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-qgis-server)](https://pypi.org/project/py-qgis-server/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/3liz/qgis-map-server)](https://hub.docker.com/r/3liz/qgis-map-server/tags)\n\n## Description\n\nThis is an asynchronous HTTP QGIS server written in python on top of the [tornado](http://www.tornadoweb.org/en/stable/) framework and the\n0MQ messaging framework for distributing requests workers.\n\nIt is based on the QGIS 3 server API for efficiently passing requests/responses using 0MQ messaging framework to workers.\n\nThe server may run as a self-contained single service or as a proxy server with an arbitrary number of workers running\nremotely or locally. Independent workers connect automatically to the front-end proxy with no need of special configuration\non the proxy side. Thus, this is ideal for auto-scaling configuration for use with container orchestrator as Rancher, Swarm or Kubernetes.\n\nThe server is aimed at solving some real situations encountered in production environment: zero conf scalability, handle long-running request situation, auto restart...\n\nPy-Qgis-server is constantly tested against QGIS release and ltr version.\nSee the QGIS [roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule).\n\n## Features\n\n- Multiples workers\n- Fair queuing request dispatching\n- Timeout for long-running/stalled requests\n- Full support of qgis server plugins\n- Auto-restart trigger for workers\n- Support streamed/chunked responses \n- SSL support\n- Support for access control extensions\n- Support for Qgis project stored in postgres database\n- Support adding new projects cache handlers as python extension \n- Preloading of Qgis projects in static cache\n- WFS3 support\n- Control exposition of [Qgis API](https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/server.html#custom-apis)\n- Management API (experimental)\n\n## Requirements:\n\n- OS: Unix/Posix variants (Linux or OSX) (Windows not officially supported)\n- Python >= 3.6\n- Qgis >= 3.16\n- Some python knowledge about python virtualenv and package installation.\n- libzmq >= 4.0.1 and pyzmq >= 17\n\n## Documentation:\n\nLatest documentation is available on [docs.3liz.org](https://docs.3liz.org/py-qgis-server/)\n\n## Installation\n\n### From Pypi\n\n```bash\npip install py-qgis-server\n```\n\n### From docker\n\nDocker is the recommended way to deploy py-qgis-server as it ensure a working environment for\nrunning py-qgis-server\n\nFollow the readme in the [docker/](./docker) folder.\n\n### From source \n\nInstall in development mode\n```bash\npip install -e .\n```\n\n## Running the server\n\nThe server does not run as a daemon by itself, there are several ways to run a command as a daemon.\n\nFor example:\n\n* Use Supervisor http://supervisord.org/. Will gives you full control over logs and server status notifications.\n* Use the `daemon` command.\n* Use systemd\n* ...\n\n\n### Running the server\n\n```\nusage: qgisserver [-h] [-d] [-c [PATH]]\n                  [--version] [-p PORT] [-b IP] [-w NUM] [-j NUM] [-u SETUID]\n                  [--rootdir PATH] [--proxy] [--timeout SECONDS]\n\nqgis/HTTP/0MQ scalable server\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d, --debug           debug mode\n  -c [PATH], --config [PATH]\n                        Configuration file\n  --version             Return version number and exit\n  -p PORT, --port PORT  http port\n  -b IP, --bind IP      Interface to bind to\n  -w NUM, --workers NUM\n                        Num workers\n  -j NUM, --jobs NUM    Num server instances\n  -u SETUID, --setuid SETUID\n                        uid to switch to\n  --rootdir PATH        Path to qgis projects\n  --proxy               Run only as proxy\n  --timeout SECONDS     Set client timeout in seconds\n```\n\nBy default, the command will run server instances with workers and use unix sockets to communicate. This can \nbe used to run the server as a single command.\n\n#### Running proxy and workers separately\n\nIf the `--proxy` option the server will act as a proxy server to talk to independent qgis workers. \n\nQgis workers can be run using the command:\n\n```\nqgisserver-worker --host=localhost --rootdir=path/to/projects\n```\n\n\n### Requests to OWS services\n\nThe OWS requests use the following format:  `/ows/?<ows_query_params>`\n\nExample:\n\n```\nhttp://myserver:8080/ows/?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities&MAP=<qgis_project_spec>\n```\n\n### Requests to WFS3 OAPI\n\nThe requests use the following format:  `/wfs3/<wfs3_api_endpoint>?MAP=<qgis_project_spec>`\n\nExample:\n\n```\nhttp://myserver:8080/wfs3/collections.html?MAP=<qgis_project_spec>\n```\n\n### Accessing the Qgis landing page and other qgis API\n\nBy default, the landing page is not enabled, see the\n[documentation](https://docs.3liz.org/py-qgis-server/configuration.html#api-enabled-landing-page) on how to enable the landing page.\n\nQgis api may be exposed on demand by [configuring the api endpoints](https://docs.3liz.org/py-qgis-server/qgisapi.html)\n\n\n#### Using with lizmap\n\nIn order to use the server with lizmap, you must set the following configuration\nin your `lizmapConfig.ini.php`:\n\n```\n[services]\nwmsServerURL=\"http://my.domain:<port>/ows/\"\n...\n\n; Use relative path\nrelativeWMSPath=true\n```\n\n### Configuration\n\nThe configuration can be done either as configuration .ini file in or as environment variables.\n\nThe precedences of the configuration parameters is the following (from lowest to highest)\n\n- Defaults values\n- Environment variables\n- Config file\n- Command line options\n\n#### Configuration parameters\n\nPlease look at [the documentation](https://docs.3liz.org/py-qgis-server/index.html) for configuration options\n\n## Logging\n\nBy default, the server log on stdout/stderr and you have to configure redirection and log rotation \non your infrastructure environment\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Py-Qgis-Server is an implementation of the OWS standards standard from the Open Geospatial Consortium.Py-Qgis-Server written in Python and built on top of Qgis serverimplementation",
    "version": "1.8.8",
    "project_urls": {
        "Homepage": "https://github.com/3liz/py-qgis-server"
    },
    "split_keywords": [
        "qgis",
        "ows",
        "ogc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "682f5522499db0920b242c1ddb9d3617f9b515d47bf0fe380b5b398430bc83a4",
                "md5": "cc044471846dbcce6abf9adea3f7342e",
                "sha256": "c0c1ad9f6647179babee514fd14e0b03112f25b026e6c4ac5262fe2943972c6a"
            },
            "downloads": -1,
            "filename": "py-qgis-server-1.8.8.tar.gz",
            "has_sig": false,
            "md5_digest": "cc044471846dbcce6abf9adea3f7342e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 59502,
            "upload_time": "2023-05-04T15:32:31",
            "upload_time_iso_8601": "2023-05-04T15:32:31.366158Z",
            "url": "https://files.pythonhosted.org/packages/68/2f/5522499db0920b242c1ddb9d3617f9b515d47bf0fe380b5b398430bc83a4/py-qgis-server-1.8.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-04 15:32:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "3liz",
    "github_project": "py-qgis-server",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "py-qgis-server"
}
        
Elapsed time: 0.05955s