Ejemplo n.º 1
0
def demo_comp1000info(term, instructors=None):
	codes = banner.sectioncodes(term)
	schedules = {name:code for code,name in codes["schedules"].items()}

	params = {"term":term, "subjects":["COMP"], "num":"1000", "schedules":[schedules['Lecture']]}
	if instructors is not None:
		profs = {name:code for code,name in codes["instructors"].items()}
		params["instructors"] = [profs[p] for p in instructors]

	banner.termset(term)
	sections = banner.sectionsearch(**params)
	if sections is not None:
		emails = []
		comp1000 = [s["crn"] for s in sections]
		for s in comp1000:
			print("Querying {}...".format(s))
			crn = banner.crnset(s)
			if crn is not None:
				print(" Getting students")
				students = banner.summaryclasslist()
				if students is not None:
					print(" Grabbing e-mails")
					for student in students:
						emails.append((student["email"] + " | " + student["email"].split("@")[0] + " | " + student["name_firstfirst"]))
	print("\n".join(emails))
Ejemplo n.º 2
0
def main(argv):
    sid = argv[1] if len(argv) is 2 else None
    initialized = False
    while not initialized:
        initialized, sid = banner.init(sid=sid), None

    term = "201710"
    wid = "W00243758"
    xyz = banner.getxyz_wid(term, wid)

    banner.termset(term)
    banner.idset(xyz)

    scores = banner.studenttestscores()
    print(scores)

    print(banner.lastid())
Ejemplo n.º 3
0
def _demo_studentschedule(term, students, days):
    banner.termset(term)

    for student in students:
        xyz = banner.getxyz_wid(term, student)
        banner.idset(xyz)

        schedule = banner.studentschedule()
        for entry in schedule:
            for meeting in entry["meetings"]:
                for day in meeting["days"]:
                    for tf in range(
                            _demo_time_to_index(meeting["times"][0], True),
                            _demo_time_to_index(meeting["times"][1], False) +
                            1, 5):
                        if tf >= 80 and tf < 200:
                            days[day][tf].add(student)
Ejemplo n.º 4
0
def main(argv):
	sid=argv[1] if len(argv) is 2 else None
	initialized = False
	while not initialized:
		initialized,sid = banner.init(sid=sid),None

	term = "201710"
	# wid = "W00237397"
	wid = "W00316837"
	xyz = banner.getxyz_wid(term, wid)

	banner.termset(term)
	banner.idset(xyz)
	
	transcript = banner.studenttranscript()
	print("{}: {}".format(transcript["info"]["Name"][0], findgrade(transcript, "ENGL", "100")))
	
	print(banner.lastid())
Ejemplo n.º 5
0
def main(argv):
    sid = argv[1] if len(argv) is 2 else None
    initialized = False
    while not initialized:
        initialized, sid = banner.init(sid=sid), None

    term = "201710"
    wid = "W00365715"
    xyz = banner.getxyz_wid(term, wid)

    banner.termset(term)
    banner.idset(xyz)

    transcript = banner.studenttranscript()
    gpa = transcript["totals"]["overall"]["gpa"] if "overall" in transcript[
        "totals"] else "unknown"
    print("{}: {}".format(transcript["info"]["Name"][0], gpa))

    print(banner.lastid())
Ejemplo n.º 6
0
def _demo_facultyschedule(term, instructors, days):
    codes = banner.sectioncodes(term)
    profs = {name: code for code, name in codes["instructors"].items()}

    params = {"term": term, "subjects": codes["subjects"].keys()}
    params["instructors"] = [profs[p] for p in instructors]

    banner.termset(term)
    sections = banner.sectionsearch(**params)

    for section in sections:
        for classmtg in section["class"]:
            if classmtg[1].find("-") is not -1:
                tfrom, tto = classmtg[1].split("-")
                for day in (d for d in classmtg[0] if d in days):
                    for tf in range(_demo_time_to_index(tfrom, True),
                                    _demo_time_to_index(tto, False) + 1, 5):
                        if tf >= 80 and tf < 200:
                            days[day][tf].add(section["instructor"])
Ejemplo n.º 7
0
def demo_comp1000emails(term, instructor):
	codes = banner.sectioncodes(term)
	schedules = {name:code for code,name in codes["schedules"].items()}
	profs = {name:code for code,name in codes["instructors"].items()}

	params = {"term":term, "subjects":["COMP"], "num":"1000", "schedules":[schedules['Lecture']], "instructors":[profs[instructor]]}

	banner.termset(term)
	sections = banner.sectionsearch(**params)
	if sections is not None:
		for section in sections:
			crn = section["crn"]
			s = section["section"]
			print("Section {} ({})".format(s, crn))
			crn = banner.crnset(crn)
			if crn is not None:
				students = banner.summaryclasslist()
				if students is not None:
					for student in students:
						print(student["email"])
Ejemplo n.º 8
0
def demo_userinfo(emailsonly, term, prefix, num, instructors=None):
    codes = banner.sectioncodes(term)
    schedules = {name: code for code, name in codes["schedules"].items()}

    params = {
        "term": term,
        "subjects": [prefix],
        "num": num,
        "schedules": [schedules['Lecture']]
    }
    if instructors is not None:
        profs = {name: code for code, name in codes["instructors"].items()}
        params["instructors"] = [profs[p] for p in instructors]

    banner.termset(term)
    sections = banner.sectionsearch(**params)
    if sections is not None:
        emails = []
        print("Querying... ", end="")
        sys.stdout.flush()
        for s in sections:
            print("s{}={}".format(s["section"], s["crn"]), end=" ")
            sys.stdout.flush()
            crn = banner.crnset(s["crn"])
            if crn is not None:
                # Getting students
                students = banner.summaryclasslist()
                if students is not None:
                    # Grabbing info
                    for student in students:
                        if emailsonly:
                            emails.append(student["email"])
                        else:
                            emails.append((student["email"] + " | " +
                                           student["email"].split("@")[0] +
                                           " | " + student["name_firstfirst"]))
        print()
        print("\n".join(emails))
Ejemplo n.º 9
0
def demo_adviseeemails(term):
    banner.termset(term)
    print(";".join([x["email"] for x in banner.adviseelisting()]))