Introduction
APIs are an essential part of every software. Developers use them in various ways to populate the frontend interfaces with essential data. This summer, I will be working on building a Python client and a wrapper for the OGC Maps API. This will be extended to other APIs as well in a later stage.
Currently, the API can only be used by sending GET/POST requests manually. Optional data is passed into the query string. The Python client will enable users to access the API directly from the terminal, with options to pretty print the data or save it as a JSON file. The API wrapper will be useful to fetch data in Python code in a simpler manner.
I will also be writing unit tests for the API definitions so that it can be scaled more efficiently to other APIs in the future. In addition, I will provide new documentation on how to use the API client and the wrapper.
Objective 1 – Helper Functions
Each endpoint will have its own helper function, or a single function that will dynamically make URL parameters when passed through certain arguments. Although the latter method involves writing less code, it can be less scalable if we want to modify a certain endpoint’s functioning and how it handles data. These functions will be common for the API wrapper and the terminal client.
Objective 2 – API Wrapper & Python client
The helper functions will be used by the API wrapper as a Python package that is directly imported into the code. The terminal client will use Python’s default command line interface (CLI) parser ‘argparse’ to process the input. A base Python package can be used to define the main API definitions (Maps API) and make subpackages for each API to make the application scalable in the future.
About Me
I am Prakhar Gurunani, a freshman at Birla Institute of Technology & Science, Pilani. I primarily love working as a backend developer, building services and tools for the community. I often play badminton and go swimming. This is my first time as an open source contributor in Google SUmmer of Code. I will be working under the mentorship and guidance of Mr. Benjamin Pross. You can find my portfolio here.
Leave a Reply