{"id":19408470,"url":"https://github.com/ninest/nu-courses","last_synced_at":"2025-10-22T02:52:34.573Z","repository":{"id":48412855,"uuid":"516086605","full_name":"ninest/nu-courses","owner":"ninest","description":"Functions and API to get course information for Northeastern University","archived":false,"fork":false,"pushed_at":"2024-09-06T18:42:33.000Z","size":9076,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T03:11:10.117Z","etag":null,"topics":["courses","deno","northeastern","university"],"latest_commit_sha":null,"homepage":"https://husker.vercel.app/courses/all","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ninest.png","metadata":{"funding":{"github":"ninest","patreon":null,"open_collective":null,"ko_fi":"parthkabra","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/ninest"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-20T18:05:21.000Z","updated_at":"2024-09-06T18:42:38.000Z","dependencies_parsed_at":"2023-02-17T02:17:16.390Z","dependency_job_id":"bcd2d0dd-5df5-4235-8592-4957400cd5c1","html_url":"https://github.com/ninest/nu-courses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninest%2Fnu-courses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninest%2Fnu-courses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninest%2Fnu-courses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninest%2Fnu-courses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninest","download_url":"https://codeload.github.com/ninest/nu-courses/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250600717,"owners_count":21457017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["courses","deno","northeastern","university"],"created_at":"2024-11-10T12:06:18.039Z","updated_at":"2025-10-22T02:52:34.525Z","avatar_url":"https://github.com/ninest.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ninest","https://ko-fi.com/parthkabra","https://www.buymeacoffee.com/ninest"],"categories":[],"sub_categories":[],"readme":"# NU Course\n\n\u003e Functions to get NU course information \n\nThis project is meant to get course data for [ninest/husker](https://github.com/ninest/husker).\n\n## Folders\n\n- `constants/`\n  - Contains constants, like `TERMS`, stating which terms should be fetched\n- `banner/`\n  - Contains all Banner-specific code for fetching terms, subjects, and courses\n  - Only contains functions that call the API and return data as is (`getAllSubjects`, `searchSections`, `getCourseCoreqs`)\n- `fetcher/`\n  - Contains functions to call Banner functions and write responses to JSON files\n  - Use transformer functions to map API responses to required data types\n  - Think of constants in `constants/` as the \"parameters\" for the fetchers\n- `transformers/`\n  - Contains functions to map Banner API responses to required types\n- `read/`\n  - Contains utility functions to read data already fetched (data that's been\n    fetched and is saved in one of the JSON files)\n- `mappings/`\n  - Functions to read existing data and save it in another form\n  - For example, terms to subject/courses: courses are fetched, and contain sections which contain terms. This makes it difficult to find out which courses are offered in which term. So, there is a mapping of terms to courses offered in that term.\n- `util/`\n  - Dump of (complex) utility functions used in one or more locations\n- `api/`\n  - The NU Courses API\n  - [Check out the README in `api/`](./api/README.md)\n- `.data/`\n  - `subjects.json`\n  - `courses/`\n    - Contains one JSON file per course\n  - `mappings/`\n  - `all-courses.json`: all courses in a single JSON file\n\n## Build Setup\n\nFirst, [install Deno](https://deno.land/manual/getting_started/installation). Clone or fork the repository, then do the following.\n\n### 1. Constants\n\nThen open `constants/terms.ts`, and enter the terms you want to fetch (`TERMS`).\n\nFor example, if you want to fetch courses from only Fall 2022, the file should look like this:\n\n```ts\nexport const TERMS = [\n  {\n    code: \"202310\",\n  },\n];\n```\n\nBy default, the output folder is the `.data` folder.\n\nThe `description` key in each term is optional, so `[{ code: \"202310\" }]` should also work.\n\nYou can find a list of available terms through NUBanner's API: [nubanner.neu.edu/StudentRegistrationSsb/ssb/classSearch/getTerms?searchTerm=\u0026offset=1\u0026max=20](https://nubanner.neu.edu/StudentRegistrationSsb/ssb/classSearch/getTerms?searchTerm=\u0026offset=1\u0026max=20).\n\nNote that the output folder (`.data/nu` in this example) should contain a folder `courses`.\n\n### 2. Subjects\n\nTo fetch all subjects, run\n\n```bash\ndeno task fetch:subjects\n```\n\nThis should create a file called `subjects.json` in the output folder path with a list of subjects containing a `code` and `description`:\n\n```ts\n[\n  {\n    \"code\": \"ACCT\",\n    \"description\": \"Accounting\"\n  },\n  {\n    \"code\": \"AFAM\",\n    \"description\": \"African American Studies\"\n  },\n  ...\n]\n```\n\n### 3. Courses\n\nTo fetch all courses under each subject, run\n\n```bash\ndeno task fetch:courses\n```\n\nThis will take a **long** time, so follow the progress through the logs.\n\nThis will create a file for each subject in the `courses` folder in the output path. For example, there will be `courses/CS.json` containing a list of courses.\n\nNote that in fetching the courses, the data of the courses already fetched will be merged in with the \"new\" data from Banner's API. If the descriptions or requisites have already been fetched and `deno task fetch:courses` is run, `deno task fetch:descriptions` does not have to be run again.\n\n### 4. Description\n\nTo fetch all descriptions for courses, run\n\n```bash\ndeno task fetch:descriptions\n```\n\nThis will check if a description exists for each course and fetch a description if not present.\n\nIn `fetcher/constants.ts`, populate the following with courses that may have different descriptions across sections. For example:\n\n```ts\nexport const COURSES_WITH_ALT_SECTIONS = [\n  { code: \"CS\", number: \"2500\" },\n  { code: \"CS\", number: \"2510\" },\n];\n```\n\nIn this case, the descriptions of the first three sections are fetched, and the most common on is set as the main description. In the example for Fundies Accelerated, the accelerated section's description is not very useful, so the only the descriptions of the regular sections are saved.\n\nSee [#1](https://github.com/ninest/nu-courses/issues/1) for more information.\n\n### 5. Requisites\n\n#### a. Co-requisites\n\nCo-requisites are lists of the following:\n\n```tsx\ntype Requisite = Pick\u003cCourse, \"subject\" | \"number\"\u003e;\n// A list of coreqs is of type Requisite[]\n```\n\nRun\n\n```bash\ndeno task fetch:coreqs\n```\n\nIf a course already has the `coreq` key and a list (which can be empty), it will skip that course as it means that the co-requisites for that course have already been fetched.\n\n#### b. Pre-requisites\n\nPre-requisites are lists of\n\n```ts\nexport type Prerequisite = \"Or\" | \"And\" | \"(\" | \")\" | Requisite | string;\n```\n\nSee [#7](https://github.com/ninest/nu-courses/issues/7) for details on this format.\n\nRun\n\n```bash\ndeno task fetch:prereqs\n```\n\nSimilar to co-requisites, lists of pre-requisites already fetched won't be re-fetched.\n\n## Mappings\n\nMappings are meant to make the data easier to use in applications. After all, these are just JSON files, not a relational database where we can nicely get the data we want.\n\n### Combine courses\n\nFirst, merge all courses into a single JSON file by running\n\n```bash\ndeno task combine-courses\n```\n\n### Terms to subject/courses (#24)\n\nMap each term code to courses offered in that term. Each term has its own JSON file (`202340.json` for Summer I 2023) with a key for each subject code. The value is a list of courses (containing course `number` and a list `string[]` of CRNs)\n\n```ts\nexport interface TermSubjectCourseMapping {\n  [subjectCode: string]: { number: string; crns: string[] }[];\n}\n```\n\nRun\n\n```bash\ndeno task mapping:term-courses\n```\n\n### Format\n\nFinally, run \n\n```bash\ndeno task fmt:data\n```\n\n## Support\n\nIf you have any suggestions, please open an issue or pull request with your changes.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninest%2Fnu-courses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninest%2Fnu-courses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninest%2Fnu-courses/lists"}