Giter Site home page Giter Site logo

onroerenderfgoed / crabpy_pyramid Goto Github PK

View Code? Open in Web Editor NEW
1.0 12.0 1.0 456 KB

Bindings for the crabpy library and the pyramid framework

Home Page: http://crabpy-pyramid.readthedocs.org/

License: MIT License

Python 100.00%
crab address python pyramid flanders pypi-package lib

crabpy_pyramid's People

Contributors

bartsaelen avatar cahytinne avatar cedrikv avatar claeyswo avatar goessebr avatar koenedaele avatar pyup-bot avatar vancamti avatar wim-de-clercq avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

talissajoly

crabpy_pyramid's Issues

Handling unexisting objects

I don't think we're handling certain things correctly. Eg. when I go to https://geo.onroerenderfgoed.be/crab/gemeenten/354556, I get a HTTP 500 error while this should actually be a HTTP 404.

Please check all routes that should be returning 404's and add these where necessary. Make sure to keep the distinct between a 404 and a 500. If the CRAB service is down or something else is wrong, it's still a 500. It's only a 404 when a certain object does not exist.

Remove templates

There's a template dir that's probably not doing anything. Remove if possible.

add http caching

These services are being used a lot, some extra http caching here and there might do wonders.

Add adresposities

See OnroerendErfgoed/crabpy#37.

  • /crab/huisnummers/{huisnummer_id}/adresposities Maps to list_adresposities_by_huisnummer(self, huisnummer)
  • /crab/subadressen/{subadres_id}/adresposities Maps to list_adresposities_by_subadres(self, subadres)
  • /adresposities/{adrespositie_id} Maps to get_adrespositie_by_id(self, id)

Don't forget to update the service docs.

Module header

Provide every python module with a header that contains the following:

# -*- coding: utf-8 -*-                                                         
'''                                                                             
<Description of Module>
.. versionadded:: 0.1.0
'''

Verwijderen rq_dashboard

Aangezien we het rq-dashboard kunnen raadplegen in de monitaurus mogen alle verwijzingen naar rq-dashboard uit de toepassingen gehaald worden. Dus indien van toepassing moet de view verwijderd worden en rq-dashboard uit de requirements gehaald worden.

Include CAPAKEY by default?

In the past, Capakey was not included by default because this required authentication. Since version 0.6.0 we're using the REST service, which does not require authentication. Might be useful to add Capakey by default from now on.

It does break BC somewhat, but I guess if we're the only ones using it, it does not matter so much.

Create basic skeleton

Create the basic directory structure:

  • crabpy_pyramid package
  • setup.py
  • MANIFEST.IN
  • CHANGES.rst
  • README.rst

Create unit test skeleton

Setup basic stuff for unit testing:

  • crabpy_pyramid/tests module
  • unit testing configuration: tox.ini, nose files, .travis.yml

Correct handling of start and count

These need to be passable through the Range headers used by dojo:

Range: items=0-19

Meaning, give me 20 items, starting with item 0. If this header is not present, a X-Range header needs to be checked (used because Opera blocks the normal Range header).

X-Range: items=0-19

Responses need to incorporate the Content-Range and X-Content-Range to indicate what slice of data is being returned.

Content-Range: items=0-19/50
X-Content-Range: items=0-19/50

This indicated that the first 20 of 50 items are being returned.

Response format for parcel is broken

In version 0.6.0:

{
    "percid": "11372_A_0005_P_000_00",
    "sectie": {
        "afdeling": {
            "naam": "AARTSELAAR  2 AFD",
            "id": 11372,
            "gemeente": {
                "naam": "Aartselaar",
                "id": 11001
            }
        },
        "id": "A"
    },
    "capakey": "11372A0005/00P000",
    "bounding_box": "{\"coordinates\":[[[149254.71962500364,204170.85500000045],[149328.96400000155,204170.85500000045],[149328.96400000155,204255.58281249925],[149254.71962500364,204255.58281249925],[149254.71962500364,204170.85500000045]]],\"type\":\"Polygon\",\"crs\":{\"type\":\"link\",\"properties\":{\"href\":\"http://www.opengis.net/def/crs/EPSG/0/31370\"}}}",
    "centroid": "{\"coordinates\":[149291.84181250259,204213.21890624985],\"type\":\"Point\",\"crs\":{\"type\":\"link\",\"properties\":{\"href\":\"http://www.opengis.net/def/crs/EPSG/0/31370\"}}}",
    "id": "0005/00P000"
}

In version 0.5.1:

