diff --git a/powerapi/user.py b/powerapi/user.py
index 325b742..b6d1f0d 100644
--- a/powerapi/user.py
+++ b/powerapi/user.py
@@ -17,10 +17,31 @@ def _createCourses(self):
return courses
- def getSchoolName(self):
+ def getName(self):
+ #get the name in format "Last, First Middle" from the page's html
+ name = re.search(r'
Grades and Attendance: (.*?)
', self.homeContents, re.S).groups()[0].strip()
+
+ #get the last name
+ lastName = re.search(r'(.*), ', name).groups()[0].strip()
+
+ #get the first name by removing the last name from the 'name' string
+ firstName = re.sub(r'(.*), ', '', name)
+
+ #concatenate the first and last names
+ name = firstName + " " + lastName
+
+ #return the name in the format "First Middle Last"
+ return name
+
+ def getSchoolDistrictName(self):
name = re.search(r'(.*?)
', self.homeContents, re.S)
return name.groups()[0].strip()
+
+ def getSchoolName(self):
+ name = re.search(r'
.*?
(.*?)
', self.homeContents, re.S)
+
+ return name.groups()[0].strip()
def getUserName(self):
name = re.search(r'
(.*?)<\/span>', self.homeContents, re.S)
@@ -28,4 +49,4 @@ def getUserName(self):
return name.groups()[0].strip()
def getCourses(self):
- return self.courses
\ No newline at end of file
+ return self.courses