-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
455 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
__pycache__ | ||
dist | ||
HAC_API.egg-info | ||
src/home_access_center_api.egg-info | ||
src/home_access_center_api.egg-info | ||
src/hacapi.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" | ||
[project] | ||
name = "home-access-center-api" | ||
version = "0.1" | ||
name = "hacapi" | ||
version = "0.2" | ||
authors = [ | ||
{ name="Nazchanel", email="[email protected]" }, | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
# Importing the modules | ||
# from file_modification import clear_files, returnGradeTables | ||
# from login import login, getTime | ||
# from grades import initializeClasses, returnGrades | ||
# from notification import isUpdated | ||
# from test import userInput | ||
|
||
# Initalization | ||
# print("--------------------------------------------\n\tWelcome to the HAC API!\n--------------------------------------------") | ||
# print(" https://github.com/Nazchanel") | ||
# print() | ||
# print("\t Version: 1.0.0") | ||
# print("\t Date: 4/01/2023") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
import json | ||
import pandas as pd | ||
import session | ||
|
||
def returnQuarterAssignmentsHTML(quarter): | ||
session_requests = session.session_requests | ||
|
||
urls = "https://hac.friscoisd.org/HomeAccess/Content/Student/Assignments.aspx" | ||
|
||
initial_html = session_requests.get(urls, headers=dict(referer=urls)) | ||
|
||
with open(f'payloads/{quarter}.json', 'r') as file: | ||
json_str = file.read() | ||
json_obj = json.loads(json_str) | ||
|
||
specific_quarter = session_requests.post(urls, data=json_obj,headers=dict(referer=urls)) | ||
|
||
df = pd.read_html(specific_quarter.text) | ||
|
||
specific_quarter.html = df.to_html() | ||
|
||
index_list = [] | ||
|
||
for i in range(len(df)): | ||
if len(df[i].columns) == 10: | ||
index_list.append(i) | ||
|
||
html_list = [] | ||
|
||
for i in index_list: | ||
html_list.append(df[i].to_html()) | ||
|
||
return html_list | ||
|
||
|
||
def returnQuarterAssignmentsDataFrame(quarter): | ||
session_requests = session.session_requests | ||
|
||
urls = "https://hac.friscoisd.org/HomeAccess/Content/Student/Assignments.aspx" | ||
|
||
with open(f'payloads/{quarter}.json', 'r') as file: | ||
json_str = file.read() | ||
json_obj = json.loads(json_str) | ||
|
||
specific_quarter = session_requests.post(urls, data=json_obj,headers=dict(referer=urls)) | ||
df = pd.read_html(specific_quarter.text) | ||
|
||
index_list = [] | ||
df_list = [] | ||
|
||
for i in range(len(df)): | ||
if len(df[i].columns) == 10: | ||
index_list.append(i) | ||
|
||
for i in index_list: | ||
df_list.append(df[i]) | ||
|
||
return df_list | ||
|
||
def returnCurrentAssignments(): | ||
session_requests = session.session_requests | ||
session.return_to_current() | ||
|
||
urls = "https://hac.friscoisd.org/HomeAccess/Content/Student/Assignments.aspx" | ||
|
||
result = session_requests.get(urls, headers=dict(referer=urls)) | ||
df = pd.read_html(result.text) | ||
|
||
index_list = [] | ||
df_list = [] | ||
|
||
for i in range(len(df)): | ||
if len(df[i].columns) == 10: | ||
index_list.append(i) | ||
|
||
for i in index_list: | ||
df_list.append(df[i]) | ||
|
||
return df_list |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.