{"id":18477850,"url":"https://github.com/themoonthatrises/studentvue.swift","last_synced_at":"2025-04-08T15:31:39.168Z","repository":{"id":153634858,"uuid":"622423247","full_name":"TheMoonThatRises/StudentVue.swift","owner":"TheMoonThatRises","description":"An easy-to-use, fully documented, Swift StudentVue library.","archived":false,"fork":false,"pushed_at":"2024-12-16T17:37:20.000Z","size":179,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-23T15:43:26.417Z","etag":null,"topics":["api","scraper","studentvue","swift"],"latest_commit_sha":null,"homepage":"https://plduanm.com/projects/documentation/studentvue/","language":"Swift","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/TheMoonThatRises.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-02T04:01:35.000Z","updated_at":"2025-03-21T22:20:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6ac9b1c-0115-4d07-ab8a-88a8dc8fa0bc","html_url":"https://github.com/TheMoonThatRises/StudentVue.swift","commit_stats":{"total_commits":56,"total_committers":1,"mean_commits":56.0,"dds":0.0,"last_synced_commit":"abbc6b03cd5a6272a2dd09eed6d2fe5a95b76a39"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMoonThatRises%2FStudentVue.swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMoonThatRises%2FStudentVue.swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMoonThatRises%2FStudentVue.swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMoonThatRises%2FStudentVue.swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheMoonThatRises","download_url":"https://codeload.github.com/TheMoonThatRises/StudentVue.swift/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247871209,"owners_count":21010006,"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":["api","scraper","studentvue","swift"],"created_at":"2024-11-06T12:06:43.038Z","updated_at":"2025-04-08T15:31:39.148Z","avatar_url":"https://github.com/TheMoonThatRises.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StudentVue.swift\n\n![Supported Platforms](https://img.shields.io/badge/platform-ios%20%7C%20macos-lightgrey.svg?style=flat)\n[![MIT](https://img.shields.io/github/license/TheMoonThatRises/StudentVue.swift.svg?style=flat)](https://github.com/TheMoonThatRises/StudentVue.swift)\n\nSwift 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).\n\nCheckout this project in action here: [**PortalBook** by TheMoonThatRises](https://github.com/TheMoonThatRises/PortalBook)\n\n## Documentation\n\nRead the documentation here: [https://plduanm.com/projects/documentation/studentvue/](https://plduanm.com/projects/documentation/studentvue/)\n\n## Installation\n\n```swift\n.package(url: \"https://github.com/TheMoonThatRises/StudentVue.swift\", from: \"1.0.0\")\n```\n\n## Basic usage\n\n### Logging in as a student\n\nTo create a client instance, use:\n\n```swift\nimport StudentVue\n\nlet client = StudentVue(domain: \"something.edupoint.com\", username: \"123456789\", password: \"password\")\n```\n\nWith the client initialized, you can access information from the official api by using the provided functions such as `getGradeBook`, `getClassSchedule`, `getSchoolInfo`, and many more. If one of the functions fails to parse or you want to access information in which a data structure is not created, you can call the `makeServiceRequest` and parse the XML manually.\n\n```swift\nlet gradebook = try await client.api.getGradeBook()\n```\n\nFor checking the validity of credentials use the `checkCredentials` method in the API. This method is the fastest way to check the validity of the input credentials, and should resolve in about 0.7 seconds.\n\n```swift\nlet isCredentialsValid = try await client.api.checkCredentials()\n```\n\nYou 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\n\n```swift\ntry await client.scraper.getCourseHistory() // Returns course history\n```\n\nLower level access is possible through both the API and the Scraper. Read the documentation for more information about available methods. If the specific endpoint you are looking for is not incorporated in the endpoint or methods enum, you can extend the enum and add more. More methods and endpoints can be discovered by installing the official StudentVUE app and running MITMProxy.\n\n```swift\nextension StudentVueApi.Methods {\n    static let anotherMethod = StudentVueApi.Methods(rawValue: \"AnotherMethod\")\n}\n\nif let anotherMethod = StudentVueApi.Methods.anotherMethod {\n    let item = try await client.api.makeServiceRequest(methodName: anotherMethod)\n}\n\ntry await client.scraper.autoThrowApi(endpoint: .attendance)\n```\n\n### Static functions\n\nFor some functions, logging in is not required, such as getting district zip codes. Note that `getDistricts` is an endpoint that has rate limits, so be careful when using it with updating UI.\n\n```swift\nlet districts = try await client.api.getDistricts(zip: \"a zip code\")\n```\n\nYou can also use the scraper which gives more information and functionality, but is not fully implemented. The line below that will log the scraper in and out of StudentVue. More and easier functionality will be added to the scraper in the future.\n\n```swift\ntry await client.scraper.login() // Log into StudentVue. NOTE: login returns gradebook html\n\ntry await client.scraper.logout() // Log out of StudentVue. Returns boolean indicating success\n```\n\nBecause the username and password are not publicly accessible variables within the library, a hash function is provided to check if the stored username, password, and domain combination is similar to others you may have stored.\n\n```swift\nlet hash = client.getAccountHash()\n```\n\n## Library Used\n\n1. [SWXMLHash](https://github.com/drmohundro/SWXMLHash) - Simple XML parsing in Swift\n1. [SwiftSoup](https://github.com/scinfu/SwiftSoup) - SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemoonthatrises%2Fstudentvue.swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemoonthatrises%2Fstudentvue.swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemoonthatrises%2Fstudentvue.swift/lists"}