GridFTP¶
gridftp interface
- iceprod.core.gridftp.listify(lines, details=False, dotfiles=False)[source]
Turn ls output into a list of NamedTuples
- class iceprod.core.gridftp.GridFTP[source]
GridFTP interface to command line client.
Example
- GridFTP.get(‘gsiftp://data.icecube.wisc.edu/file’,
filename=’/path/to/file’)
- classmethod supported_address(address)[source]
Return False for address types that are not supported
- classmethod address_split(address)[source]
Split an address into server/path parts
- classmethod get(address, filename=None, request_timeout=None)[source]
Do a GridFTP get request.
Either data is returned directly or filename must be defined.
- classmethod put(address, data=None, filename=None, request_timeout=None)[source]
Do a GridFTP put request.
Either data or filename must be defined.
- classmethod list(address, request_timeout=None, details=False, dotfiles=False)[source]
Do a GridFTP list request.
- classmethod mkdir(address, request_timeout=None, parents=False)[source]
Make a directory on the ftp server.
- classmethod rmdir(address, request_timeout=None)[source]
Remove a directory on the ftp server.
This fails if the directory is not empty. Use
rmtree()
for recursive removal.
- classmethod delete(address, request_timeout=None)[source]
Delete a file on the ftp server.
- classmethod rmtree(address, request_timeout=None)[source]
Delete a file or directory on the ftp server.
This is recursive, like rm -rf.
- classmethod move(src, dest, request_timeout=None)[source]
Move a file on the ftp server.
- classmethod exists(address, request_timeout=None)[source]
Check if a file exists on the ftp server.
- classmethod chmod(address, mode, request_timeout=None)[source]
Chmod a file on the ftp server.
- classmethod size(address, request_timeout=None)[source]
Get the size of a file on the ftp server.
- classmethod md5sum(address, request_timeout=None)[source]
Get the md5sum of a file on an ftp server.
- classmethod sha1sum(address, request_timeout=None)[source]
Get the sha1sum of a file on an ftp server.
- classmethod sha256sum(address, request_timeout=None)[source]
Get the sha256sum of a file on an ftp server.