pyramid-oereb


Namepyramid-oereb JSON
Version 2.5.4 PyPI version JSON
download
home_pageNone
Summarypyramid_oereb, extension for pyramid web frame work to provide a basic server part for the oereb project
upload_time2024-11-04 13:37:00
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseBSD 2-Clause License Copyright (c) 2017-2019, Kanton Basel-Landschaft, République et Canton de Neuchâtel, Camptocamp SA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords pyramid oereb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============================
``pyramid_oereb`` (ÖREB-Server)
===============================

Project description
===================

``pyramid_oereb`` is an open-source implementation of the server side part for the swiss `"Cadastre of
Public-law Restrictions on landownership" (PLR-cadastre) <https://www.cadastre.ch/en/oereb.html>`__.

It is written in Python and designed as a plugin for the `Pyramid Web Framework
<http://docs.pylonsproject.org/projects/pyramid/en/latest/>`__. This allows ``pyramid_oereb`` to be
included in any Pyramid web application.

Please refer to the `documentation <https://openoereb.github.io/pyramid_oereb/>`__ for detailed
information and instructions for installation and configuration.

If you are interested in contributing or extending the project, take a look at the
`contribution page <https://openoereb.github.io/pyramid_oereb/doc/contrib/>`__.


Starting the development server
===============================

#. Build run the initial build depending on your OS:

   * ``docker network create print-network``
   * Linux: ``docker compose run --rm -u $(id -u):$(id -g) oereb-make build``
   * MAC/Windows: ``docker compose run --rm oereb-make build``

#. ``docker compose up``

Running ``docker compose up`` will start the DB (it will automatically import the test/dev data on startup) and start
a running instance of the pyramid_oereb DEV server connected to the DB. The project folder is mounted
to it. So changes take effect.

The sample static extract should then be available at http://localhost:6543/oereb/extract/json?EGRID=CH113928077734


Running the tests
=================

To run the tests locally:

The docker way:
---------------
  * ``docker network create print-network``
  * Linux: ``docker compose run --rm -u $(id -u):$(id -g) oereb-server make build tests``
  * MAC/Windows: ``docker compose run --rm oereb-server make build tests``

For systems having a local make tool, the following recipe can be used:
``make docker-tests``

sometimes the local postgres port is already in use, and you must override it:
``EXPOSED_PGPORT=5433 make docker-tests``


Local tests:
------------
For local tests without the complete docker composition you need a running DB.
You can create one based on the oereb image:
``docker compose up -d oereb-db``

or create an empty postgis DB
``docker run -p 5555:5432 --name pg_oereb --rm -it -e POSTGRES_PASSWORD=pw postgis/postgis``

Then you can run the tests easily:
``make tests``

If the DB does not use standard credentials, you can set them as ENV vars:
``PGPORT=5555 PGPASSWORD=pw make tests``

To run one specfic test:

.. code-block:: bash

  docker compose exec oereb-server PYTEST_OPTS="-k <name_of_the_test>" make tests

Troubleshooting
---------------
Some local files may remain from previous builds, and the regular user may not be able to delete them.
In this case cleanup can be done like:

.. code-block:: bash

  docker compose run --rm oereb-make clean-all



Useful ``make`` targets
=======================

Run the ``make`` targets found in the Makefile either in the ``oereb-server`` container (if using ``docker compose``) or in your local shell (if running the server locally).
Some useful targets:

- ``make serve-dev`` to run the application
- ``make tests`` to run the application tests
- ``make docker-tests`` to run the application tests inside a docker composition, so one does not have to care about local set up
- ``make clean`` to empty the database
- ``make clean-all`` to empty the database, uninstall the application and the virtual env and clear the rendered configuration files
- ``make docker-clean-all`` to clean up everything written by the docker container. This is sometimes useful when docker has created some files with root only permission

If necessary the application is re-installed and the database is filled when running ``make serve-dev`` again.


There are further make targets to check the validity of federal data:

- ``make check_fed_data`` downloads currently known federal data definitions and compares them with the active ones
- ``make update_fed_data_urls`` try to retrieve the new urls from the server's index page. The file fed.urls must then be committed to the repo
- ``make update_fed_data_urls`` generate new json files in the repo. The modified files must then be committed
- ``make auto_update_fed_data`` automagic command which finds the new URLs, generates json data, copies json to project. The files fed.urls and dev/sample_data/ch.*.json must be committed if changed

Using MapFish-Print
===================

To be able to test the OEREB static extract (pdf), you need to run ``pyramid_oereb`` with ``docker compose`` and to have a running instance of `pyramid_oereb_mfp <https://github.com/openoereb/pyramid_oereb_mfp>`__.
The Docker network ``print-network`` is also required and can be created with:

.. code-block:: bash

  docker network create print-network

It is also possible to launch a Mapfish Print service on a local URL (via Docker or not) and then run the server via `make serve`. The correct print url must be provided:

.. code-block:: bash

  PRINT_URL="http://localhost:8680/print/oereb" EXPOSED_PGPORT=5433 PGPORT=5433 make serve-dev

