Skip to content

Commit 51f9f23

Browse files
Your NameYour Name
authored andcommitted
modified: Readme.md
modified: Stand_ Alone_ Python_ Scripts/transcripts_output_pt1_script.py
1 parent 7240cac commit 51f9f23

File tree

2 files changed

+48
-29
lines changed

2 files changed

+48
-29
lines changed

Readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[![GitHub contributors](https://img.shields.io/github/contributors/code4sac/learning-blocks)](https://github.com/code4sac/learning-blocks/graphs/contributors)
44
[![GitHub forks](https://img.shields.io/github/forks/code4sac/learning-blocks)](https://github.com/code4sac/learning-blocks/network/members)
55

6-
## Welcome to this open-source project dedicated to helping developers make API tools for student support service providers. The goal is for student support service providers to gain access to student informational systems. This repository has a couple of ways to do that depending on your level of expertise and depending on your intended use.
6+
## Welcome to this open-source project dedicated to helping developers make API tools for student support service providers. The educational data ecosysem comprises primarily of SFTP servers and API calls to databases. The goal is to help student support service providers to gain access ecosystems and make sense of them all the data.
7+
8+
## Because people looking at this repo has different levels of skill, this repository has a couple of ways to do that depending on your level of expertise and depending on your intended use.
79

810
### If you are a student support service provider trying to use these tools, please read [this documentation](https://github.com/code4sac/learning-blocks/blob/main/Documentation%20Directory/SSSP_Read_Me.md) However, you will need to reach out to your LEA's Database Coordinator for the following information:
911

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
1+
#!/usr/bin/env python3
2+
"""
3+
get_school_info.py
4+
5+
A self-contained script to fetch school metadata (School ID 994) from the Aeries demo API.
6+
Replace the placeholder values below with your actual Aeries instance URL and API certificate.
7+
"""
8+
19
import requests
2-
import json
3-
API_HOST = "https://demo.aeries.net/aeries/admin/api/v3/schools/520/students/grade/11"
4-
requestHeaders = {"formatType":"application/json", \
5-
"AERIES-CERT":"insert cert key here"}
610

7-
def reqpull():
11+
# ─── CONFIGURATION ──────────────────────────────────────────────────────────────
12+
13+
# Base URL for your Aeries instance (no trailing slash)
14+
AERIES_BASE = "https://demo.aeries.net/aeries"
15+
16+
# Your 32-character Aeries API certificate (case-sensitive)
17+
API_KEY = "477abe9e7d27439681d62f4e0de1f5e1"
18+
19+
# The school ID you wish to fetch
20+
SCHOOL_ID = "994"
21+
22+
# ─── END CONFIGURATION ──────────────────────────────────────────────────────────
23+
24+
def get_school_info(base_url: str, cert: str, school_id: str) -> None:
825
"""
9-
DEMO API: 477abe9e7d27439681d62f4e0de1f5e1
10-
DOCUMENTATION: https://support.aeries.com/support/solutions/articles/14000077926-aeries-api-full-documentation#aeries-api-h5
11-
:return:
26+
Fetches and prints metadata for the given school ID.
1227
"""
13-
request = requests.get(API_HOST, headers = requestHeaders)
14-
r1= request.json()
15-
16-
q=[]
17-
a=[]
18-
for q in r1:
19-
a.append(q['PermanentID'])
20-
print("The Permenant ID's for this grade level are")
21-
print(a)
22-
#if you want just the perm ID's delete below
23-
for i in a:
24-
API_HOST1 = "https://delnorte.asp.aeries.net/admin/api/v3/schools/520/Transcript/"+x
25-
requestHeaders1={"formatType":"application/json", \
26-
"AERIES-CERT":"insert vert key here"}
27-
request1 = requests.get(API_HOST1, headers = requestHeaders1)
28-
r2= request1.json()
29-
print("Printing each transcript may take a while so i am going to make it better")
30-
print(r2)
31-
32-
28+
url = f"{base_url}/api/v5/schools/{school_id}/gpas"
29+
headers = {
30+
"AERIES-CERT": cert,
31+
"Accept": "application/json"
32+
}
33+
34+
response = requests.get(url, headers=headers)
35+
if response.status_code == 200:
36+
school_data_list = response.json()
37+
if isinstance(school_data_list, list) and school_data_list:
38+
school_data = school_data_list[0] # Take the first item as a dictionary
39+
print("School Information:")
40+
for key, value in school_data.items():
41+
print(f" {key}: {value}")
42+
else:
43+
print("No school data found.")
44+
print("Number of Students found:", len(school_data_list))
45+
else:
46+
print(f"Error {response.status_code}: {response.text}")
47+
48+
if __name__ == "__main__":
49+
get_school_info(AERIES_BASE, API_KEY, SCHOOL_ID)

0 commit comments

Comments
 (0)