Commit Graph

39 Commits

Author SHA1 Message Date
Francesco Bartoli 3c5a4cda9c Add a step in CI for CVEs scanning (#1478)
* Add a step in CI for CVEs scanning

* Move the check for vulnerabilities on its own workflow

* Clean the clone job and comment accepted risk

* Add a badge for vulnerabilities clearance in the readme
2024-01-06 11:37:37 -05:00
Tom Kralidis 70feda7deb add DOI (#1220) 2023-04-17 19:28:03 -04:00
Tom Kralidis 2c380375ec Update README.md 2022-11-15 09:20:06 -05:00
John A Stevenson 644281359a Add CQL to PostgreSQL provider (via pygeofilter and sqlalchemy) (#964)
* Add pygeofilter, unpin psycopg2

* Add pygeofilter SQLAlchemy query demo

* Add note about primary key

* Add todos to script

* Make script generic

* Add (commented out) PostgreSQL provider hotosm_bdi_waterways to config

* Update to use local test database

* Return result as dictionary

* Pass GEOM_FIELD as variable

* Add offset and limt, fix two names

* Implement order by

* Use function for cql query

* Add cql query block to query and test

* Link up to db engine

* Convert WKB geometry to GeoJSON

* Add shapely as explicit dependency

* Add tests for CQL queries

* Add test using CROSSES with LINESTRING

* Uncomment Docker PostGIS test layer

* First pass at wiring up API

The CQL is read from the request but the parser fails to convert to
AST.

* Turn logging to DEBUG

Example query
http://localhost:5000/collections/hot_osm_waterways/items?cql=%27osm_id%20BETWEEN%2080800000%20AND%2080900000%20AND%20name%20IS%20NULL%27

* Create dedicated pygeoapi-config.yml for testing PostgreSQL

* Add test for PostgreSQL CQL

* Return 400 for bad CQL

* Tidy up old files

* Bring API error type tests together

* Only reflect the table of interest

* Add pygeofilter to requirements

* Remove local setup_env.sh from .gitignore

* Remove lark exception handling

* Remove lark codes from tests, docstring change

* Split cql test into good and error

* Rename cql parameter to filter

* Add optional filter-lang parameter with test

* Initial changes

* Rename cql text parser

* Use CQL-JSON POST for PostgreSQL query

* Refactor to get data early and handle errors

* Add error tests for CQL-JSON PostgreSQL

* Add tests for prev/next and provider instantiation

* As filter-lang is set the block in not needed

* Clarify test fixtures

* Use filterq only in all CQL calls

* Make engine and table_model attributes of provider

* Handle different instantiation failures

* Use SQLAlchemy for get_fields()

* Minor doc edits

* Use SQLAlchemy for get()

* Simplify _sqlalchemy_to_feature

* Store database parameters in dedicated function

* Strip out non-SQLAlchemy code

* Add draft query() based on CQL filters

* Add property filtering to query()

* Implement select_properties and skip_geometry

* Implement bbox filter

* Implement properties subset defined in config

* Clean up materialized view test

We only need to test the fields that are present to be sure that the
view has been accessed, so other checks have been removed.

* Flake8 fixes and tidy up

* Add combined test for CQL with bbox and properties

* Create sessions directly where required

* Add Engine store to allow connection reuse

* Replace cql_ast with filterq

* Tidy up tests by using fixture for api

* Add authors

* Use Session() as context manager

A session requires a connection to the database, as provided by the
SQLAlchemy engine.  When the session goes out of scope, e.g. at exit
from the function when it was used, it should be garbage collected and
the connection freed.  However, during load testing it was found that
this wasn't happening.  This commit uses a context manager pattern to
start the session, which ensures that the session is closed at the end
of the `with` block.

* Return fields type as {'type': ...}

* Cache the table_model with the engine

Generating the table_model by "reflecting" the database is expensive but
the resulting model doesn't change.  If we cache the table_model with
the engine we save on a round-trip to the database and speed up response
time.

* Use separate stores for Engine and table_models

Using a combined store based on both engine and table_model meant that
a pygeoapi serving multiple tables on the same database would maintain
a connection pool for each table.  This could eventually saturate the
number of available connections.  This commit separates the store into
two parts.

* Update documentation with example

* Manage or post items based on POST content type

* ghcr build action

* only ghcr job

* run criteria edit

* Update README.md

* job = main

* remove success requirememt

* add tag

* tags: bgs-cql

* Update main.yml

* Update README.md

* remove binary

* update

* Update actions to latest versions

* Dockerfile refactor

* Dockerfile refactor

* restore dockerhub

* fix pygeoif version

* # 3.6 test & dockerhub ref

* Pin pygeoif version to less than 1

* Replace psycopg-binary with psycopg

* Split Docker build into sections

* Pin click version >7,<=8

* Add further cql examples

* Update workflows to match GeoPython repo

* update flake python version

* Unquote PostgreSQL column names

* Update container workflow uses versions

* flake8 use python version 3.7

* Use pre ping to get db connection

* Test that properties are set in provider

* Amendments as requested by @tomkralidis

* Correction

* Fix reviewed changes in api code

Co-authored-by: Colin Blackburn <colb@bgs.ac.uk>
Co-authored-by: KoalaGeo <eddlewis85@gmail.com>
Co-authored-by: Edd <edlew@bgs.ac.uk>
Co-authored-by: Colin Blackburn <ximenesuk@users.noreply.github.com>
2022-10-29 02:15:31 -04:00
Just van den Broecke a7d763bf12 Update badges (#1001)
* Update badges

* add Lint badge (see #1000)
* display Workflow names as in Workflow .yml files

* Change Lint Badge order
2022-09-28 07:55:05 -04:00
Just van den Broecke a60445d242 Update CI Build and Docker status badges (#998) 2022-09-27 17:44:00 -04:00
Tom Kralidis 46f84a4ed3 migrate to GitHub Actions (#616) (#703) 2021-06-01 17:15:30 -04:00
Tom Kralidis 60fcdcecf0 update website link 2020-06-22 14:58:05 -04:00
Tom Kralidis 2b38cdba56 simplify README 2020-04-29 14:49:47 -04:00
Tom Kralidis 3debd0c750 update configuration to be resource specific (#393) 2020-04-26 09:57:07 -04:00
Jorge Samuel Mendes de Jesus 81f02a1f54 update openapi docs location
previous link to openapi docs was incorrect: http://localhost:5000/ui
2020-03-26 09:49:38 +01:00
Tom Kralidis c49f91b6d2 Update README.md 2020-01-16 06:45:23 -05:00
Tom Kralidis 09efa01b0b Update README.md 2019-12-24 08:30:29 -05:00
Richard Law 2e6f9abcb0 Json ld docs (#326)
* adds structured data section to configuration documentation

* adds json-ld support button/badge
2019-12-24 07:51:54 -05:00
KoalaGeo 0fadb3c16b Update README.md (#319)
* Update README.md

* Update to docker docs

Update to docker docs
2019-12-12 13:04:48 -05:00
Tom Kralidis 933950b099 move OpenAPI endpoint from /api to /openapi (#285) (#286) 2019-10-23 16:24:00 -04:00
Francesco Bartoli ab12cbfc92 Add support for Starlette (#223)
* Add starlette app with base route

* Add api route

* Add conformance route

* Add route for collections

* Fix flake8 errors

* Add route for collection items

* Add route for processes

* Add docs for starlette

* Add support for starlette

Add api route


Add conformance route


Add route for collections


Fix flake8 errors


Add route for collection items


Add route for processes


Add docs for starlette

* Make starlette deps into a separate requirements file 


Move imports

* Add comment for starlette requirements

* Fix missing docstring param

* Improve installation docs
2019-09-06 14:25:28 -04:00
Richard Law 5c16265633 uses pwd in README instructions for consistency (#216) 2019-09-02 15:53:48 -04:00
Jorge Samuel Mendes de Jesus ac97045cad Update docker image link
Dockerhub has changed url locations
2019-07-07 16:28:04 +02:00
Tom Kralidis e5639b31c2 split out provider requirements (#153) 2019-05-30 16:17:31 +02:00
Just van den Broecke 41544bcc15 #112 #114 master/latest instance at https://demo.pygeoapi.io/master 2019-05-24 13:41:51 +02:00
Just van den Broecke 9b2e16637b geopython/pygeoapi#114 update README.md for build/deploy chain 2019-05-23 16:39:59 +02:00
Just van den Broecke c31e173eff #114 refine Docker assets and the simple and ElasticSearch examples 2019-05-23 15:34:56 +02:00
Alexandre Leroux 02ee73a8f4 typo (#79)
2 minor typos
2019-01-17 13:22:29 -05:00
Tom Kralidis 00f8fb6ceb update subcommand names for click 7.0 changes 2018-10-02 16:07:29 +00:00
Jorge Samuel Mendes de Jesus 66266102a3 Geopackage support (#64)
* 	new file:   docker/Dockerfile
Dockerfile for pygeoapi

* typo

* typo

* geopackage provider

* test travis

* changed href to http

* incorrect field in yml

* missing flake8 check

* POI test dataset

* unit tests

* working unitttests and update to readme

* .gitignore docker

* requests for PR #64

* Update __init__.py

Flake8 whitespace

* flake8 fix and removal of incorrect dockerfile
2018-09-11 12:32:11 -04:00
Alexandre Leroux a4ab8d6d2e minor typos 2018-07-26 19:01:55 -04:00
Jorge Samuel Mendes de Jesus c1e9943c48 Docker composition (ES docker + pygeoapi docker) (#31)
* 	new file:   docker/Dockerfile
Dockerfile for pygeoapi

* Using 0.0.0.0 in pygeoapi-config otherwise no docker for flask

* ES and pygeoapi docker

* Final file structure

* generic port 5000 and localhost

* sqlit3 suport in alpine and fixes on sqlite provider

* B4 sync with upstream

* Working composition problems with ES features

* Cosmetic changes update to README.md

* using load_es_data.py from github local openapi.yml

* added docker pull only of pygeoapi

* b4 rebase

* Using 0.0.0.0 in pygeoapi-config otherwise no docker for flask

* ES and pygeoapi docker

* Final file structure

* generic port 5000 and localhost

* sqlit3 suport in alpine and fixes on sqlite provider

* B4 sync with upstream

* Cosmetic changes update to README.md

* using load_es_data.py from github local openapi.yml

* added docker pull only of pygeoapi

* b4 rebase

* updates and sync

* missing proper local.config.yml

* wait-for pygeoapi

* sync with master config

* 	deleted:    docker/ES/wait-for-it.sh
	new file:   docker/pygeoapi/docker-entrypoint.sh
	new file:   docker/pygeoapi/run_pygeoapi.sh
	openapi.yml
	pygeoapi/provider/__sqlite.py

Missing sh files

* missing set +e

* wait for ES to be yellow or green

* More detailed Readme

* 	new file:   .gitignore

* simple image docker

* missing docker run

* 	new file:   Dockerfile
	new file:   docker.config.yml
	new file:   run_pygeoapi.sh
Simple image

* typos on README
2018-07-03 14:52:17 -04:00
Tom Kralidis 23a2b45260 update heading 2018-04-02 18:28:04 -04:00
Tom Kralidis 832402471b add travis setup (#20) 2018-04-02 18:18:37 -04:00
Jorge Samuel Mendes de Jesus 1de0439e2d Spatiallite3 provider implementation (#17)
* 	new file:   docker/Dockerfile
Dockerfile for pygeoapi

* 	modified:   pygeoapi/provider/__init__.py
	new file:   tests/data/ne_110m_lakes.sqlite
	new file:   tests/json_marshmallow.py
	new file:   tests/test_sqlite_provider.py

Sqlit implementation and testing marshmallows

* 	new file:   provider/sqlite.py
	new file:   provider/tmp_parser.py
Sqlite provider

* Testing sqlalchemy

* query for sqlite3

* Countries dataset, message in assert

* yml config

* table in data link and query implemented without limit

* PR of refactor

* functional sqlite3 driver

* flake8

* pipreq for complete list of requirements

* updated readme with working examples, extra requirements

* typos, SQLite removed Dockerfile and ne_100m_lakes.sqlite

* update requirements

* pypandoc in requirements-dev.txt
2018-04-02 12:05:26 -04:00
Tom Kralidis 9015b16e6d implement OpenAPI from single config 2018-03-27 21:15:43 -04:00
Tom Kralidis d6e4b1dc00 implement logging, first pass cli (#14) 2018-03-08 08:38:42 -05:00
Norman Barker 957df9b844 Swagger gen (#10)
* initial swagger gen

* removed support for html returns

* geojson configuration

* working swagger ui

* config rename

* observation example

* missing call in csv driver

* pr comments
2018-03-07 16:44:04 -05:00
Tom Kralidis 59f0ec34ab add support for collection query startindex, count, resulttype 2018-03-07 03:23:52 +00:00
Tom Kralidis d1d2a589b3 add CSV provider, misc updates 2018-03-07 00:08:05 +00:00
Jorge de Jesus 724294d2d4 modified: README.md
Python3 instrcutions
2018-03-06 21:37:14 +01:00
Tom Kralidis 7c04cdf498 flask implementation 2018-03-06 13:32:14 +00:00
Tom Kralidis 17edb346a1 Initial commit 2018-02-14 21:46:28 -05:00