Resources

Resources class

Module: asposeocr

Manage downloadable resources that enhance Aspose.OCR recognition capabilities.

Constructors

NameDescription
init

Methods

NameReturn TypeStaticDescription
allow_automatic_downloadsYesAllow (true) or block (false) automatic downloading of required resources from the online repository. By default, a resource is automatically downloaded when a method that depends on it is called.
fetch_allYesDownload all compatible resources from the online repository. The existing resource files will be overwritten.
fetch_resourcesYesDownload the resources specified in the names parameter from the online repository. If one or more resources are already downloaded, they will be overwritten. You can omit the .OCR extension and use file names only.
get_local_pathYesReturn the full path to the directory where the resources will be downloaded.
get_repositoryYesReturn the URL of the online repository from which Aspose.OCR resources are downloaded.
list_local[str]YesList all Aspose.OCR resources stored in the local directory.
list_remote[str]YesList all compatible resources from the online repository.
set_local_pathYesSpecify an absolute or relative path to the directory where the resources will be downloaded. Pass false to the create parameter to prevent the directory from being created automatically. If the provided directory does not exist and creation is not allowed, the resources will be loaded into the aspose_data directory in the application’s working directory.
set_repositoryYesSpecify the URL of the online repository from which Aspose.OCR resources will be downloaded. By default, the resources are downloaded from https://github.com/aspose-ocr/resources/.

Resources Constructor

__init__()

Resources.allow_automatic_downloads (static)

allow_automatic_downloads(bool allow)

Allow (true) or block (false) automatic downloading of required resources from the online repository. By default, a resource is automatically downloaded when a method that depends on it is called.

ParameterTypeDescription
allowboolBoolean value to allow or block automatic downloading of required resources.

Resources.fetch_all (static)

fetch_all()

Download all compatible resources from the online repository. The existing resource files will be overwritten.

Resources.fetch_resources (static)

fetch_resources([] names)

Download the resources specified in the names parameter from the online repository. If one or more resources are already downloaded, they will be overwritten. You can omit the .OCR extension and use file names only.

ParameterTypeDescription
names[]Array with resources names. See the ListRemote method.

Resources.get_local_path (static)

get_local_path()

Return the full path to the directory where the resources will be downloaded.

Resources.get_repository (static)

get_repository()

Return the URL of the online repository from which Aspose.OCR resources are downloaded.

Resources.list_local (static)

list_local() -> [str]

List all Aspose.OCR resources stored in the local directory.

Return Type: [str] — List all Aspose.OCR resources stored in the local directory.

Resources.list_remote (static)

list_remote() -> [str]

List all compatible resources from the online repository.

Return Type: [str] — List of resources names.

Resources.set_local_path (static)

set_local_path(str path, bool create)

Specify an absolute or relative path to the directory where the resources will be downloaded. Pass false to the create parameter to prevent the directory from being created automatically. If the provided directory does not exist and creation is not allowed, the resources will be loaded into the aspose_data directory in the application’s working directory.

ParameterTypeDescription
pathstrAbsolute or relative path to the directory.
createboolParameter to prevent the directory from being created automatically.

Resources.set_repository (static)

set_repository(str url)

Specify the URL of the online repository from which Aspose.OCR resources will be downloaded. By default, the resources are downloaded from https://github.com/aspose-ocr/resources/.

ParameterTypeDescription
urlstrURL of the online repository.