The sample static extract should then be available at http://localhost:6543/oereb/extract/pdf?EGRID=CH113928077734


CI Status
=========

CI status on master branch:

.. image:: https://github.com/openoereb/pyramid_oereb/actions/workflows/ci.yaml/badge.svg
   :alt: Master CI status
   :target: https://github.com/openoereb/pyramid_oereb/actions/workflows/ci.yaml

Daily check status:

.. image:: https://github.com/openoereb/pyramid_oereb/actions/workflows/daily_check.yaml/badge.svg
   :alt: Daily check status
   :target: https://github.com/openoereb/pyramid_oereb/actions/workflows/daily_check.yaml

Code Quality Status:

.. image:: https://api.codacy.com/project/badge/Grade/cf50094a4e84434d837babf1106f9fcb
   :alt: Codacy Badge
   :target: https://app.codacy.com/gh/openoereb/pyramid_oereb?utm_source=github.com&utm_medium=referral&utm_content=openoereb/pyramid_oereb&utm_campaign=Badge_Grade_Settings

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyramid-oereb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pyramid oereb",
    "author": null,
    "author_email": "Fran\u00e7ois Voisard <francois.voisard@ne.ch>",
    "download_url": "https://files.pythonhosted.org/packages/32/6b/081de93372003b70ba87a449fc1f883147c3cac6c97bb72bd6b2c136a619/pyramid_oereb-2.5.4.tar.gz",
    "platform": null,
    "description": "===============================\n``pyramid_oereb`` (\u00d6REB-Server)\n===============================\n\nProject description\n===================\n\n``pyramid_oereb`` is an open-source implementation of the server side part for the swiss `\"Cadastre of\nPublic-law Restrictions on landownership\" (PLR-cadastre) <https://www.cadastre.ch/en/oereb.html>`__.\n\nIt is written in Python and designed as a plugin for the `Pyramid Web Framework\n<http://docs.pylonsproject.org/projects/pyramid/en/latest/>`__. This allows ``pyramid_oereb`` to be\nincluded in any Pyramid web application.\n\nPlease refer to the `documentation <https://openoereb.github.io/pyramid_oereb/>`__ for detailed\ninformation and instructions for installation and configuration.\n\nIf you are interested in contributing or extending the project, take a look at the\n`contribution page <https://openoereb.github.io/pyramid_oereb/doc/contrib/>`__.\n\n\nStarting the development server\n===============================\n\n#. Build run the initial build depending on your OS:\n\n   * ``docker network create print-network``\n   * Linux: ``docker compose run --rm -u $(id -u):$(id -g) oereb-make build``\n   * MAC/Windows: ``docker compose run --rm oereb-make build``\n\n#. ``docker compose up``\n\nRunning ``docker compose up`` will start the DB (it will automatically import the test/dev data on startup) and start\na running instance of the pyramid_oereb DEV server connected to the DB. The project folder is mounted\nto it. So changes take effect.\n\nThe sample static extract should then be available at http://localhost:6543/oereb/extract/json?EGRID=CH113928077734\n\n\nRunning the tests\n=================\n\nTo run the tests locally:\n\nThe docker way:\n---------------\n  * ``docker network create print-network``\n  * Linux: ``docker compose run --rm -u $(id -u):$(id -g) oereb-server make build tests``\n  * MAC/Windows: ``docker compose run --rm oereb-server make build tests``\n\nFor systems having a local make tool, the following recipe can be used:\n``make docker-tests``\n\nsometimes the local postgres port is already in use, and you must override it:\n``EXPOSED_PGPORT=5433 make docker-tests``\n\n\nLocal tests:\n------------\nFor local tests without the complete docker composition you need a running DB.\nYou can create one based on the oereb image:\n``docker compose up -d oereb-db``\n\nor create an empty postgis DB\n``docker run -p 5555:5432 --name pg_oereb --rm -it -e POSTGRES_PASSWORD=pw postgis/postgis``\n\nThen you can run the tests easily:\n``make tests``\n\nIf the DB does not use standard credentials, you can set them as ENV vars:\n``PGPORT=5555 PGPASSWORD=pw make tests``\n\nTo run one specfic test:\n\n.. code-block:: bash\n\n  docker compose exec oereb-server PYTEST_OPTS=\"-k <name_of_the_test>\" make tests\n\nTroubleshooting\n---------------\nSome local files may remain from previous builds, and the regular user may not be able to delete them.\nIn this case cleanup can be done like:\n\n.. code-block:: bash\n\n  docker compose run --rm oereb-make clean-all\n\n\n\nUseful ``make`` targets\n=======================\n\nRun the ``make`` targets found in the Makefile either in the ``oereb-server`` container (if using ``docker compose``) or in your local shell (if running the server locally).\nSome useful targets:\n\n- ``make serve-dev`` to run the application\n- ``make tests`` to run the application tests\n- ``make docker-tests`` to run the application tests inside a docker composition, so one does not have to care about local set up\n- ``make clean`` to empty the database\n- ``make clean-all`` to empty the database, uninstall the application and the virtual env and clear the rendered configuration files\n- ``make docker-clean-all`` to clean up everything written by the docker container. This is sometimes useful when docker has created some files with root only permission\n\nIf necessary the application is re-installed and the database is filled when running ``make serve-dev`` again.\n\n\nThere are further make targets to check the validity of federal data:\n\n- ``make check_fed_data`` downloads currently known federal data definitions and compares them with the active ones\n- ``make update_fed_data_urls`` try to retrieve the new urls from the server's index page. The file fed.urls must then be committed to the repo\n- ``make update_fed_data_urls`` generate new json files in the repo. The modified files must then be committed\n- ``make auto_update_fed_data`` automagic command which finds the new URLs, generates json data, copies json to project. The files fed.urls and dev/sample_data/ch.*.json must be committed if changed\n\nUsing MapFish-Print\n===================\n\nTo be able to test the OEREB static extract (pdf), you need to run ``pyramid_oereb`` with ``docker compose`` and to have a running instance of `pyramid_oereb_mfp <https://github.com/openoereb/pyramid_oereb_mfp>`__.\nThe Docker network ``print-network`` is also required and can be created with:\n\n.. code-block:: bash\n\n  docker network create print-network\n\nIt is also possible to launch a Mapfish Print service on a local URL (via Docker or not) and then run the server via `make serve`. The correct print url must be provided:\n\n.. code-block:: bash\n\n  PRINT_URL=\"http://localhost:8680/print/oereb\" EXPOSED_PGPORT=5433 PGPORT=5433 make serve-dev\n\nThe sample static extract should then be available at http://localhost:6543/oereb/extract/pdf?EGRID=CH113928077734\n\n\nCI Status\n=========\n\nCI status on master branch:\n\n.. image:: https://github.com/openoereb/pyramid_oereb/actions/workflows/ci.yaml/badge.svg\n   :alt: Master CI status\n   :target: https://github.com/openoereb/pyramid_oereb/actions/workflows/ci.yaml\n\nDaily check status:\n\n.. image:: https://github.com/openoereb/pyramid_oereb/actions/workflows/daily_check.yaml/badge.svg\n   :alt: Daily check status\n   :target: https://github.com/openoereb/pyramid_oereb/actions/workflows/daily_check.yaml\n\nCode Quality Status:\n\n.. image:: https://api.codacy.com/project/badge/Grade/cf50094a4e84434d837babf1106f9fcb\n   :alt: Codacy Badge\n   :target: https://app.codacy.com/gh/openoereb/pyramid_oereb?utm_source=github.com&utm_medium=referral&utm_content=openoereb/pyramid_oereb&utm_campaign=Badge_Grade_Settings\n",
    "bugtrack_url": null,
    "license": "BSD 2-Clause License  Copyright (c) 2017-2019, Kanton Basel-Landschaft, R\u00e9publique et Canton de Neuch\u00e2tel, Camptocamp SA All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "pyramid_oereb, extension for pyramid web frame work to provide a basic server part for the oereb project",
    "version": "2.5.4",
    "project_urls": {
        "Changelog": "https://github.com/openoereb/pyramid_oereb/blob/master/CHANGES.rst",
        "Repository": "https://github.com/openoereb/pyramid_oereb"
    },
    "split_keywords": [
        "pyramid",
        "oereb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c177cb72d2245053c488bc2ba52808024efb25223ed42e9e4c5273de0dd9a1f",
                "md5": "66983204f12573300d324673e780dfea",
                "sha256": "3fdc9eac40e7893802eef50ca65476b4407a5ce64f0ea215d55587d49ee7d548"
            },
            "downloads": -1,
            "filename": "pyramid_oereb-2.5.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66983204f12573300d324673e780dfea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 283360,
            "upload_time": "2024-11-04T13:36:58",
            "upload_time_iso_8601": "2024-11-04T13:36:58.494510Z",
            "url": "https://files.pythonhosted.org/packages/3c/17/7cb72d2245053c488bc2ba52808024efb25223ed42e9e4c5273de0dd9a1f/pyramid_oereb-2.5.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "326b081de93372003b70ba87a449fc1f883147c3cac6c97bb72bd6b2c136a619",
                "md5": "6977dd38412c77ee8a60c30a50ac09c0",
                "sha256": "1f391b5ed0dbf9e7a3d4de1aa18320e255f1752efe474a78bab58e1f60c4f59a"
            },
            "downloads": -1,
            "filename": "pyramid_oereb-2.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6977dd38412c77ee8a60c30a50ac09c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 143837,
            "upload_time": "2024-11-04T13:37:00",
            "upload_time_iso_8601": "2024-11-04T13:37:00.759616Z",
            "url": "https://files.pythonhosted.org/packages/32/6b/081de93372003b70ba87a449fc1f883147c3cac6c97bb72bd6b2c136a619/pyramid_oereb-2.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 13:37:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openoereb",
    "github_project": "pyramid_oereb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyramid-oereb"
}
        
Elapsed time: 0.40114s