.. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_download_file.py: Downloading files and zipfiles ------------------------------ This example shows off how to download a file, and optionally unzip it. .. code-block:: default from download import download import matplotlib.pyplot as plt import pandas as pd import os.path as op from glob import glob import shutil as sh Downloading a file simply requires that you have a URL. .. code-block:: default url = "https://ndownloader.figshare.com/files/7010681" path = download(url, "./downloaded/boulder-precip.csv", replace=True) data = pd.read_csv(path) ax = data.plot("DATE", "PRECIP") ax.set(title="Precipitation over time in Boulder, CO") plt.setp(ax.get_xticklabels(), rotation=45) plt.tight_layout() .. image:: /gallery/images/sphx_glr_plot_download_file_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Downloading data from https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/7010681/precipboulderaugoct2013.csv (391 bytes) file_sizes: 0%| | 0.00/391 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_download_file.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_