sieve.File
Overview
sieve.File
is a utility class that helps with handling files that are inputs to a function
, produced locally in the file system, or downloaded from an external url. The underlying contents in a sieve.File
are backed by Sieve’s file servers and are downloaded lazily, meaning that they will not download the content until requested with the path
property. This means that a sieve.File
can be passed around to different functions efficiently without having to deal with network overhead, allowing for more efficnient applications.
A type that represents a file.
Constructor Optional Arguments
url
(str): The URL of the file to download.path
(str): The local path to the file.
A File
can be instantiated in two ways, either by providing a local file path, or an external url. You can either pass them in as positional arguments or as keyword arguments to path or url.
Properties
url
The url of the file, if it exists. This will return None if the file refers to something on the local filesystem.
The local path to the file. This will download the file if it is not downloaded already, and return the path of the downloaded file.
Was this page helpful?