forked from mitodl/edx2bigquery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edx2bigquery_config.py.template
85 lines (68 loc) · 2.35 KB
/
edx2bigquery_config.py.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#-----------------------------------------------------------------------------
#
# sample edx2bigquery_config.py file
#
course_id_list = [
"MITx/2.03x/3T2013",
]
courses = {
'year2': course_id_list,
'all_harvardx': [
"HarvardX/AI12.1x/2013_SOND",
],
}
# google cloud project access
auth_key_file = "USE_GCLOUD_AUTH"
auth_service_acct = None
# google youtube API
API_KEY = "my_api_key"
# google bigquery config
PROJECT_ID = "x-data"
# google cloud storage
GS_BUCKET = "gs://x-data"
# local file configuration
COURSE_SQL_BASE_DIR = "X-Year-1-data-sql"
COURSE_SQL_DATE_DIR = '2013-09-08'
TRACKING_LOGS_DIRECTORY = "TRACKING_LOGS"
DEFAULT_END_DATE = "2115-01-01"
# local parallel processing
MAXIMUM_PARALLEL_PROCESSES = 3
# external command definitions
extra_external_commands = {}
#-------------------------------------------
# Private edX login Setup
# This setup is needed in order to fix missing grades
# for self-paced courses; edX weekly dumps only contain
# grades for verified ID users.
# Workaround is to download grade reports from edX instructor
# dashboard and import into BigQuery
# Instuctor level access is required
#-------------------------------------------
import os, sys
from path import Path as path
# Store username and password in a protected, private path
# create new file called edx_private_config.py
PRIVATE_PATH = "/local/home/private/path"
try:
PRIVATE_CONFIG = 'edx_private_config'
PRIVATE_CONFIG_FILENAME = PRIVATE_CONFIG + '.py'
currentDir = os.getcwd()
if os.path.exists( path(PRIVATE_PATH) / PRIVATE_CONFIG_FILENAME ):
os.chdir( PRIVATE_PATH )
sys.path.append( PRIVATE_PATH )
import edx_private_config as CFG
else:
print "[edx2bigquery_config]: WARNING: Need to specify a configuration file, %s/%s, to operate properly" % ( PRIVATE_PATH, PRIVATE_CONFIG_FILENAME )
os.chdir(currentDir) # Set back to current working dir
except Exception as err:
print "[edx2bigquery_config]: Could not import private config"
print "[edx2bigquery_config]: Error = %s" % err
raise
#-------------------------------------------
# EdX Login
# Instructor level access is required
# edx_private_config.py contains login variables
#-------------------------------------------
EDX_USER = getattr( CFG, "EDX_USER", None )
EDX_PW = getattr( CFG, "EDX_PW", None )
#-----------------------------------------------------------------------------