Open isedwards opened 1 year ago
a) among the three options, I think approach one will give us more freedom and better long-term outcome. b) I am not sure how do we do this... i.e. which parts to take, which parts to implement ourselves etc c) this might be another good option in terms of initial outcome, but I think eventually we have to go down a different path in future
We could begin from scratch an create the new pycdmsapi application inspired by pygeoapi. Or we could:
pygeoapi @ git+https://github.com/geopython/pygeoapi.git@master
as a dependencyfrom pygeoapi.provider.postgresql import PostgreSQLProvider
pygeoapi-config.yml
that is renamed as pycdmsapi-config.yml
- where the pygeoapi config options are a subset of the pycdmsapi configThen we can begin to add our own modules that are CDMS specific, e.g. pycdmsapi/provider
will contain CDMS provider plugins like class ClimsoftProvider(pycdmsapi.provider.BaseProvider)
etc.
Starting with a copy of the pygeoapi code base would be ideal - because we would be starting with a working application. However, on reflection I don't think we can adopt the existing code en masse like this because the contributors to the pygeoapi project have not agreed to our project's Contributor's Licence Agreement (CLA).
Therefore - I think the only way forward is approach (a): "create a completely separate package that follows the same principals and borrows some code".
In this repository I've created a fresh package called pycdmsapi and registered this with PyPI.
If we could create an example pycdmsapi-config.yml
, I could borrow some code from pygeoapi and implement a demo.
We can divide the task into two parts:
pycdmsapi-config.yml
to pycdmsapi-openapi.yml
Converting pycdmsapi config to openapi specification depends largely on how would pycdmsapi config look like.
To spin up a server from Open API specification we can take similar approach taken by openapi generator (https://openapi-generator.tech/docs/generators). It's done using mustache template.
https://openapi-generator.tech/docs/generators
Or we can take completely different approach, we can generate a fastapi app from pycdmsapi config file. Which automatically generates openapi spec.
For the OpenCDMS Web API Reference Implementation, we would like to follow the framework-agnostic approach taken by pygeoapi which does not import dependencies from any particular Python web framework.
This first issue aims to investigate possible approaches. Should we: a) create a completely separate package that follows the same principals and borrows some code b) create a completely separate package that imports and reuses capabilities from pygeoapi where possible c) maintain a fork of pygeoapi d) ...