Skip to content

Installing Python tools

sr320 edited this page May 27, 2013 · 4 revisions

Following instruction at http://escience.washington.edu/get-help-now/sqlshare-python-api


This is a walk through (with a Biologist) installing the python tools to interface with SQLShare on a Mac. This was done in Terminal in my home directory.
Screenshot%205/27/13%201:54%20PM
svn co https://subversion.assembla.com/svn/sqlshare/pythonclient
~ sr320$ svn co https://subversion.assembla.com/svn/sqlshare/pythonclient Error validating server certificate for 'https://subversion.assembla.com:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: *.assembla.com - Valid: from Mon, 18 Feb 2013 16:04:02 GMT until Thu, 24 Mar 2016 19:30:40 GMT - Issuer: 07969287, http://certificates.godaddy.com/repository, GoDaddy.com, Inc., Scottsdale, Arizona, US - Fingerprint: ba:a7:c2:ce:80:37:5c:8b:44:56:fe:d0:2b:c7:2c:bf:ae:5c:01:44 (R)eject, accept (t)emporarily or accept (p)ermanently? p A pythonclient/test A pythonclient/test/testREST.py A pythonclient/test/data

Needed to accept the server certificate.

...
A    pythonclient/tools/uploadone.py
A    pythonclient/tools/append.py
A    pythonclient/sqlshare
A    pythonclient/sqlshare/__init__.py
A    pythonclient/sample_config
A    pythonclient/setup.py
A    pythonclient/README
Checked out revision 822.
Stevens-MacBook-Air-3:~ sr320$ 

cd pythonclient
sudo python setup.py install

Password required here


Next will test the connection
python test/testREST.py

Test passed!


Ok here is where it might get a little tricky. You have to create a simple text file in a _hidden_ directory. I created this in my home user folder, for me this was inside my user folder _sr320_
sr320$ mkdir ".sqlshare"

I then created a text filed called config

[sqlshare]
host=rest.sqlshare.escience.washington.edu
user=your-sql-share-account-name
password=your-sql-share-account-key
Screenshot%205/27/13%201:22%20PM

I then moved this file to the hidded directory .sqlshare

mv config .sqlshare/config

Now lets test it out..

cd to tools folder...

python singleupload.py -d NopePass /Users/sr320/Dropbox/Steven/LT_UniqueCounts.txt

wwcd

Screenshot%205/27/13%201:40%20PM

Some thoughts. My assumption is that without the config file it would still work you would just have to include user name and API each time.

python singleupload.py -h
Usage: singleupload.py [options] <filename>

Options:
  -h, --help            show this help message and exit
  -u USERNAME, --user=USERNAME
                        SQLshare user name
  -p PASSWORD, --password=PASSWORD
                        SQLshare password
  -d DATASETNAME, --datasetname=DATASETNAME
                        Dataset name (defaults to filename if not supplied

Clone this wiki locally