Back to bricks list
Introduction Getting Started
Architecture
Technical Documentation
Other Classes
AbstractDbManager AgentFactory AudioView AuthService BadRequestException BarPlotView Base BaseEnvShell BaseHTTPException BaseModelDTO BaseTestCase BaseTestCaseLight BashCodeParam BoolParam BoolRField BoolValidator BoxPlotView BrickMigration BrickService CheckBeforeTaskResult CommunityService Compress CondaShellProxy Config ConfigParams Connector ConnectorPartSpec ConnectorSpec ConverterRunner Credentials CredentialsDataBasic CredentialsDataLab CredentialsDataOther CredentialsDataS3 CredentialsParam CredentialsType CurrentUserService Dashboard DashboardType DataframeAggregatorHelper DataframeDataFilterHelper DataframeFilterHelper DataFrameRField DataframeScalerHelper datetime DateTimeUTC DbConfig DictRField DictValidator DispatchedMessage DynamicInputs DynamicOutputs EntityNavigator EntityNavigatorNote EntityNavigatorResource EntityNavigatorScenario EntityNavigatorService EntityNavigatorView EntityTag EntityType Enum ExceptionHandler ExceptionResponse ExpressionBuilder ExternalApiService ExternalSpaceCreateFolder FileDownloader FileHelper FileRField FloatParam FloatRField FloatValidator ForbiddenException FrontService FrontTheme FSNodeModel FsNodeService GwsCorePackages GWSException GzipCompress HeatmapView HistogramView ImageView InPort Inputs InputSpec InputSpecs InterfaceSpec IntParam IntRField IntValidator IO IOface Job JsonCodeParam JSONField JSONView JuliaCodeParam KVStore LazyViewParam LinePlot2DView ListParam ListRField ListValidator Logger LoggerMessageObserver MailService MambaShellProxy MessageDispatcher MessageLevel MessageObserver Model ModelRfield ModelService Monitor MonitorService MultiViews NetworkView Note Notebook NoteParam NoteSearchBuilder NoteService NoteTemplate NoteTemplateParam NoteTemplateService NotFoundException NumericHelper NumericParam NumericValidator OpenAiChat OpenAiChatMessage OpenAiChatParam OpenAiHelper OutPort Outputs OutputSpec OutputSpecs PackageHelper Paginator ParamSet ParamSpec PerlCodeParam PipShellProxy PlotlyRField PlotlyView PoolDb Port PrimitiveRField Process ProcessFactory ProcessModel ProcessProxy ProcessSpec ProgressBar ProgressBarMessageObserver ProgressBarService ProtocolModel ProtocolProxy ProtocolService ProtocolTyping PythonCodeParam Queue QueueService RCodeParam Requests ResourceDownloaderBase ResourceModel ResourceOrigin ResourceRField ResourceSearchBuilder ResourceService ResourceTransfertService ResourceTyping RField RichText RichTextBlock RichTextBlockModificationDTO RichTextBlockModificationWithUserDTO RichTextBlockType RichTextDTO RichTextFigureData RichTextFileData RichTextFormulaData RichTextListData RichTextListItem RichTextModificationDifferenceDTO RichTextModificationsDTO RichTextModificationType RichTextNoteResourceViewData RichTextObjectType RichTextParagraphData RichTextParagraphHeaderData RichTextParagraphHeaderLevel RichTextParagraphListData RichTextParagraphListItemData RichTextParagraphText RichTextResourceViewData RichTextTimestampData RichTextUserDTO RichTextVariableData RichTextView RichTextViewFileData S3Bucket ScatterPlot2DView Scenario ScenarioCreationType ScenarioProcessStatus ScenarioProxy ScenarioRunService ScenarioSaveDTO ScenarioSearchBuilder ScenarioService ScenarioStatus ScenarioTemplate ScenarioTemplateFactory ScenarioTransfertService SearchBuilder SerializableObjectJson SerializableRField Settings ShellProxy ShellProxyFactory SimpleTextView SpaceFolder SpaceService SqlMigrator StackedBarPlotView StreamlitApp StreamlitAppManager StreamlitProcess StringHelper StrParam StrRField StrValidator SysProc TableAnnotatorHelper TableColumnSelector TableColumnTagToRowExtractor TableColumnTagUnfolder TableConcatHelper TableHeaderInfo TableOperationHelper TableRowSelector TableRowTagToColumnExtractor TableRowTagUnfolder TableScalerHelper TableTagAggregatorHelper TableUnfolderHelper TableView TabularView Tag TagHelper TagKeyModel TagList TagService TagsParam TagValueModel TarCompress TarGzCompress TaskFileDownloader TaskHelper TaskInputs TaskModel TaskProxy TaskRunner TaskService TaskTyping TechnicalInfo TextParam TextView TextViewData Typing TypingDeprecated TypingIconColor TypingIconType TypingManager TypingStyle UnauthorizedException URLValidator User UserCredentialsDTO UserGroup UserService Utils UUIDRField Validator VennDiagramView Version View ViewConfig ViewTester ViewType YamlCodeParam ZipCompress
Version

FileDownloader

Class to downloader external files. for now it only supports http(s) protocol. If a message dispatcher is provided, it will automatically log the download progress and the time it took to download the file.

Attributes
destination_folder: strmessage_dispatcher: MessageDispatcher
Functions
__INIT__

Initialize self. See help(type(self)) for accurate signature.

Parameters:
NameTypeDefault valueDescription
destination_folderstr
message_dispatcherMessageDispatcher
DECOMPRESS_FILE

Unzip a file to a given path

Parameters:
NameTypeDefault valueDescription
file_pathstr The path to the file to unzip ``
destination_folderstr
Return type:
str
DOWNLOAD_FILE

Download a file from a given url to a given file path

Parameters:
NameTypeDefault valueDescription
urlstr The url to download the file from ``
filenamestr
headersDict The headers to send with the request `dict`
timeoutfloat The timeout for the request ``
destination_folderstr The destination folder to save the file to, if none, the default destination folder is used ``
Return type:
str
DOWNLOAD_FILE_IF_MISSING

Download a file from a given url if the file does not already exist. This class is useful for downloading a file that is required for a task. If used within a task, it automatically logs the download progress and the time it took to download the file.

             tries to download a file with the same name, it considers that the file has already been downloaded
             and will not download it. If you want to force the download of a file (new version for example), change the filename (adding v2 for example).
Parameters:
NameTypeDefault valueDescription
urlstr Url to download the file from
filenamestr Name of the file once downloaded. this filename must be unique for the brick. if a file downloader
headersDict Http header to attach to the download request, defaults to none [str, str], optional
timeoutfloat Timeout of the download request, defaults to none , optional
decompress_filebool False If true the file is decompress (support .zip and .tar.gz) after the download and the zip file is deleted, defaults to false , optional
Return type:
str