bundles / numpy 2.4.4 / numpy / lib / _datasource / Repository
class
numpy.lib._datasource:Repository
source: /numpy/lib/_datasource.py :532
Signature
class Repository ( baseurl , destpath = . ) Members
Summary
A data repository where multiple DataSource's share a base URL/directory.
Extended Summary
Repository extends DataSource by prepending a base URL (or directory) to all the files it handles. Use Repository when you will be working with multiple files from one base URL. Initialize Repository with the base URL, then refer to each file by its filename only.
Parameters
baseurl: strPath to the local directory or remote location that contains the data files.
destpath: str or None, optionalPath to the directory where the source file gets downloaded to for use. If
destpathis None, a temporary directory will be created. The default path is the current directory.
Examples
To analyze all files in the repository, do something like this (note: this is not self-contained code)::repos = np.lib._datasource.Repository('/home/user/data/dir/')
✓for filename in filelist: fp = repos.open(filename) fp.analyze() fp.close()⚠
repos = np.lib._datasource.Repository('http://www.xyz.edu/data')
✓Aliases
-
numpy.lib._datasource.Repository