bundles / numpy 2.4.4 / numpy / lib / _datasource / Repository / open
function
numpy.lib._datasource:Repository.open
source: /numpy/lib/_datasource.py :650
Signature
def open ( self , path , mode = r , encoding = None , newline = None ) Summary
Open and return file-like object prepending Repository base URL.
Extended Summary
If path is an URL, it will be downloaded, stored in the DataSource directory and opened from there.
Parameters
path: str or pathlib.PathLocal file path or URL to open. This may, but does not have to, include the
baseurlwith which the Repository was initialized.mode: {'r', 'w', 'a'}, optionalMode to open
path. Mode 'r' for reading, 'w' for writing, 'a' to append. Available modes depend on the type of object specified bypath. Default is 'r'.encoding: {None, str}, optionalOpen text file with given encoding. The default encoding will be what open uses.
newline: {None, str}, optionalNewline to use when reading text file.
Returns
out: file objectFile object.
Aliases
-
numpy.lib._datasource.Repository.open