You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,30 +31,30 @@ To run the scraper, simply run:
31
31
32
32
###### Mac/Linux
33
33
```bash
34
-
python3 main.py
34
+
python3 src/main.py
35
35
```
36
36
37
37
###### Windows
38
38
```bash
39
-
python main.py
39
+
python src/main.py
40
40
```
41
41
42
42
The scraper will output a JSON file called `data.json` in the same directory as the scraper.
43
43
44
-
You can modify the scraper to scrape other terms by changing the `year`, `quarter`, and `college_code` variables in `config.py`.
44
+
You can modify the scraper to scrape other terms by changing the `year`, `quarter`, and `college_code` variables in `src/config.py`.
45
45
46
46
#### All Colleges
47
47
48
-
To scrape all colleges instead of just the one specified in the `config.json`, run the following command:
48
+
To scrape all colleges instead of just the one specified in the `src/config.py`, run the following command:
49
49
50
50
###### Mac/Linux
51
51
```bash
52
-
python3 main.py --all-colleges
52
+
python3 src/main.py --all-colleges
53
53
```
54
54
55
55
###### Windows
56
56
```bash
57
-
python main.py --all-colleges
57
+
python src/main.py --all-colleges
58
58
```
59
59
60
60
#### Ratings
@@ -63,12 +63,12 @@ To also include the ratings field in `data.json` that requests data from RateMyP
63
63
64
64
###### Mac/Linux
65
65
```bash
66
-
python3 main.py --ratings
66
+
python3 src/main.py --ratings
67
67
```
68
68
69
69
###### Windows
70
70
```bash
71
-
python main.py --ratings
71
+
python src/main.py --ratings
72
72
```
73
73
74
74
Note that this will take longer to run since the scraper has to look up the rating on RateMyProfessors. However, it will cache the ratings in a file called `ratings_cache.json` (inside the `cache` directory) so that it doesn't have to look up the same professor again, which will run much faster. If you want to clear the cache to get new ratings, simply delete the `ratings_cache.json` file.
@@ -81,21 +81,21 @@ Then run the scraper with the `--db` flag:
81
81
82
82
###### Mac/Linux
83
83
```bash
84
-
python3 main.py --db
84
+
python3 src/main.py --db
85
85
```
86
86
87
87
###### Windows
88
88
```bash
89
-
python main.py --db
89
+
python src/main.py --db
90
90
```
91
91
92
-
This will create a new database `schedulerdb` and the necessary tables if they aren't already created, and then insert the data into the database. If the data is already populated, it will update the existing data. To delete all the data, make sure the environment variables specified in `db_config.py` are set and then run the following command (make sure you're using the Git Bash terminal if you're using Windows):
92
+
This will create a new database `schedulerdb` and the necessary tables if they aren't already created, and then insert the data into the database. If the data is already populated, it will update the existing data. To delete all the data, make sure the environment variables specified in `src/db_config.py` are set and then run the following command (make sure you're using the Git Bash terminal if you're using Windows):
93
93
94
94
```bash
95
95
./reset_db.bash
96
96
```
97
97
98
-
To view the schema for the tables, you can look at the `create_tables.sql` file.
98
+
To view the schema for the tables, you can look at the `src/create_tables.sql` file.
99
99
100
100
Connect to the database using the following command:
101
101
@@ -116,12 +116,12 @@ You can also combine all the options together:
0 commit comments