test
Project description
NGR SPIDER
CLI (command line interface) application to retrieve list of services and datasets in a simple JSON format from nationaalgeoregister.nl (NGR), leveraging the NGR CSW service.
To install from source run (from the root this repo):
python3 -m pip install -e .
This should install the cli tool ngr-spider
:
$ ngr-spider
usage: ngr-spider [-h] subcommand ...
Generate list of PDOK services and/or service layers
positional arguments:
subcommand
services Generate list of all PDOK services
layers Generate list of all PDOK layers
options:
-h, --help show this help message and exit
Examples
- To generate a list of layers per service run the following:
ngr-spider layers -p 'OGC:WMS,OGC:WMTS,OGC:API features' pdok-services.json
ngr-spider services -p 'OGC:WMS,OGC:WMTS,OGC:API features' pdok-services.json
Note: you may need to install pyproj manually (pip install pyproj
) on some systems.
Development
Install dev dependencies and package from source:
python3 -m pip install -e ".[dev]"
To format code install black
en run from the root of this repo:
black .
Delete unused imports with autoflake
:
autoflake --remove-all-unused-imports -i -r .
Organise and order imports with isort
:
isort -m 3 .
Run mypy for type checking (from root):
mypy ngr_spider
Sorting Rules Example
When running the layers
command in flat mode (--mode flat
), it is possible to sort the layers in the output by passing a path to a JSON file containing, sorting rules. See below for an example a sorting rules JSON file (use for example with: ngr-spider layers --sort sorting-rules.json -n 20 -m flat --pretty -p "OGC:WMS,OGC:WMTS" output.json
):
[
{ "index": 0, "names": ["opentopo+"], "types": ["OGC:WMTS"] },
{ "index": 10, "names": ["^actueel_orthohr$"], "types": ["OGC:WMTS"] },
{ "index": 11, "names": ["^actueel_ortho25$"], "types": ["OGC:WMTS"] },
{ "index": 12, "names": ["^actueel_ortho25ir$"], "types": ["OGC:WMTS"] },
{ "index": 12, "names": ["lufolabels"], "types": ["OGC:WMTS"] },
{
"index": 20,
"names": ["landgebied", "provinciegebied", "gemeentegebied"],
"types": ["OGC:WFS"]
},
{ "index": 30, "names": ["top+"], "types": ["OGC:WMTS"] },
{
"index": 32,
"names": ["^standaard$", "^grijs$", "^pastel$", "^water$"],
"types": ["OGC:WMTS"]
},
{
"index": 34,
"names": ["bgtstandaardv2", "bgtachtergrond"],
"types": ["OGC:WMTS"]
},
{ "index": 60, "names": ["ahn3+"], "types": ["OGC:WMTS"] }
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ngr_services_spider-0.7.0.tar.gz
.
File metadata
- Download URL: ngr_services_spider-0.7.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce18764577a8de4537406c6bdd1ab49674711bddcde9b98eeb444448f222b810 |
|
MD5 | f9609d04b8999befc9debfabfbfde2e5 |
|
BLAKE2b-256 | cdd2acc801b302c9599ca8dc5351371923be7706c1e6e4a04a7456f28a1eb7ac |
File details
Details for the file ngr_services_spider-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: ngr_services_spider-0.7.0-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55bb4e390750a32a4867737990166485cbf64d2e85ef218ee2c578aad590e243 |
|
MD5 | 9bd997b1cbe6a10f5d306b6771b80c35 |
|
BLAKE2b-256 | 2de49f6ed2e925ec91c17a302593924ed1a3859517b8dce9c356b2392a04dbc0 |