Skip to content

Commit

Permalink
add some examples for the documentation on the nb_fetch utility (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcky authored Aug 4, 2017
1 parent a82ba69 commit 08e634a
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion quantecon/util/notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def fetch_nb_dependencies(files, repo=REPO, raw=RAW, branch=BRANCH, folder=FOLDER, overwrite=False, verbose=True):
"""
Retrieve raw files from QuantEcon.notebooks or any other Github repo
Retrieve raw files from QuantEcon.notebooks or other Github repo
Parameters
----------
Expand All @@ -47,6 +47,30 @@ def fetch_nb_dependencies(files, repo=REPO, raw=RAW, branch=BRANCH, folder=FOLDE
overwrite bool, optional(default=False)
verbose bool, optional(default=True)
Examples
--------
Consider a notebook that is dependant on a ``csv`` file to execute. If this file is
located in a Github repository then it can be fetched using this utility
Assuming the file is at the root level in the ``master`` branch then:
>>> from quantecon.util import fetch_nb_dependencies
>>> status = fetch_nb_dependencies(["test.csv"], repo="https://<github_address>")
More than one file may be requested in the list provided
>>> status = fetch_nb_dependencies(["test.csv", "data.csv"], repo="https://<github_address>")
A folder location can be added using ``folder=``
>>> status = fetch_nb_dependencies("test.csv", report="https://<github_address>", folder="data")
You can also specify a specific branch using ``branch=`` keyword argument.
This will download the requested file(s) to your local working directory. The default
behaviour is **not** to overwrite a local file if it is present. This can be switched off
by setting ``overwrite=True``.
"""

#-Generate Common Data Structure-#
Expand Down

0 comments on commit 08e634a

Please sign in to comment.