{
    "percid": "11372_A_0005_P_000_00",
    "sectie": {
        "afdeling": {
            "naam": "AARTSELAAR  2 AFD",
            "id": 11372,
            "gemeente": {
                "naam": "Aartselaar",
                "id": 11001
            }
        },
        "id": "A"
    },
    "capakey": "11372A0005/00P000",
    "bounding_box": [
        149254.719625004,
        204170.855,
        149328.964000002,
        204255.582812499
    ],
    "centroid": [
        149291.841812503,
        204213.21890625
    ],
    "id": "0005/00P000"
}

The API of version 0.5 should be maintained. This might also mean that the problem is present in CRABpy 0.8.0 and that we've broken the API there as well. Should be fixed before we start integrating the new version in exsiting applications.

Caching tween volledig herwerken

https://github.com/OnroerendErfgoed/dossierdata/issues/232

Samengevat:

  • We implementeren optie 1. Standaard staat de tween aan, maar je kunt ze makkelijk afzetten. (Dit om backwards compatible te zijn. We kunnen er ook een opt-in van maken, maar dan moet dat SemVer gewijs duidelijk zijn)
  • Indien de tween actief is, dan hanteert deze een lijst van routes die cacheable zijn. Zorg dat het eenvoudig is om de lijst van routes uit te breiden in een bepaalde toepassing.
  • HTTP responses >= 400 krijgen geen ETag

Ik zou op PUT en POST die ETag nog wel meesturen. Ik zie er mss ook niet direct het nut van in maar ik durf niet te garanderen dat we daar al niet ergens van uitgaan.

Update pycountry to latest version

Updating Pycountry to a version > 1.20 breaks CRABpy_pyramid. Think we should update to the latest version (semVer compatible) and pin to a version > 1.20 in setup.py

crabpy updaten naar 0.8.2

Ter info en voor toepassing voor vele projecten: Vrijdag werd een update van crabpy naar 0.8.2 uitgevoerd.
De capakey rest service van Informatie Vlaanderen is niet langer toegankelijk op de URL die we tot 0.8.1 gebruikten. Daardoor faalden zoekopdrachten op het geoportaal. Wellicht dient dit in nog tal van projecten te worden aangepast, al heb ik geen idee voor welke projecten dit absoluut noodzakelijk is.

Release notes crabpy 0.8.2: https://github.com/OnroerendErfgoed/crabpy/releases

Add a list of countries

Add rest endpoints, exposing stuff from the pycountry dataset:

  • /crab/landen: A list of countries, containing the ISO 3166 country code and a label in Dutch (if available).
  • /crab/landen/BE: More information on a certain country.

Example JSON responses:

List

[
 {
  'id': BE,
  'naam': "België"
 }
]

Detail

{
 'id': 'BE',
 'alpha2': 'BE',
 'alpha3': 'BEL',
 'naam': "België",
}

Switchen van wsgicors naar wsgicoers

Indien van toepassing. In de requirements wsgicors dependency verwijderen en toevoegen wsgicoers==0.8.2. In prodcution.ini use = egg:wsgicors#middleware vervangen door use = egg:wsgicoers#middleware.

Implement subadressen

Implement Subadressen as added to CRABpy in OnroerendErfgoed/crabpy#34.

Routes wanted:

  • list_subadressen_by_huisnummer, /crab/huisnummers/{huisnummer_id}/subadressen
  • get_subadres_by_id, /crab/subadressen/{subadres_id}

These should be added to crabpy_pyramid.routes.crab.

Renderers should be similar to those for Huisnummer. In list mode id, status and label (=actual Subadres). In get mode the full object.

Can you develop this in a branch and send a PR when ready?

Filtering empty settings

Sometimes empty settings are provided, eg.:

crabpy.proxy.http =
crabpy.proxy.https =

This leads to errors downstream in urllib. Should be possible to filter theses settings out at initialisation.

Add get_capakey_gateway method

Add a way to get a capakey gateway.

Upon startup the settings should be used to create a capakey gateway and add it to the pyramid registry. This means that the following settings need to be passable:

  • capakey.user
  • capakey.password
  • capakey.wsdl

A get_capakey_gateway() directive should be added to the configurator.

A capakey_gateway property should be added to the request

Split crab and capakey

Split the crab and capakey functionalities to make it possible to only include one of the two. Especially usefull when the user doens't have acess to the capakey service.

documentatie: aanvullen documentatie

documentatiefolder verder aanvullen:

  • Inleiding: wat is het doel van de applicatie
  • Architectuur: Datamodel, gebruikte componenten, Interacties
  • ontwikkelinfo: hoe het project opzetten als ontwikkelaar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.