fastoad.utils.resource_management.copy module

Helper module for copying resources

fastoad.utils.resource_management.copy.copy_resource(package: Union[module, str], resource: str, target_path)[source]

Copies the indicated resource file to provided target path.

If target_path matches an already existing folder, resource file will be copied in this folder with same name. Otherwise, target_path will be the used name of copied resource file

Parameters
  • package – package as in importlib.resources.read_binary()

  • resource – resource as in importlib.resources.read_binary()

  • target_path – file system path

fastoad.utils.resource_management.copy.copy_resource_folder(package: Union[module, str], destination_path: str, exclude: List[str] = None)[source]

Copies the full content of provided package in destination folder.

Names of files that should not be copied have to be listed in exclude.

Warning

As the resources in the folder are discovered by browsing through the folder, they are not explicitly listed in the Python code. Therefore, to have the install process run smoothly, these resources need to be listed in the MANIFEST.in file.

Parameters
  • package – name of resource package to copy

  • destination_path – file system path of destination

  • exclude – list of item names that should not be copied