Git Product home page Git Product logo

bike-report's Introduction

NYC CitiBike Reporting

Downloads historical data for CitiBike stations, and comes with a set of scripts that can be run to generate various reports. Write-ups:

Non-technical walkthrough

As noted on their data page, Citi Bike publishes a feed of their station information. This data is delivered in a popular format called JSON, and includes the intersection and coordinates of each of their 300+ stations, as well as the number of available bikes and the station capacity. A friend of mine, Abe Stanway, set up a system to request and store that data. It has been running for months, and he made that historical data public.

After my scraping (a.k.a. data collector) script (a.k.a. code) retrieves the list of stations, it retrieves and stores the historical data for the past week (over three million records) in a local database. I then run another script to aggregate the data. Each station has one data point per second saying how many bikes it has available, so the query is essentially asking "for each station, how much of the time were there fewer than two bikes available, and how much of the time were there fewer than two docks open?" The results get exported into a CSV, which is available on Google Docs.

Usage

First, run the initial setup:

bundle
bundle exec ruby scrape.rb

The data will then be loaded into a SQLite3 database, data.db. You can explore it with sqlite3 data.db. To run a particular report:

bundle exec ruby reports/REPORT_NAME.rb

For example (8/22/13-8/29/13):

Frequently Empty/Full Stations

See all of them here.

Resources

Thanks

Special thanks to HowAboutWe for sponsoring a refresh of the work.

bike-report's People

Contributors

afeld avatar

Stargazers

Michael Marich avatar  avatar Maxim Zaslavsky avatar Scott Opell avatar Noel Hidalgo avatar Yamil Medina avatar Craig Spaeth avatar Vlad Vinnikov avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

mmarich1

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.