Skip to content

Download files hosted on the internet and parse with python

License

Notifications You must be signed in to change notification settings

mvinyard/WebFiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebFiles

Download files hosted on the internet and parse with python

Installation

pip install webfiles

Core class construct:

import wget

class WebFile:
    def __init__(self, http_address, local_path=None):
        
        self.http_address = http_address
        if local_path:
            self.local_path = local_path
        else:
            self.local_path = os.path.basename(http_address)
            
    def download(self):
        if not os.path.exists(self.local_path):
            wget.download(self.http_address, self.local_path, bar=False)