-
Notifications
You must be signed in to change notification settings - Fork 1
Running Python script
Hyojoon Kim edited this page Jul 28, 2017
·
18 revisions
Note: You probably want to run this in the web server where you want to host the graphs, charts, and tables.
-
Git clone globes-stats source
$ mkdir ~/globus
$ cd ~/globus
$ git clone https://github.com/PrincetonUniversity/globus-stats
-
Make sure you have Python and two libraries
- Install pytz
$ pip install pytz
- Or build from source.
- Download *.zip source from here.
- Unzip. Enter created directory.
-
$ python setup.py install --user
(if you have sudo, put sudo in front and remove--user
)
- Install Globus Python SDK. Follow installation guide here.
- Generally, use "python pip" if possible.
- If "pip" is not available or you don't have sudo or not root, build from source:
$ git clone https://github.com/globus/globus-sdk-python.git
$ cd glogus-sdk-python
-
$ python setup.py install --user
(if you have sudo, put sudo in front and remove--user
)
- Test by running script:
$ python get_globus_data.py --help
- There should be no failures or errors, just a print of how to use the script.
- Install pytz
-
Configure configuration file and create client secret file
- Create copy and change name.
$ cd ~/globus/globus-stats
$ cp globus_config_template.json globus_config.json
- Fill content in “globus_config.json”.
- Detailed explanation is in the template JSON file as comments.
- Basically, you need to fill
timezone
,client ID
,client secret
,user IDs ("owner_id" in Globus) you want to exclude
,Globus endpoint IDs (UUID) you administer
,dates to exclude
. - You can find Globus endpoint UUID in each endpoint's "Overview" tab.
- Create client secret file. Filename should be "client.secret".
-
$ touch client.secret
. - Put in the client secret password (from Step 3 in "Creating and preparing a Globus App") in "client.secret".
-
- Create copy and change name.
-
Run script
- Decide where to store output CSV files. Create that directory. E.g., “~/data”.
$ mkdir ~/data/
- Specify configuration file (-c option), output directory (-o option), and if you want to pull new raw data from Globus.org (-n option)
$ cd ~/globus/globus-stats
$ python get_globus_data.py -c globus_config.json -o ~/data/ -n
- Some information should be printed in the standard output.
- See here for more information on running the script and its options. ("Basic usage of the script itself")
- Decide where to store output CSV files. Create that directory. E.g., “~/data”.
-
Check data
- Check if a bunch of CSV files (and some additional files) are stored in the data directory of your choice.