copytrav package¶
Module contents¶
Copytrav provides the ability to create copies of python package data on disk.
- copytrav.copy(module, pth=None, dst=None, notop=False)[source]¶
Given a module in the form: ‘module.sub_module’, copy all items at the pth to the destination, dst. If no path given, the module from the root level is copied.
- Parameters:
module (
str
) – The path to (typically) the namespace module containing data in the example form “mymodule.data”.dst (
Path
) – Where you want the items copied to. Top-level dir is copied. If no dst is given, a temporary directory will be created.pth (
Path
) – Path in the example form “item_at_module_root/level/directory_or_file”.notop (
bool
) – If true, exclude the top-level directory from the copy.
- Return type:
Path
- Returns:
The path to the directory to which items were copied. If dst is given, this will simply be dst.