Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notebook autosetup and fetch utility for notebooks ... #217

Merged
merged 3 commits into from
Jan 7, 2016

Conversation

mmcky
Copy link
Contributor

@mmcky mmcky commented Jan 5, 2016

This PR adds a simple utility for fetching dependencies (*.py) and data files (*.csv) from a GitHub repository. The defaults are set for use with QuantEcon.notebooks.

Example

from quantecon import fetch_nb_dependencies
fetch_nb_dependencies(["Wald_Friedman_utils.py"])

but can be used with other repositories or branches etc.

#-Remote Structure-#
REPO = "https://github.com/QuantEcon/QuantEcon.notebooks"
RAW = "raw"
BRANCH = "master"
DEPS = "dependencies"          #Hard Coded Dependencies Folder on QuantEcon.notebooks

def fetch_nb_dependencies(files, repo=REPO, raw=RAW, branch=BRANCH, deps=DEPS, verbose=True):
    """
    Retrieve raw files from QuantEcon.notebooks Github repo

    Parameters
    ----------
    file_list   list or dict
                A list of files to specify a collection of filenames
                A dict of dir : list(files) to specify a directory
    repo        str, optional(default=REPO)
    branch      str, optional(default=BRANCH)
    deps        str, optional(default=DEPS)
    verbose     bool, optional(default=True)

    TODO
    ----
    1. Should we update this to allow people to specify their own folders on a different GitHub repo?

    """

This will download the file from GitHub (QuantEcon.notebooks/master/dependencies/) directly - allowing a notebook to be run anywhere. This can also be done with data files etc.

mmcky added a commit that referenced this pull request Jan 7, 2016
Add notebook autosetup and fetch utility for notebooks ...
@mmcky mmcky merged commit f7d4f2c into master Jan 7, 2016
@mmcky mmcky deleted the add-notebook-autosetup branch January 7, 2016 16:17
@oyamad oyamad mentioned this pull request Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant