def people(): if request.headers.get('X-Forwarded-Proto') == "http": return redirect(request.url.replace('http://', 'https://', 1), code=301) if not _has_needed_post(("sid",)): return login() banner.loadstate(base64.b64decode(request.form["sid"].encode('ASCII'))) if _has_needed_post(("term",)): banner.termset(request.form["term"]) ## codes = banner.searchcodes() ## ret = [] _header(ret, 'Select People') ret.append('<form action="search" method="POST">') ret.append('<input type="hidden" name="sid" value="{}" />'.format(base64.b64encode(banner.savestate()).decode('ASCII'))) ret.append('<div class="form-group">') ret.append('<label id="profs">Faculty</label>') ret.append('<select id="profs" name="profs" multiple="multiple" size="20" class="form-control">') for code,name in sorted(codes["sel_instr"].items(), key=operator.itemgetter(1)): if name != "All": ret.append('<option value="{}">{}</option>'.format(html.escape(code + '|' + name), html.escape(name))) ret.append('</select>') ret.append('</div>') ret.append('<div class="form-group">') ret.append('<label id="students">NUIDs (separated by whitespace)</label>') ret.append('<textarea id="students" name="students" rows="20" class="form-control">') ret.append('</textarea>') ret.append('</div>') ret.append('<input type="submit" class="btn btn-primary" value="Submit" />') ret.append('</form>') _footer(ret) return _out(ret)
from neubanner import banner import pprint ############################################################################## ############################################################################## TERM = '201930' STUDID = ['001834647'] banner.login() banner.termset(TERM) for ids in STUDID: banner.idset(banner.getxyz_studid(ids)) data = banner.studenttranscript() if data is not None: print(data)
summary = banner.summaryclasslist() for student in summary: print(student['name_lastfirst']) banner.idset(student['xyz']) _demo_studentschedule(banner.studentschedule(), student['xyz'], days) _demo_schedulelatex(days, len(summary)) ############################################################################## ############################################################################## banner.login() banner.termset("201830") codes = banner.searchcodes() # X's instructor code def find_instructor(iname): global codes iname = iname.lower() for icode, instr in codes['sel_instr'].items(): if iname in instr.lower(): return icode sections = banner.sectionsearch(instructor=[find_instructor('Derbinsky')],
from neubanner import banner import pprint ############################################################################## ############################################################################## if banner.login(): banner.termset('202110') # known crn sections = [ { 'crn' : '15177', 'section' : '02'}, { 'crn' : '13902', 'section' : '03'} ] for section in sections: print(section['crn']) banner.crnset(section['crn']) for student in banner.summaryclasslist(): print(student["name_lastfirst"]) banner.idset(banner.getxyz_studid(student["nuid"])) termsdata = banner.studenttranscript()["terms"] for term_data in termsdata: if term_data["term"] == "Fall 2020 Semester": for course in term_data["courses"]: if course["course"] == "4500": print(course["grade"]) else: print("Login Error!")
from neubanner import banner import pprint ############################################################################## ############################################################################## banner.login() banner.termset('201830') codes = None # X's instructor code def find_instructor(iname): global codes if codes is None: codes = banner.searchcodes() iname = iname.lower() for icode, instr in codes['sel_instr'].items(): if iname in instr.lower(): return icode def csvout(*args): return ",".join(['"{}"'.format(a) for a in args]) pp = pprint.PrettyPrinter(indent=4)