Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMoonThatRises committed Aug 18, 2024
1 parent e53ef89 commit e0d684b
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

Swift library for interacting with StudentVue's api. This project was heavily influenced by [StudentVue.js](https://github.com/StudentVue/StudentVue.js) and relied on information provided by their [documentation](https://github.com/StudentVue/docs). This library is still a work in progress and if you encounter an issue, feel free to create an [issue](https://github.com/TheMoonThatRises/StudentVue.swift/issues/new) or submit a [pull request](https://github.com/TheMoonThatRises/StudentVue.swift/pulls).

## Documentation

https://themoonthatrises.github.io/documentation/studentvue/

## Installation

```swift
Expand Down Expand Up @@ -45,34 +49,12 @@ try await client.scraper.login() // Log into StudentVue. NOTE: login returns gra
try await client.scraper.logout() // Log out of StudentVue. Returns boolean indicating success
```

You can use the built-in scraper parser to parse specific endpoints. These structs are in the `StudentVueScraper` class and has the `html` parameter for html to parse. Some will include `client` which is of class `StudentVue` which may be used to access additional helper pieces of information.

```swift
try await StudentVueScraper.GradeBook(html: try await client.scraper.login(), client: client) // Returns gradebook in an array of `ClassData`
```

If you require a struct to be Hashable (for iterating in UI), you can create an extension like this:
You can use the built-in scraper parser to parse specific endpoints. These structs are in the `StudentVueScraper` class and has the `html` parameter for html to parse. Some will include `client` which is of class `StudentVueScraper` which may be used to access additional helper pieces of information. Some endpoints will have built-in class structures

```swift
extension StudentVueApi.DistrictInfo: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(districtID)
}

public static func == (lhs: StudentVueApi.DistrictInfo, rhs: StudentVueApi.DistrictInfo) -> Bool {
lhs.districtID == rhs.districtID
}
}
try await client.getCourseHistory() // Returns course history
```

## Todo List

- [ ] A website for documentation
- [ ] More complete structures for returned data
- [ ] Use the WSDL file to help with the data structure
- [ ] Use a proper SOAP handler instead of the "hacky" solution
- [ ] More complete scraper parser - In progress

## Library Used

- [SWXMLHash](https://github.com/drmohundro/SWXMLHash)
Expand Down

0 comments on commit e0d684b

Please sign in to comment.