import tarfile
# open file
file = tarfile.open('gfg.tar.gz')
# extracting a specific file
file.extract('sample.txt', './Destination_FolderName')
file.close()
파일경로 확인 필수!!
출처 : https://www.geeksforgeeks.org/how-to-uncompress-a-tar-gz-file-using-python/