Giter Site home page Giter Site logo

qualqomm_weather-api's Introduction

qualqomm_weather-api

REST API service to provide weather information using the Django framework.

In this challenge, you are part of a team building a travel company platform. One requirement is for a REST API service to provide weather information using the Django framework. You will need to add functionality to add and delete information as well as to perform some queries. You'll be dealing with typical information for weather data like latitude, longitude, temperature, etc. The team has come up with a set of requirements including filtering and ordering requirements, response codes and error messages for the queries you must implement.

The definitions and a detailed requirements list follow. You will be graded on whether your application performs data retrieval and manipulation based on given use cases exactly as described in the requirements.

Each weather data is a JSON entry with the following keys:

id: This is the unique weather data ID. date: This is the weather data record date given in the format yyyy-MM-dd. location: The place for which the weather data was recorded. The location itself is a JSON object consisting of the following fields: lat: The latitude (upto four decimal places) of the location. lon: The longitude (upto four decimal places) of the location. city: This is the city name. state: This is the state name. temperature: This is an array of 24 float values (upto one decimal place), describing the hourly temperature (in F) for the given location.

Sample JSON weather data object

The REST service should implement the following functionalities:

Erasing all the weather data: The service should be able to erase all the weather data by the DELETE request at /erase. The HTTP response code should be 200. Erasing all the weather data by the date range inclusive and the location coordinates: The service should be able to erase all the weather data by the date range inclusive and the location coordinates by the DELETE request at /erase?start={startDate}&end={endDate}&lat={latitude}&lon={longitude}. The HTTP response code should be 200. Adding new weather data: The service should be able to add a new weather data by the POST request at /weather. The weather JSON is sent in the request body. If weather data with the same ID already exists then the HTTP response code should be 400; otherwise, the response code should be 201. Returning all the weather data: The service should be able to return the JSON array of all the weather data by the GET request at /weather. The HTTP response code should be 200. The JSON array should be sorted in ascending order of weather data ID. Returning the weather data filtered by the date: The service should be able to return the JSON array of all the weather data recorded on the given date by the GET request at /weather?date={date}. If the requested date does not exist then HTTP response code should be 404; otherwise, the response code should be 200. The JSON array should be sorted in ascending order of weather data ID. Returning the weather data filtered by the location coordinates: The service should be able to return the JSON array of all the weather data which are associated with the given latitude and longitude by the GET request at /weather?lat={latitude}&lon={longitude}. If the requested location does not exist then HTTP response code should be 404; otherwise, the response code should be 200. The JSON array should be sorted in ascending order of weather data ID.

You should complete the given incomplete project so that it passes all the test cases when running the provided unit tests. The project by default supports the use of SQLite3 database.

qualqomm_weather-api's People

Contributors

girishgupta211-zz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.