This day marks the end of the first week of the coding period. The past week mostly involved setting up the codebase and building the helper functions

GSoC'22 Week #1 - Getting Started | Prakhar Gurunani

submited by
Style Pass
2022-06-22 13:00:13

This day marks the end of the first week of the coding period. The past week mostly involved setting up the codebase and building the helper functions, which is summarized in brief below.

Currently, OGC Maps API does not have a API wrapper or Python client to interact with. This will be my primary task during the programme. ALong with this, I will be writing tests for the helper functions and a new documentation for the API.

The Python package was easy to setup. Then started building the API functions. Since it is not convenient to write URL strings every time making a request to the API, a better way to handle this was to wrap all the endpoints inside a urls() class.

Calling urls().get_collection() would return the URL for the particular endpoint. This would make it easy to write tests for the endpoints.

Till now, I have written the metadata functions for /collections, /conformance, and /map endpoints. These main endpoints have a separate independent class, which need to be first initiated in order to use them. This would pretty print the output to the terminal, using json.dumps(). All the endpoints accept either application/json or image/jpeg as headers, depending on type of response the server sends. This will serve as a boolean check to ensure the data type that is being returned without actually analyzing the response.

Leave a Comment