This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / lib / _datasource / Repository

class

numpy.lib._datasource:Repository

source: build-install/usr/lib/python3.14/site-packages/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 : str

Path to the local directory or remote location that contains the data files.

destpath : str or None, optional

Path to the directory where the source file gets downloaded to for use. If destpath is 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()
Similarly you could use a URL for a repository::
repos = np.lib._datasource.Repository('http://www.xyz.edu/data')

Aliases

  • numpy.lib._datasource.Repository