Tag Selector

Zaragoza Clouds

by Zaragoza Online
Python based binary and text downloader library API for windows and linux PDF Print E-mail

A while ago I realised that many of the python functions available  for url handling etc. dont work well in all platforms.

besides some of the functions work for urls to local and others work for local to local file copies. A generic library which will copy a file irrespective of the local or remote location of its library is always a good idea IMO.

As a part of the work I was doing I found the need to write my own robust downloader/copier library. This downloader allows anywhere to anywhere file copy.

I called it downloader.py

you have to pass the url or local file path of the file(binary or html/text) and the local location where you want it to be copied. and the function will do it

 

here is the syntax 

import downloader

downloader.downloadfile(sourcepath,destinationpath)

  • Examples
    • url to local(text)
      • import downloader
        downloader.downloadfile("http://abc.com/abc.html","/home/shantanu/abc.txt")
    • local to local(text)
      • import downloader
        downloader.downloadfile("/home/shantanu/abc.txt","/home/shantanu/abc2.txt")
    • url to local(Binary)
      • import downloader
        downloader.downloadfile("http://abc.com/abc.jpg","/home/shantanu/abc.jpg")
    • local to local(text)
      • import downloader
        downloader.downloadfile("/home/shantanu/abc.jpg","/home/shantanu/abc2.jpg")

downloader.py has been released under GPL by me and you are free to copy modify or distribute it. I request you to keep the original credits.

Happy downloading.

 Coming up:

 A project to create a spider using downloader.py

Current folder: downloader_py
File name Size Last changed  
downloader.py 958 B 20/10/2009 08:11:21   
 



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Joomla Free PHP
 

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
SmileCoolCrying or Very SadEmbarrassedA Smoker/Foot in mouthSadUser is an angel (at heart, at least)A Kiss/Lips Are SealedLaughingBiting one's tongue/Put Your Money Where Your Mouth IsBeen Smacked In The Mouth/Wears A Brace/My lips are sealeSurprisedSticking Out TongueConfusedWinkYelling
Your name:
Your email:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification: