vmbrasseur / iaupload Goto Github PK
View Code? Open in Web Editor NEWA Python script for uploading files to Internet Archive
License: Other
A Python script for uploading files to Internet Archive
License: Other
There are no tests whatsoever. This needs to change.
Right now the files to upload are hard coded in an array in the script.
Currently the location/name of the metadata YAML file is hard coded in mdfile = "/Users/brasseur/Desktop/md.yaml"
Right now the authorization keys are located in the config file. There ought to be a way to specify them on the command line instead.
Currently, the identifier for the IA item is hard coded in identifier = "sfperlmongerslightningtalks2014"
I sent the repo link to a Windows user. He was perplexed. Fair 'nuff.
Update the docs to show how to install/use on Windows.
I'm working on uploading the videos from my three talks at Open Source Bridge last week. It occurs so me that it'd be dead handy to have iaupload have a batch mode so it can create/upload to multiple items in succession rather than just one item at a time.
The --debug flag will tell the script to perform all operations but NOT actually upload files or create/modify the item. Optionally, it may also output additional information.
This may need to work with the function added in #6.
There currently is no help message for this script. That really, really needs to change.
Don't forget to update the documentation once this flag is added.
Currently the config file (holds auth keys) is hardcoded as config = "./iaupload.yaml"
.
This may not be necessary after #10, but it might be nice to be able to type pydoc iaupload
and get the contents of the README.md file (parsed/rendered for markdown, if necessary).
The output right now currently looks like this:
Epicurus:iaupload brasseur$ python ./iaupload.py --config config.yaml --metadata ato-ia-api.yaml --identifier ato2015-ia-apis /Users/brasseur/Dropbox/Writing/Presentations/2015/ATO/Internet_Archive-Universal_Access_Open_APIs.pdf
There are 1 files to upload.
Uploading /Users/brasseur/Dropbox/Writing/Presentations/2015/ATO/Internet_Archive-Universal_Access_Open_APIs.pdf
It would be helpful (to me, at least) if at the end it said something like:
You can view your item at $url
trimalchio:iaupload brasseur$ time ./iaupload.py --identifier=mikefriedmanrealworldmongodbaggregationforperl ~/Desktop/friedo2.mov
There are 1 files to upload.
Uploading /Users/brasseur/Desktop/friedo2.mov
real 646m10.271s
user 1m0.059s
sys 1m37.139s
There are 1 files to upload? Really, Vicky? Subject/verb agreement much?
Yes, it's a silly little bug but it's going to drive me nuts if I see it too often.
#4 adds a --file flag for specifying the files to upload. This is a shortcut for that.
From the code:
# TODO: change this to a boolean to avoid the +=1 each iteration of the loop
# just set it to FALSE at the end of its if block
num = 1
This is just used to determine whether it's the first file uploaded to the item. If it is, it includes the metadata. If not, no metadata is needed.
You will probably need to have a look at the item to determine some of this.
May be particularly useful in case of --quiet ( #6 ).
While no metadata fields are officially "required", some are very smart to include.
At the very least, we should make sure that every metadata file contains a title.
This probably should be handled in a new function. Later, if we decide other fields should be verified in some way, we can add them to the function.
It can take a long time for some files to upload. It'd be nice if there were some sort of progress indicator so the user knows that, yes, things are still chugging along.
There may already be a Python library for this. Have a look before rolling your own.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.