Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103225

Re: downloading a CSV

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Subject Re: downloading a CSV
Date Fri, 19 Feb 2016 16:03:23 -0500
Lines 24
Message-ID <mailman.62.1455915805.2289.python-list@python.org> (permalink)
References <1efa02db-a26a-44bd-a0ea-db81e612ccd6@googlegroups.com> <7abe9082-2720-439e-b592-432cf842874b@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de q7Za6puw953bbLd422Q6jQi6LzjeVvUI5BurAfonTNvw==
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.038
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'subject:CSV': 0.09; 'python': 0.10; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'urllib': 0.16; 'wrote:': 0.16; 'skip:u 30': 0.18; 'email addr:gmail.com&gt;': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'feb': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'requests': 0.25; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'url:gov': 0.27; 'party,': 0.29; 'url:mailman': 0.30; 'url:python': 0.33; 'third': 0.33; 'url:listinfo': 0.34; 'thanks!': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'library.': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'url:mail': 0.40; 'skip:u 10': 0.61; 'more': 0.63; 'url:0': 0.63; 'url:info': 0.71; 'url:v1': 0.84; 'to:none': 0.91; 'joel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=qFMTrilYjM0XXuO9AQJdKaqQYEiKxTsuyQkuG+Kb/rg=; b=bBrOaM7gj2LEMwm3GK20BgQUUj3r02lckeJ4RJhjtm+4gmm8111tz0S6P8Ulf9z5YH XQqXyg4IqAepR8QfBmiHb06aOUid5qXYw15q/Gqi5NtNIaz0rk0+ALnYO3EojbYN4vLQ 040X39kJDGjVuOLS8sMjkT5Ow36iPLn6h+3gO+52B1WfWaNAjlxPazJFyAtKFSVbXrui tauubAiz13ELUFq0L1XLLW+0p9FyOVT/v05JXeEp1m0y+Rc9qLHEpIDjOCyyhgL8BfPg j+oIiIA9JVd6MrftrDGH0/iMLCUHq+dlKHteAEEhKCCLAtOBZOEAADuJgr7/KMMdBHTp Tllg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=qFMTrilYjM0XXuO9AQJdKaqQYEiKxTsuyQkuG+Kb/rg=; b=GThy0xzzuznWYvJ3LXontuDfumB16La2wn77+hjXlN1JLKysuTzxIvPQZH9K1oCeap AgnB2NqhHP+elj3mMUUVS71sKGeYr/DkJcZJ+i1QwMUEaYbBeZWkrBr480I4c925U5WE 4IqYfd4B3+ji8KdAP0+p2DqsbVNWp9c76t118XGPnlRgAsIKJhS7pfYN3442vbLLBHLr XHwG4KCSe542M0ouUwZpoDK+wnxysbULZNkkoFhO4frsE9PGX5czjex411VZ6qyPTDsw +2AfFYO6uKoAJ4tLfTM5CdbNPXXt2qKV0kFixC3ZLSLQzNVHkmW435HIH21qwvmT9S71 twRw==
X-Gm-Message-State AG10YOTXHiu7mH1pUZuwmuF5TFzyzJYAdQReHB0GjDLDUjebPFbVqPmDwd++Aat2rAdnurZcy4TZQFe82u4Eug==
X-Received by 10.50.79.196 with SMTP id l4mr11515037igx.11.1455915803189; Fri, 19 Feb 2016 13:03:23 -0800 (PST)
In-Reply-To <7abe9082-2720-439e-b592-432cf842874b@googlegroups.com>
X-Content-Filtered-By Mailman/MimeDel 2.1.21rc2
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21rc2
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:103225

Show key headers only | View raw


On Fri, Feb 19, 2016 at 3:05 PM, noydb <jenn.duerr@gmail.com> wrote:

> Thanks!  That was pretty easy.
>
> import urllib.request
> url = '
> http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv'
> urllib.request.urlretrieve(url, csv_file)
> csv_file = r"C:\Temp\earthquakeAll_last30days.csv"
> urllib.request.urlretrieve(url, csv_file)
>
> I do want to use python -- there's much more I need to do with the file
> after downloading.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

You might look at the Requests library.  Its third party, but easier to
understand and use than urllib

-- 
Joel Goldstick
http://joelgoldstick.com/ <http://joelgoldstick.com/stats/birthdays>
http://cc-baseballstats.info/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

downloading a CSV noydb <jenn.duerr@gmail.com> - 2016-02-19 10:46 -0800
  Re: downloading a CSV MRAB <python@mrabarnett.plus.com> - 2016-02-19 19:24 +0000
  Re: downloading a CSV Grant Edwards <invalid@invalid.invalid> - 2016-02-19 19:43 +0000
  Re: downloading a CSV noydb <jenn.duerr@gmail.com> - 2016-02-19 12:05 -0800
    Re: downloading a CSV Joel Goldstick <joel.goldstick@gmail.com> - 2016-02-19 16:03 -0500
  Re: downloading a CSV Tim Chase <python.list@tim.thechases.com> - 2016-02-19 18:47 -0600

csiph-web