| |
1 SCC access script |
| |
2 ================= |
| |
3 |
| |
4 This small scripts permits interacting with the Single Calculus Chain through |
| |
5 the command line. Specifically, with the script you can: |
| |
6 |
| |
7 * Upload a file to the SCC for processing |
| |
8 * Download the processed files and graphs |
| |
9 * Delete an existing measurement from the SCC (with appropriate privileges) |
| |
10 |
| |
11 The main functions are implemented in a class (SCC) that you can also import |
| |
12 and use in your custom scripts. |
| |
13 |
| |
14 The script does not provide any feedback if a file upload fails. Before using |
| |
15 the script, you will need to upload some files manually and be confident that |
| |
16 your SCC file format and processing settings are correct. |
| |
17 |
| |
18 Please note that this is not part of the "official" SCC tools. I will update |
| |
19 it when I have time but I cannot guarantee to maintain it in the long run. |
| |
20 |
| |
21 Any suggestions for improvements and new features are more than welcome. |
| |
22 |
| |
23 |
| |
24 Installation |
| |
25 ------------ |
| |
26 |
| |
27 The only requirement for running this program is the requests python module. |
| |
28 If you have pip installed you can install it by:: |
| |
29 |
| |
30 pip install requests. |
| |
31 |
| |
32 See http://docs.python-requests.org/en/latest/user/install/ for more details. |
| |
33 |
| |
34 You can use the script by cloning this mercurial repository. Alternatively, you |
| |
35 can just coppy the scc_access.py and and settings.sample.py files to a local |
| |
36 directory. |
| |
37 |
| |
38 |
| |
39 Settings |
| |
40 -------- |
| |
41 You will need to change some user-defined settings in a settings.py file. You |
| |
42 can rename the settings.sample.py file to settings.py and follow the instructions |
| |
43 there. |
| |
44 |
| |
45 Specifically, you will need to: |
| |
46 |
| |
47 1. Change the BASIC_LOGIN and DJANGO_LOGIN to your credentials. |
| |
48 2. Change the OUTPUT_DIR to the location were the results will be stored. |
| |
49 |
| |
50 Please not that it's not a good idea to store your own credentials in the settings |
| |
51 file. The standard user has "Station Management" privileges and if the credentials |
| |
52 are stolen, someone could change/delete the stations settings from the SCC database. |
| |
53 For this, it is better to use a used account with minimum access settings, that |
| |
54 can only upload files and measurements. |
| |
55 |
| |
56 |
| |
57 Usage |
| |
58 ----- |
| |
59 |
| |
60 You can upload a file specifying the username and the system id:: |
| |
61 |
| |
62 python scc_access.py 20110101po01.nc 125 |
| |
63 |
| |
64 If you want to wait for the processing to finish and download the resulting files |
| |
65 you need to define the -p flag:: |
| |
66 |
| |
67 python scc_access.py 20110101po01.nc 125 -p |
| |
68 |
| |
69 If you want to delete an existing measurement id from the database use the -d flag and |
| |
70 the measurement id:: |
| |
71 |
| |
72 python scc_access.py -d 20110101po01 |
| |
73 |
| |
74 For more information on the syntax type:: |
| |
75 |
| |
76 python scc_access.py -h |