Giter VIP home page Giter VIP logo

vivaan998 / django-metar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 789 KB

This is a REST API developed using Python Django Rest Framework to fetch meta data by scraping data based on the metar code provided from the UI. Using redis to store cache for fast loading and fetching data for same code from cache instead of scraping again.

Python 63.99% HTML 36.01%
cache-control crud-application django-rest-framework python3 redis scraping-python

django-metar's Introduction

Django Project to get Meta data about Metar codes and display information.

Requirements

This Project is developed using Django and Redis . Additional requirements are included in requirement.txt file for interaction with https://tgftp.nws.noaa.gov/data/observations/metar/stations/ website.

Also change the Redis_HOST and Redis_PORT in the settings.py if deploying on any other server.
The Project uses Redis, Web Drivers, Selenium and such libraries to develop the application.

This application is developed and tested well in Windows Environment. While instaling or running the app locally, if there occurs any error because of versioning, feel free to ping me on [email protected]

How to run project locally

Clone repository and got to project's root directory afterwards follow steps:

  1. Activate python virtual environment
    source /path/to/local/env

  2. Install requirements
    pip install -r requirements.txt

  3. Run Redis server
    Dowload it from the https://redis.io/ based on your system requirements
    Refer to https://redis.io/topics/quickstart for installation guide.

Once the redis file has be installed extract it and open the terminal and run the following command to run server redis-server

To check if it responds to client open a new terminal and run redis client ping this command returns "Pong".

Congratulations! Your redis server has been served

  1. Now, Run server
    python manage.py runserver

Results

GET /

Has the frontend of the search. The button in the header part checks Status of Redis Server.

GET /metar/ping

This checks if the Redis server is live or not,If not, it returns Connection refused else returns

{
    "data": "Pong"
}

GET /metar/info?scode=

Fetches metar code from the url and checks if the metar code exists, if not it returns "Metar Code Dosen't Exsits"

On re-visiting the same code again, the data is fetched from the Redis-cache for lower latency and faster loading process.


Currently the Cache Time to Leave for the code/view to be deleted is set to be 5 minutes, mentioned in settings.py file.

For Instance look at the images below for better Visualization and Understanding

Alt-Text


Alt-Text

django-metar's People

Contributors

vivaan998 avatar

Stargazers

Rudy Hendrawan 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.