<commit_before><commit_msg>parses through hubway data and returns dictionary of trip durations<commit_after>"""
Main file for hubwayPredict project.
"""

from os import path
import ast
import matplotlib.pyplot as plt
from hubway_data_parsing import load_trips

def plot_duration(year):
	"""
	Plots duration of hubway rides in a bar chart.
	Input: year of data that gets graphed
	Output: bar chart of data
	"""
	
	data = load_trips(year)

	#creates dictionary counting frequency of each trip duration
	durations = {}
	for d in data:
		if d['duration'] not in durations:
			durations[d['duration']] = 1
		else:
			durations[d['duration']] += 1

	return durations

if __name__ == "__main__":
	print plot_duration(2013)
{'fraction_non_alphanumeric': 0.08671328671328671, 'fraction_numerical': 0.008391608391608392, 'mean_word_length': 4.774193548387097, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '25745', 'n_tokens_mistral': 239, 'n_tokens_neox': 221, 'n_words': 84}