# creates, uploads, downloads, extracts and copies archives (zip, tar ...)
```python
pip install downloadunzip
```
```python
from downloadunzip import extract,copy_folder_to_another_folder,zip_folder,download_and_extract
filepath = r"C:\Users\hansc\Downloads\ripgrep-13.0.0-x86_64-pc-windows-msvc.zip"
dest_dir = r"C:\Users\hansc\Downloads\test2xxxx"
extractedzipfiles = extract(filepath, dest_dir)
print(extractedzipfiles)
folder, results = copy_folder_to_another_folder(
src=dest_dir, dest="e:\\testcopy", allowed_extensions=(), maxsubfolders=1
)
print(folder)
print(results)
foldertmp, resultstmp = copy_folder_to_another_folder(
src=dest_dir, dest=None, allowed_extensions=(), maxsubfolders=1
)
print(foldertmp)
print(resultstmp)
zipfile, url = zip_folder(
srcdir=r"C:\Users\hansc\Downloads\test2xxx\ripgrep-13.0.0-x86_64-pc-windows-gnu",
destfile=r"C:\Users\hansc\Downloads\zippedfile.zip",
allowed_extensions=("exe",),
maxsubfolders=-1,
upload=False,
password=None,
maxdownloads=100000,
)
print(zipfile)
print(url)
zipfile, url = zip_folder(
srcdir=r"C:\Users\hansc\Downloads\test2xxxx\ripgrep-13.0.0-x86_64-pc-windows-msvc",
destfile=r"C:\Users\hansc\Downloads\zippedfile2.zip",
allowed_extensions=(),
maxsubfolders=-1,
upload=True,
password=None,
maxdownloads=100000,
)
print(zipfile)
print(url)
diditwork = download_and_extract(
url=r"https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep-13.0.0-x86_64-pc-windows-msvc.zip",
folder="e:\\testdownl",
)
print(diditwork)
[files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='COPYING', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='LICENSE-MIT', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='README.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='rg.exe', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe', ext='.exe'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='UNLICENSE', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='rg.bash', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\rg.bash', ext='.bash'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='rg.fish', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\rg.fish', ext='.fish'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='_rg', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\_rg', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='_rg.ps1', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\_rg.ps1', ext='.ps1'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='CHANGELOG.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\CHANGELOG.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='FAQ.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\FAQ.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='GUIDE.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\GUIDE.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='COPYING', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='LICENSE-MIT', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='README.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='rg.exe', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe', ext='.exe'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='UNLICENSE', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='rg.bash', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\rg.bash', ext='.bash'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='rg.fish', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\rg.fish', ext='.fish'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='_rg', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\_rg', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='_rg.ps1', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\_rg.ps1', ext='.ps1'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='CHANGELOG.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\CHANGELOG.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='FAQ.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\FAQ.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='GUIDE.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\GUIDE.md', ext='.md')]
e:\testcopy
[(True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE')]
C:\Users\hansc\AppData\Local\Temp\tmpx7r88ose
[(True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE')]
C:\Users\hansc\Downloads\zippedfile.zip
None
C:\Users\hansc\Downloads\zippedfile2.zip
https://transfer.sh/A3iiQ4/zippedfile2.zip
True
[files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='COPYING', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='LICENSE-MIT', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='README.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='rg.exe', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe', ext='.exe'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='UNLICENSE', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='rg.bash', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\rg.bash', ext='.bash'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='rg.fish', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\rg.fish', ext='.fish'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='_rg', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\_rg', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete', file='_rg.ps1', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\complete\\_rg.ps1', ext='.ps1'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='CHANGELOG.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\CHANGELOG.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='FAQ.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\FAQ.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc', file='GUIDE.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\doc\\GUIDE.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='COPYING', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='LICENSE-MIT', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='README.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='rg.exe', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe', ext='.exe'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='UNLICENSE', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='rg.bash', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\rg.bash', ext='.bash'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='rg.fish', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\rg.fish', ext='.fish'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='_rg', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\_rg', ext=''), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete', file='_rg.ps1', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\complete\\_rg.ps1', ext='.ps1'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='CHANGELOG.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\CHANGELOG.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='FAQ.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\FAQ.md', ext='.md'), files(folder='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc', file='GUIDE.md', path='C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\doc\\GUIDE.md', ext='.md')]
e:\testcopy
[(True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe'), (True, 'e:\\testcopy\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE')]
C:\Users\hansc\AppData\Local\Temp\tmp6sl3v7v6
[(True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\COPYING'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\LICENSE-MIT'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\README.md'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\rg.exe'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\UNLICENSE'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\COPYING'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\LICENSE-MIT'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\README.md'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\rg.exe'), (True, 'C:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\UNLICENSE')]
C:\Users\hansc\Downloads\zippedfile.zip
None
C:\Users\hansc\Downloads\zippedfile2.zip
https://transfer.sh/EjUBrS/zippedfile2.zip
True
```
```python
copy_folder_to_another_folder(src: str, dest: Optional[str] = None, allowed_extensions: tuple = (), maxsubfolders: int = -1) -> Tuple[str, list]
Copies all files and folders from the source folder to the destination folder.
If the destination folder is not specified, a temporary folder is created.
Only files with allowed extensions are copied if specified.
The maximum number of subfolders to copy can be specified.
Args:
- src (str): The path of the source folder to copy from.
- dest (Union[str, None], optional): The path of the destination folder to copy to. Defaults to None.
- allowed_extensions (tuple, optional): A tuple of allowed file extensions to copy. Defaults to () (all files allowed).
- maxsubfolders (int, optional): The maximum number of subfolders to copy. Defaults to -1 (all subfolders).
Returns:
- Tuple[str, list]: A tuple containing the path of the destination folder and a list of tuples.
Each tuple in the list contains a boolean value indicating whether the file was successfully copied and the path of the copied file.
download_and_extract(url: str, folder: str, *args, **kwargs) -> bool
Downloads a file from the given URL and extracts it to the specified folder.
Args:
url (str): The URL of the file to download.
folder (str): The folder to extract the downloaded file to.
*args: Additional positional arguments to pass to the requests.get() function.
**kwargs: Additional keyword arguments to pass to the requests.get() function.
Returns:
bool: True if the file was downloaded and extracted successfully, False otherwise.
extract(filepath: str, dest_dir: str) -> list
Extracts the contents of a compressed file to a specified directory.
Args:
filepath (str): The path to the compressed file.
dest_dir (str): The path to the directory where the contents will be extracted.
Returns:
list: A list of complete file paths for all files extracted.
Raises:
OSError: If the destination directory cannot be created.
Exception: If the file cannot be extracted using any of the available formats.
find_same_common_folder(files)
get_tmpfile(suffix='.bin')
iter_find_same_beginning_elements(iters)
tempfolder()
upload_file_to_transfer(filepath: str, password: Optional[str] = None, maxdownloads: int = 100000) -> str
vartolist(regular_expressions)
zip_folder(srcdir: str, destfile: str, allowed_extensions: tuple = (), maxsubfolders: int = -1, upload: bool = False, password: Optional[str] = None, maxdownloads: int = 100000) -> Tuple[str, Optional[str]]
Compresses the contents of a source directory into a ZIP file and saves it to a destination file.
If specified, uploads the ZIP file to a file transfer service and returns a download link.
Args:
srcdir (str): The path to the source directory to be compressed.
destfile (str): The path to the destination file where the ZIP file will be saved.
allowed_extensions (tuple, optional): A tuple of file extensions to include in the ZIP file. Defaults to ().
maxsubfolders (int, optional): The maximum number of subfolders to include in the ZIP file. Defaults to -1 (no limit).
upload (bool, optional): Whether to upload the ZIP file to a file transfer service. Defaults to False.
password (Union[None, str], optional): The password to protect the ZIP file with. Defaults to None.
maxdownloads (int, optional): The maximum number of times the uploaded file can be downloaded. Defaults to 100000.
Returns:
Tuple[str, Union[None, str]]: A tuple containing the path to the saved ZIP file and, if uploaded, a download link.
Raises:
OSError: If the destination file cannot be created or removed.
Exception: If a file cannot be removed after being added to the ZIP file.
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/downloadunzip",
"name": "downloadunzip",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "zip,tar.gz,pack,unpack",
"author": "Johannes Fischer",
"author_email": "<aulasparticularesdealemaosp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ea/8f/fb8fbbb5f42e13e41987cb55eb6934dffd970c00efa2bc74bdc3da117c37/downloadunzip-0.10.tar.gz",
"platform": null,
"description": "\r\n# creates, uploads, downloads, extracts and copies archives (zip, tar ...)\r\n\r\n\r\n\r\n\r\n\r\n```python\r\n\r\npip install downloadunzip\r\n\r\n```\r\n\r\n\r\n\r\n```python\r\n\r\nfrom downloadunzip import extract,copy_folder_to_another_folder,zip_folder,download_and_extract\r\n\r\nfilepath = r\"C:\\Users\\hansc\\Downloads\\ripgrep-13.0.0-x86_64-pc-windows-msvc.zip\"\r\n\r\ndest_dir = r\"C:\\Users\\hansc\\Downloads\\test2xxxx\"\r\n\r\nextractedzipfiles = extract(filepath, dest_dir)\r\n\r\nprint(extractedzipfiles)\r\n\r\nfolder, results = copy_folder_to_another_folder(\r\n\r\n src=dest_dir, dest=\"e:\\\\testcopy\", allowed_extensions=(), maxsubfolders=1\r\n\r\n)\r\n\r\nprint(folder)\r\n\r\nprint(results)\r\n\r\nfoldertmp, resultstmp = copy_folder_to_another_folder(\r\n\r\n src=dest_dir, dest=None, allowed_extensions=(), maxsubfolders=1\r\n\r\n)\r\n\r\nprint(foldertmp)\r\n\r\nprint(resultstmp)\r\n\r\nzipfile, url = zip_folder(\r\n\r\n srcdir=r\"C:\\Users\\hansc\\Downloads\\test2xxx\\ripgrep-13.0.0-x86_64-pc-windows-gnu\",\r\n\r\n destfile=r\"C:\\Users\\hansc\\Downloads\\zippedfile.zip\",\r\n\r\n allowed_extensions=(\"exe\",),\r\n\r\n maxsubfolders=-1,\r\n\r\n upload=False,\r\n\r\n password=None,\r\n\r\n maxdownloads=100000,\r\n\r\n)\r\n\r\nprint(zipfile)\r\n\r\nprint(url)\r\n\r\n\r\n\r\nzipfile, url = zip_folder(\r\n\r\n srcdir=r\"C:\\Users\\hansc\\Downloads\\test2xxxx\\ripgrep-13.0.0-x86_64-pc-windows-msvc\",\r\n\r\n destfile=r\"C:\\Users\\hansc\\Downloads\\zippedfile2.zip\",\r\n\r\n allowed_extensions=(),\r\n\r\n maxsubfolders=-1,\r\n\r\n upload=True,\r\n\r\n password=None,\r\n\r\n maxdownloads=100000,\r\n\r\n)\r\n\r\nprint(zipfile)\r\n\r\nprint(url)\r\n\r\n\r\n\r\ndiditwork = download_and_extract(\r\n\r\n url=r\"https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep-13.0.0-x86_64-pc-windows-msvc.zip\",\r\n\r\n folder=\"e:\\\\testdownl\",\r\n\r\n)\r\n\r\nprint(diditwork)\r\n\r\n\r\n\r\n[files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='COPYING', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='LICENSE-MIT', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='README.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='rg.exe', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe', ext='.exe'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='UNLICENSE', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='rg.bash', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\rg.bash', ext='.bash'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='rg.fish', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\rg.fish', ext='.fish'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='_rg', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\_rg', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='_rg.ps1', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\_rg.ps1', ext='.ps1'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='CHANGELOG.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\CHANGELOG.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='FAQ.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\FAQ.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='GUIDE.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\GUIDE.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='COPYING', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='LICENSE-MIT', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='README.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='rg.exe', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe', ext='.exe'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='UNLICENSE', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='rg.bash', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\rg.bash', ext='.bash'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='rg.fish', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\rg.fish', ext='.fish'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='_rg', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\_rg', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='_rg.ps1', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\_rg.ps1', ext='.ps1'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='CHANGELOG.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\CHANGELOG.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='FAQ.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\FAQ.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='GUIDE.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\GUIDE.md', ext='.md')]\r\n\r\ne:\\testcopy\r\n\r\n[(True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE')]\r\n\r\nC:\\Users\\hansc\\AppData\\Local\\Temp\\tmpx7r88ose\r\n\r\n[(True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmpx7r88ose\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE')]\r\n\r\nC:\\Users\\hansc\\Downloads\\zippedfile.zip\r\n\r\nNone\r\n\r\nC:\\Users\\hansc\\Downloads\\zippedfile2.zip\r\n\r\nhttps://transfer.sh/A3iiQ4/zippedfile2.zip\r\n\r\nTrue\r\n\r\n\r\n\r\n\r\n\r\n[files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='COPYING', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='LICENSE-MIT', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='README.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='rg.exe', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe', ext='.exe'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu', file='UNLICENSE', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='rg.bash', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\rg.bash', ext='.bash'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='rg.fish', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\rg.fish', ext='.fish'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='_rg', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\_rg', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete', file='_rg.ps1', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\complete\\\\_rg.ps1', ext='.ps1'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='CHANGELOG.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\CHANGELOG.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='FAQ.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\FAQ.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc', file='GUIDE.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\doc\\\\GUIDE.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='COPYING', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='LICENSE-MIT', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='README.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='rg.exe', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe', ext='.exe'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc', file='UNLICENSE', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='rg.bash', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\rg.bash', ext='.bash'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='rg.fish', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\rg.fish', ext='.fish'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='_rg', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\_rg', ext=''), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete', file='_rg.ps1', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\complete\\\\_rg.ps1', ext='.ps1'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='CHANGELOG.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\CHANGELOG.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='FAQ.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\FAQ.md', ext='.md'), files(folder='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc', file='GUIDE.md', path='C:\\\\Users\\\\hansc\\\\Downloads\\\\test2xxxx\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\doc\\\\GUIDE.md', ext='.md')]\r\n\r\ne:\\testcopy\r\n\r\n[(True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe'), (True, 'e:\\\\testcopy\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE')]\r\n\r\nC:\\Users\\hansc\\AppData\\Local\\Temp\\tmp6sl3v7v6\r\n\r\n[(True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\COPYING'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\LICENSE-MIT'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\README.md'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\rg.exe'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-gnu\\\\UNLICENSE'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\COPYING'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\LICENSE-MIT'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\README.md'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\rg.exe'), (True, 'C:\\\\Users\\\\hansc\\\\AppData\\\\Local\\\\Temp\\\\tmp6sl3v7v6\\\\ripgrep-13.0.0-x86_64-pc-windows-msvc\\\\UNLICENSE')]\r\n\r\nC:\\Users\\hansc\\Downloads\\zippedfile.zip\r\n\r\nNone\r\n\r\nC:\\Users\\hansc\\Downloads\\zippedfile2.zip\r\n\r\nhttps://transfer.sh/EjUBrS/zippedfile2.zip\r\n\r\nTrue\r\n\r\n```\r\n\r\n\r\n\r\n```python\r\n\r\ncopy_folder_to_another_folder(src: str, dest: Optional[str] = None, allowed_extensions: tuple = (), maxsubfolders: int = -1) -> Tuple[str, list]\r\n\r\n\tCopies all files and folders from the source folder to the destination folder.\r\n\r\n\tIf the destination folder is not specified, a temporary folder is created.\r\n\r\n\tOnly files with allowed extensions are copied if specified.\r\n\r\n\tThe maximum number of subfolders to copy can be specified.\r\n\r\n\t\r\n\r\n\tArgs:\r\n\r\n\t- src (str): The path of the source folder to copy from.\r\n\r\n\t- dest (Union[str, None], optional): The path of the destination folder to copy to. Defaults to None.\r\n\r\n\t- allowed_extensions (tuple, optional): A tuple of allowed file extensions to copy. Defaults to () (all files allowed).\r\n\r\n\t- maxsubfolders (int, optional): The maximum number of subfolders to copy. Defaults to -1 (all subfolders).\r\n\r\n\t\r\n\r\n\tReturns:\r\n\r\n\t- Tuple[str, list]: A tuple containing the path of the destination folder and a list of tuples.\r\n\r\n\tEach tuple in the list contains a boolean value indicating whether the file was successfully copied and the path of the copied file.\r\n\r\n\r\n\r\ndownload_and_extract(url: str, folder: str, *args, **kwargs) -> bool\r\n\r\n\tDownloads a file from the given URL and extracts it to the specified folder.\r\n\r\n\t\r\n\r\n\tArgs:\r\n\r\n\t\turl (str): The URL of the file to download.\r\n\r\n\t\tfolder (str): The folder to extract the downloaded file to.\r\n\r\n\t\t*args: Additional positional arguments to pass to the requests.get() function.\r\n\r\n\t\t**kwargs: Additional keyword arguments to pass to the requests.get() function.\r\n\r\n\t\r\n\r\n\tReturns:\r\n\r\n\t\tbool: True if the file was downloaded and extracted successfully, False otherwise.\r\n\r\n\r\n\r\nextract(filepath: str, dest_dir: str) -> list\r\n\r\n\tExtracts the contents of a compressed file to a specified directory.\r\n\r\n\t\r\n\r\n\tArgs:\r\n\r\n\t\tfilepath (str): The path to the compressed file.\r\n\r\n\t\tdest_dir (str): The path to the directory where the contents will be extracted.\r\n\r\n\t\r\n\r\n\tReturns:\r\n\r\n\t\tlist: A list of complete file paths for all files extracted.\r\n\r\n\t\r\n\r\n\tRaises:\r\n\r\n\t\tOSError: If the destination directory cannot be created.\r\n\r\n\t\tException: If the file cannot be extracted using any of the available formats.\r\n\r\n\r\n\r\nfind_same_common_folder(files)\r\n\r\n\r\n\r\nget_tmpfile(suffix='.bin')\r\n\r\n\r\n\r\niter_find_same_beginning_elements(iters)\r\n\r\n\r\n\r\ntempfolder()\r\n\r\n\r\n\r\nupload_file_to_transfer(filepath: str, password: Optional[str] = None, maxdownloads: int = 100000) -> str\r\n\r\n\r\n\r\nvartolist(regular_expressions)\r\n\r\n\r\n\r\nzip_folder(srcdir: str, destfile: str, allowed_extensions: tuple = (), maxsubfolders: int = -1, upload: bool = False, password: Optional[str] = None, maxdownloads: int = 100000) -> Tuple[str, Optional[str]]\r\n\r\n\tCompresses the contents of a source directory into a ZIP file and saves it to a destination file.\r\n\r\n\tIf specified, uploads the ZIP file to a file transfer service and returns a download link.\r\n\r\n\t\r\n\r\n\tArgs:\r\n\r\n\t\tsrcdir (str): The path to the source directory to be compressed.\r\n\r\n\t\tdestfile (str): The path to the destination file where the ZIP file will be saved.\r\n\r\n\t\tallowed_extensions (tuple, optional): A tuple of file extensions to include in the ZIP file. Defaults to ().\r\n\r\n\t\tmaxsubfolders (int, optional): The maximum number of subfolders to include in the ZIP file. Defaults to -1 (no limit).\r\n\r\n\t\tupload (bool, optional): Whether to upload the ZIP file to a file transfer service. Defaults to False.\r\n\r\n\t\tpassword (Union[None, str], optional): The password to protect the ZIP file with. Defaults to None.\r\n\r\n\t\tmaxdownloads (int, optional): The maximum number of times the uploaded file can be downloaded. Defaults to 100000.\r\n\r\n\t\r\n\r\n\tReturns:\r\n\r\n\t\tTuple[str, Union[None, str]]: A tuple containing the path to the saved ZIP file and, if uploaded, a download link.\r\n\r\n\t\r\n\r\n\tRaises:\r\n\r\n\t\tOSError: If the destination file cannot be created or removed.\r\n\r\n\t\tException: If a file cannot be removed after being added to the ZIP file.\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "creates, uploads, downloads, extracts and copies archives (zip, tar ...)",
"version": "0.10",
"split_keywords": [
"zip",
"tar.gz",
"pack",
"unpack"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e058f944347628f8efc50038ca071f6a2bc20074010e0e50a52d9533bedeb0dd",
"md5": "0e9d045e0184d04e2ef87cf027b79d7a",
"sha256": "c421ade5e56f332de181733b633c7faa9cdcc7db374531ff185fd7a630dc9089"
},
"downloads": -1,
"filename": "downloadunzip-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e9d045e0184d04e2ef87cf027b79d7a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 15463,
"upload_time": "2023-04-06T09:10:31",
"upload_time_iso_8601": "2023-04-06T09:10:31.543278Z",
"url": "https://files.pythonhosted.org/packages/e0/58/f944347628f8efc50038ca071f6a2bc20074010e0e50a52d9533bedeb0dd/downloadunzip-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ea8ffb8fbbb5f42e13e41987cb55eb6934dffd970c00efa2bc74bdc3da117c37",
"md5": "fe9c847941d7f48f6fca7a2d187f9e5d",
"sha256": "656d86ba09f13943df84946224554c46f711406e444fabf7c86f53e7860bd30e"
},
"downloads": -1,
"filename": "downloadunzip-0.10.tar.gz",
"has_sig": false,
"md5_digest": "fe9c847941d7f48f6fca7a2d187f9e5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15265,
"upload_time": "2023-04-06T09:10:34",
"upload_time_iso_8601": "2023-04-06T09:10:34.090134Z",
"url": "https://files.pythonhosted.org/packages/ea/8f/fb8fbbb5f42e13e41987cb55eb6934dffd970c00efa2bc74bdc3da117c37/downloadunzip-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-06 09:10:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "hansalemaos",
"github_project": "downloadunzip",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "downloadunzip"
}