Giter VIP home page Giter VIP logo

mp-transportation-analysis's Introduction

MP-Transportation-Analysis

Introduction

This project is used to scrape and gather data related MP Transportation. Everything was handled with the help of python programming language. For graph, data and content visit link.

AIM

Our aim is to gather as much data as possible from a given website and use it to analyze and then compare it. For data we used this http://mis.mptransport.org/MPLogin/eSewa/VehicleSearch.aspx site to scrape it.

NOTE: It's not recommended to scrape this site all of sudden. It was used to test my knowledge and also to gain data.

How data is obtained?

Since the data related MP transportation was public so we used the given URL and scrape it. For scraping, python language used. It first select the field of registration number and then inputs 0000, 0001 ... 9999 just like this.

Technical details

Python version | Python 2.7.6

Scrapy

Whole program was successful because of scrapy project. We used this to create one spider.

Scrapinghub

Spider was later deployed to scrapinghub to start our spider on server and start scraping it. Reason is pretty obvious because we are dealing with 10 millions of data. With single laptop it will take approx 1 month 5 days so to fasten this process we used scrapinghub.com 4 units and then scraped data.

Plotly

All the graph was plotted with help of plotly. I used plotly module to create few offline graphs and then later made them public through online tools.

Python module - ijson

Also to read data ijson module was used which iterates over JSON data. We used this because loading JSON data in python program takes so much of memory.

How to use?

At first you need to clone this repository to your local machine

git clone https://github.com/shashank-sharma/MP-Transportation-Analysis

After that move to the MP-Transportation-Analysis directory by cd and then install scrapinghub toolbelt.

pip install shub

If you find any error then install this in virtual environment.

After installing create an account in scrapinghub.com and just after that create one project by using Scrapy tool. After creating you will be redirected to new window. Now go to deploy option in left side bar menu and there at down you will see project id and API key just save them.

Now again switch to terminal and type 'shub deploy' and then enter all the details which is needed and then your project will be deployed to the scrapinghub.com. Now go to dashboard and Run it. Then it will start scraping.

For free version you might need to set some range from 0 - 1001 because max time your process will run is for 24 hours. So you might need to run your program 10 times with different range

Data analysis

To load up data we used the JSON format rather than .db or .sql because converting JSON to these format may take 20+ days continuous operation which is not possible to handle by the system so we used Python and then used ijson value to iterate over JSON values and then counted it.

mp-transportation-analysis's People

Contributors

shashank-sharma avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mythicalss

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.