Source

yrsdata / data4.py

Full commit
# Example of using Requests to download CSV data from a URL
# and the standard library's csv module to process each record

import csv
import requests

url = 'http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M5.txt'

response = requests.get(url)
reader = csv.reader(response.iter_lines())

for record in reader:
    print(record)