Skip to content

Commit 03677bb

Browse files
committed
Merge branch 'develop' into academic-calendar-scraper
2 parents 523aebd + 31087b9 commit 03677bb

36 files changed

+4203
-256
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,17 @@ jobs:
5555
job: 'daily-prod'
5656
image: 'us-central1-docker.pkg.dev/api-tools-451421/runners/runner'
5757
region: us-central1
58+
59+
- name: Upload to monthly dev job
60+
uses: google-github-actions/deploy-cloudrun@v2
61+
with:
62+
job: 'monthly-dev'
63+
image: 'us-central1-docker.pkg.dev/api-tools-451421/runners/runner'
64+
region: us-central1
65+
66+
- name: Upload to monthly prod job
67+
uses: google-github-actions/deploy-cloudrun@v2
68+
with:
69+
job: 'monthly-prod'
70+
image: 'us-central1-docker.pkg.dev/api-tools-451421/runners/runner'
71+
region: us-central1

README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,74 @@ Please visit our [Discord](https://discord.utdnebula.com) and talk to us if you'
2424

2525
### Prerequisites
2626

27-
- Golang 1.23 (or higher)
27+
- Golang 1.24 (or higher)
2828

29-
### Development
30-
31-
Documentation for the project will be created soon, but for more information please visit our [Discord](https://discord.com/invite/tcpcnfxmeQ).
29+
### Build
3230

3331
To build the project, simply clone the repository and then either:
3432
- Run `make` in the root (top level) directory (for systems with `make` installed, i.e. most Linux distros, MacOS)
3533
- Run `build.bat` on Windows systems (unless you want to deal with getting `make` to work on Windows :P)
3634

3735
The build process will output an executable file named `api-tools`; this executable is the CLI and can be ran in your terminal!
3836

37+
Additionally, you can run build (on Windows) and make (on MacOS/Linux) with the following arguments:
38+
- `setup`: Installs required dependencies for the tools.
39+
- `check`: Verifies prequisites and ensures the executable can be built.
40+
- `test`: Test run to see if the executable works after building
41+
- `build`: Builds the executble and makes it ready for use.
42+
43+
### Usage
44+
45+
The `api-tools` command line interface supports three main modes: scraping, parsing and uploading data to the Nebula API.
46+
47+
#### Environment Variables
48+
Before being able to use the tool, configure the `.env` file by following these steps:
49+
1. Find the `.env.template` file and rename it to `.env`
50+
2. Specify the required credentials for your use case as a string ("") following the variable name.
51+
Example: LOGIN_NETID="ABC123456"
52+
53+
#### Basic Usage
54+
55+
Run the tool by changing directory using `cd` to the `api-tools` directory and running the executable with the appropriate flags in the command line. To see all available options with the tool, run: `./api-tools`. To enable logging for debugging, use the verbose flag: `./api-tools -verbose`. Find available flags for each mode in the following tables.
56+
57+
---
58+
59+
### Scraping Mode
60+
61+
| Command | Description |
62+
|---------|-------------|
63+
| `./api-tools -scrape -astra` | Scrapes Astra data. |
64+
| `./api-tools -scrape -calendar` | Scrapes calendar data. |
65+
| `./api-tools -scrape -coursebook -term 24F` | Scrapes coursebook data for Fall 2024.<br>• Use `-resume` to continue from last prefix.<br>• Use `-startprefix [prefix]` to begin at a specific course prefix. |
66+
| `./api-tools -scrape -map` | Scrapes UTD Map data. |
67+
| `./api-tools -scrape -mazevo` | Scrapes Mazevo data. |
68+
| `./api-tools -scrape -organizations` | Scrapes SOC organizations. |
69+
| `./api-tools -scrape -profiles` | Scrapes UTD professor profiles. |
70+
| `./api-tools -scrape -headless` | Runs ChromeDP in headless mode. |
71+
| `./api-tools -o [directory]` | Sets output directory (default: `./data`). |
72+
73+
### Parsing Mode:
74+
75+
| Command | Description |
76+
|---------|-------------|
77+
| `./api-tools -parse -astra` | Parses Astra data. |
78+
| `./api-tools -parse -calendar` | Parses calendar data. |
79+
| `./api-tools -parse -csv [directory]` | Outputs grade data CSVs (default: `./grade-data`). |
80+
| `./api-tools -parse -map` | Parses UTD Map data. |
81+
| `./api-tools -parse -mazevo` | Parses Mazevo data. |
82+
| `./api-tools -parse -skipv` | Skips post-parse validation (**use with caution**). |
83+
84+
85+
### Upload Mode:
86+
| Command | Description |
87+
|---------|-------------|
88+
| `./api-tools -upload -events` | Uploads Astra and Mazevo data. |
89+
| `./api-tools -upload -map` | Uploads UTD Map data. |
90+
| `./api-tools -upload -replace` | Replaces old data instead of merging. |
91+
| `./api-tools -upload -static` | Uploads only static aggregations. |
92+
93+
Additionally, you can use the `-i [directory]` flag to specify where to read data from (default: `./data`) and the `-l [directory]` flag to specify where logs must be dumped (default: `./logs`).
94+
3995
#### Docker
4096

4197
Docker is used for automated running on Google Cloud Platform. More info [here](https://nebula-labs.atlassian.net/wiki/x/AYBjFw).
@@ -45,3 +101,6 @@ To build the container for local testing first make sure all scripts in the `run
45101
docker build --target dev -t my-runner:local .
46102
docker run --rm -e ENVIRONMENT=dev -e RUNNER_SCRIPT_NAME=daily.sh my-runner:local
47103
```
104+
105+
## Questions?
106+
Reach out to the team on [Discord](https://discord.utdnebula.com) and with any questions you may have!

0 commit comments

Comments
 (0)