nbodykit.tutorials.wget¶
Functions
Return a list of available example data files from the nbodykit data repository on NERSC. |
|
|
Download a data file from the nbodykit repository of example data. |
|
Mirror a URL recursively to a local target. |
|
Classes
|
Parses an HTML file and build a list of links. |
-
class
nbodykit.tutorials.wget.
ListingParser
(url)[source]¶ Parses an HTML file and build a list of links.
Links are stored into the ‘links’ set. They are resolved into absolute links.
Methods
check_for_whole_start_tag
(self, i)close
(self)Handle any buffered data.
feed
(self, data)Feed data to the parser.
get_starttag_text
(self)Return full source of start tag: ‘<…>’.
getpos
(self)Return current line number and offset.
goahead
(self, end)handle_charref
(self, name)handle_comment
(self, data)handle_data
(self, data)handle_decl
(self, decl)handle_endtag
(self, tag)handle_entityref
(self, name)handle_pi
(self, data)handle_startendtag
(self, tag, attrs)parse_bogus_comment
(self, i[, report])parse_comment
(self, i[, report])parse_declaration
(self, i)parse_endtag
(self, i)parse_html_declaration
(self, i)parse_marked_section
(self, i[, report])parse_pi
(self, i)parse_starttag
(self, i)reset
(self)Reset this instance.
unescape
(self, s)updatepos
(self, i, j)clear_cdata_mode
error
handle_starttag
set_cdata_mode
unknown_decl
-
close
(self)¶ Handle any buffered data.
-
feed
(self, data)¶ Feed data to the parser.
Call this as often as you want, with as little or as much text as you want (may include ‘n’).
-
get_starttag_text
(self)¶ Return full source of start tag: ‘<…>’.
-
getpos
(self)¶ Return current line number and offset.
-
reset
(self)¶ Reset this instance. Loses all unprocessed data.
-
-
nbodykit.tutorials.wget.
available_examples
()[source]¶ Return a list of available example data files from the nbodykit data repository on NERSC.
- Returns
examples – list of the available file names for download
- Return type
list
-
nbodykit.tutorials.wget.
download_example_data
(filenames, download_dirname=None)[source]¶ Download a data file from the nbodykit repository of example data.
For a list of valid file names, see
available_examples()
.- Parameters
filenames (str, list of str) – the name(s) of the example file to download (relative to the path of the nbodykit repository); see
available_examples()
for the example file namesdownload_dirname (str, optional) – a local directory to download the file to; if not specified, the file will be downloaded to the current working directory