lyon1tomussclient

Last updated:

0 purchases

lyon1tomussclient Image
lyon1tomussclient Images
Add to Cart

Description:

lyon1tomussclient

📚 lyon1tomussclient #
A Dart library for interacting with Tomuss, Lyon 1 University's academic platform, using Lyon1CasClient for authentication.
✨ Features #

Authenticate users with Lyon 1 CAS credentials.
Retrieve academic information from Lyon 1 Tomuss.
Access grades, teaching units, masters, and more.

⚙️ Installation #
Add the following to your project's pubspec.yaml file:
dependencies:
lyon1tomussclient: any
lyon1casclient: any
copied to clipboard
🔒 Usage #
Start by importing the required libraries:
import 'package:dartus/tomuss.dart';
import 'package:lyon1_casclient/lyon1_cas.dart';
copied to clipboard
Then, use the Lyon1Cas class to authenticate a user with their Lyon 1 CAS credentials. After authentication, create a new instance of the Dartus class with the Lyon 1 CAS object:
void main() async {
Lyon1Cas lyon1Cas = Lyon1Cas();
final bool isAuthenticated = (await lyon1Cas.authenticate(Credential("p1234567", "a_valid_password"))).authResult;

if (!isAuthenticated) {
print("You are not authenticated. Please check your username and password");
return;
}

final Dartus tomuss = Dartus(lyon1Cas);

final ParsedPage? parsedPageOpt = await tomuss.getParsedPage(Dartus.currentSemester());

if (parsedPageOpt == null) {
print("There was an error while fetching Tomuss");
return;
}

final ParsedPage parsedPage = parsedPageOpt;

// List teaching units
for (final TeachingUnit tu in parsedPage.teachingunits!) {
print(tu.title);
print("\tGrades:");
for (final Grade g in tu.grades) {
print("\t\t${g.title}: ${g.numerator}/${g.denominator}");
}

// List masters for the current TU
print("\tMasters:");
for (final Teacher t in tu.masters) {
print("\t\t${t.name} (${t.email})");
}
}

// List semesters
for (final Semester s in parsedPage.semesters!) {
print("${s.title} (${s.url})");
}
}
copied to clipboard
Make sure to replace "p1234567" with the actual Lyon 1 CAS username and "a_valid_password" with the corresponding password.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.