https://github.com/jeremyephron/explore-courses-api
A Python API for Stanford's Explore Courses
https://github.com/jeremyephron/explore-courses-api
api python python3 stanford-university
Last synced: 6 months ago
JSON representation
A Python API for Stanford's Explore Courses
- Host: GitHub
- URL: https://github.com/jeremyephron/explore-courses-api
- Owner: jeremyephron
- License: mit
- Created: 2018-07-01T11:28:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-24T19:01:34.000Z (about 5 years ago)
- Last Synced: 2026-01-14T12:24:00.593Z (6 months ago)
- Topics: api, python, python3, stanford-university
- Language: Python
- Size: 24.4 KB
- Stars: 14
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Stanford Explore Courses Python API #
This package is a Python API for Stanford's Explore Courses site, which enables users to search through Stanford's catalog of over **13,000 courses**.
## Installation ##
Type the following command in terminal to install:
`pip install explorecourses`
## Usage ##
Import the package's classes into your Python program:
`from explorecourses import *`
Import the filters module if you would like to use search filters:
`from explorecourses import filters`
Create a new CourseConnection:
`connect = CourseConnection()`
Query the Explore Courses database by department code:
`courses = connect.get_courses_by_department("MATH", year="2017-2018")`
Apply filters to your query:
`courses = connect.get_courses_by_query("all courses", filters.AUTUMN, filters.WAY_AII)`
## Sample Program ##
```python
from explorecourses import *
from explorecourses import filters
connect = CourseConnection()
# Print out all courses for 2017-2018.
year = "2017-2018"
for school in connect.get_schools(year):
for dept in school.departments:
courses = connect.get_courses_by_department(dept.code, year=year)
for course in courses:
print(course)
```
## Thanks ##
Thanks to Jim Sproch who wrote Stanford's Explore Courses Java API.