GitHubFolderDownloader
1.0.0
GitHubFolderDownloader
는 GitHub 저장소에서 폴더를 다운로드하기위한 파이썬 라이브러리입니다.
load_repository(url, branch)
download(destination,target_folder,recursive)
대상 : 다운로드 된 모든 파일 및 디렉토리를 저장하기위한 폴더 경로 (필수)
Target_folder : GitHub 리포지토리에서 선택된 디렉토리, '*'는 기본값입니다 (선택 사항)
참고 : target_folder가 *로 설정된 경우 모든 파일과 디렉토리가 다운로드됩니다.
재귀 : 하위 디렉토리에서 파일 및 디렉토리 다운로드, 기본값은 참입니다 (선택 사항)
GitHubDownloader.py
라이브러리를 Python 코드로 가져옵니다
from GitHubDownloader import Downloader
githubdownloader에서 다운로더 클래스의 객체를 만듭니다
downloader = Downloader(url,branch)
또는 생성자 매개 변수를 비워두고 load_repository
호출하여 저장소를로드 할 수 있습니다.
downloader = Downloader()
downloader.load_repository(url,branch)
다운로드 방법을 호출하여 파일을 다운로드하십시오
downloader.download(destination,target_folder,recursive)
우리 가이 git 트리 구조를 가지고 있다고 가정하십시오
imagecompression
├───__pycache__
│ └───ImageCompression.cpython-38.pyc
├───ImageCompression.py
├───LICENSE
├───...
└───real-image.jpg
github 리포지토리 https://github.com/fbunaren/imagecompression에서
저장소에서 모든 파일과 디렉토리를 다운로드합니다
from GitHubDownloader import Downloader
downloader = Downloader("https://github.com/fbunaren/imagecompression")
downloader.download("./test","*",True)
__ pycache _ directory에서 모든 파일과 디렉토리를 다운로드하려면 "./test"
폴더
from GitHubDownloader import Downloader
downloader = Downloader("https://github.com/fbunaren/imagecompression")
downloader.download("./test","__pycache__",True)