Skip to content

Commit 597cb88

Browse files
authored
Merge pull request #85 from greeshiee/develop
initial addition of build/usage instruction to readme.md
2 parents cc04bdd + 5be196f commit 597cb88

File tree

1 file changed

+62
-4
lines changed

1 file changed

+62
-4
lines changed

README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,73 @@ 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 -csv [directory]` | Outputs grade data CSVs (default: `./grade-data`). |
79+
| `./api-tools -parse -map` | Parses UTD Map data. |
80+
| `./api-tools -parse -mazevo` | Parses Mazevo data. |
81+
| `./api-tools -parse -skipv` | Skips post-parse validation (**use with caution**). |
82+
83+
84+
### Upload Mode:
85+
| Command | Description |
86+
|---------|-------------|
87+
| `./api-tools -upload -events` | Uploads Astra and Mazevo data. |
88+
| `./api-tools -upload -map` | Uploads UTD Map data. |
89+
| `./api-tools -upload -replace` | Replaces old data instead of merging. |
90+
| `./api-tools -upload -static` | Uploads only static aggregations. |
91+
92+
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`).
93+
3994
#### Docker
4095

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

0 commit comments

Comments
 (0)