Code Monkey home page Code Monkey logo

metarproject's Introduction

About

Goal of this project is to query metar station data from their APIs and present it in a client friendly manner, along with caching the data to improve client experience.

Get started

  1. Setup virtualenv

    virtualenv venv
    
    source venv/bin/activate
    
  2. Install dependencies using requirements.txt

    pip install -r requirements.txt
    
  3. Start the django server

    python manage.py runserver
    
  4. Start the redis server

    brew install redis
    
    brew services start redis
    

make sure redis server is running on 127.0.0.1 local host on port 6379 (default settings).

  1. Endpoints and Query parameters

    There is one active endpoint on which scode's could be queried on.

    http://127.0.0.1:8000/api/

    Accepted query parameters are scode and nocache. i) scode - Recognized Station code's could be queried against, to find out which are the supported stations check weatherAPI/Assets/stations.csv ii) nocache - by default if data is present in cache, will be returned but in case no cache is set to 1, it will fetch the latest weather data and update the cache.

Example:

Screen Shot 2022-04-10 at 3 04 59 PM

Querying first time, data gets stored in cache.

Screen Shot 2022-04-10 at 3 29 09 PM

Getting cached response from next time.

Screen Shot 2022-04-10 at 3 29 39 PM

Setting nocache=1 to get fresh data.

Project structure

Following is a breakdown of the project folder structure, along with use cases. weatherAPI directory holds,

  1. Assets - Will hold all the constants and fixture type data.
  2. Modules - Will hold all the buisness logic for the project.
  3. Serializers - Add all the Serializers here.
  4. Views - Client facing views to be defined here.

metarproject's People

Contributors

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