Skip to main content
Version: 0.2.0

ServiceDownloader

ClassSource

service = ServiceDownloader(
service_name: str = "/dfc-downloader",
allowed_cross_origin: str | None = None,
)

Service provider for optional features of the downloader.

This instance provides some optional features required by the implementation of the downloader. The services of this instance do not handle any downloadable data.

Aliases

This class can be acquired by

import dash_file_cache as dfc


dfc.ServiceDownloader
dfc.services.ServiceDownloader
dfc.services.downloader.ServiceDownloader

Arguments

ArgumentTypeRequired
Description
service_namestrThe name of this service.
allowed_cross_originstr | NoneThe allowed cross origin when serving the data. The usage should be the same as "Access-Control-Allow-Origin". If this value is empty or None, the cross-origin will not be configured.

Methods

serve

service.serve(app: dash.Dash | flask.Flask, endpoint: str | None = None)

Add the service to the Flask application.

Requires

ArgumentTypeRequired
Description
appdash.Dash | flask.FlaskThe application where the services will be bound.
endpointstr | NoneThe endpoint of this serivce. If not specified, will use the service address to infer it.

Properties

allowed_cross_origin

allowed_cross_origin: str = service.allowed_cross_origin

The allowed cross origin. If this value is an empty string, the cross-origin data delivery will not be used.

Examples

See

Download file