Giter Site home page Giter Site logo

assignment-loop-'s Introduction

Endpoint 1: Get the report of the number of times each store went inactive during its business hours HTTP Method: GET URL: /report Response: Returns a JSON object containing the number of times each store went offline during its business hours. The store IDs are used as keys, and the corresponding values represent the count of inactive instances.

Endpoint 2: Get the store status for a specific store and timestamp HTTP Method: GET URL: /status Query Parameters: store_id: The ID of the store for which you want to retrieve the status. timestamp_utc: The timestamp (in UTC) for which you want to retrieve the status. Response: Returns a JSON object containing the store ID, timestamp, and status (active or inactive) for the specified store and timestamp. If no status is found for the given store ID and timestamp, an error message is returned.

The code also includes helper functions to read the data from CSV files and perform the necessary calculations. The read_store_status function reads the store status data from the CSV file and returns it as a list. The read_business_hours function reads the business hours data from the CSV file and returns it as a dictionary. The read_timezone_data function reads the timezone data from the CSV file and returns it as a dictionary. The calculate_inactive_count function calculates the number of times a store was inactive during its business hours. It takes the store ID, store status data, business hours data, and timezone data as input and returns the count of inactive instances. The code uses these helper functions and the Flask framework to create the endpoints and handle the API requests.

assignment-loop-'s People

Contributors

sourabhkumarjod 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.