A python interface to archive.org
Jake pointed out today that he wrote a cool python wrapper for archive.org that made it easy to upload files. I added downloading support and a few other features:
#The Internet Archive stores data in "items". You can query the archive using an item identifier: >>> import archive >>> item = archive.Item('stairs') >>> print item.metadata #Items contains files, which can be downloaded: >>> f = item.file('glogo.png') >>> f.download() #writes to disk >>> f.download('/foo/bar/some_other_name.png') #You can iterate over files: >>> for f in item.files(): ... print f.name, f.sha1 #You can use the IA's S3-like interface to upload files to an item. #You need to supply your IAS3 credentials in environment variables in order to upload. #You can retrieve S3 keys from https://archive.org/account/s3.php >>> import os; >>> os.environ['AWS_ACCESS_KEY_ID']='x'; os.environ['AWS_SECRET_ACCESS_KEY']='y' >>> item.upload('myfile') True |
raj 12:34 am on August 21, 2013 Permalink |
Lots more features added. And you can now install via pip:
See the full docs at https://github.com/jjjake/ia-wrapper