Skip to content

Commit 7034dcc

Browse files
committed
Initial release: SchoolDigger Python SDK v1.0.0
0 parents  commit 7034dcc

128 files changed

Lines changed: 16931 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/regenerate.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Regenerate SDK
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Package version (e.g., 1.1.0)'
8+
required: true
9+
10+
jobs:
11+
regenerate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Java (required by openapi-generator)
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '17'
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.12'
31+
32+
- name: Install tools
33+
run: |
34+
npm install -g @openapitools/openapi-generator-cli swagger2openapi
35+
pip install build twine
36+
37+
- name: Download latest spec
38+
run: curl -o swagger.json https://api.schooldigger.com/swagger/docs/v2.3
39+
40+
- name: Convert to OpenAPI 3.0
41+
run: npx swagger2openapi swagger.json -o openapi-latest.json
42+
43+
- name: Apply patches
44+
run: node patch-spec.js openapi-latest.json openapi-patched.json
45+
46+
- name: Generate SDK
47+
run: |
48+
openapi-generator-cli generate \
49+
-i openapi-patched.json \
50+
-g python \
51+
-o . \
52+
--package-name schooldigger \
53+
--additional-properties=packageVersion=${{ github.event.inputs.version }},projectName=schooldigger
54+
55+
- name: Build and publish
56+
env:
57+
TWINE_USERNAME: __token__
58+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
59+
run: |
60+
python -m build
61+
twine upload dist/*
62+
63+
- name: Commit updated spec and generated code
64+
run: |
65+
git config user.name "github-actions"
66+
git config user.email "github-actions@github.com"
67+
git add openapi-patched.json schooldigger/
68+
git commit -m "Regenerate SDK v${{ github.event.inputs.version }}" || echo "No changes to commit"
69+
git push

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__pycache__/
2+
*.py[cod]
3+
*$py.class
4+
*.egg-info/
5+
dist/
6+
build/
7+
*.egg
8+
.eggs/
9+
.venv/
10+
venv/
11+
.tox/
12+
.pytest_cache/

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.gitlab.com/ee/ci/README.html
5+
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
6+
7+
stages:
8+
- test
9+
10+
.pytest:
11+
stage: test
12+
script:
13+
- pip install -r requirements.txt
14+
- pip install -r test-requirements.txt
15+
- pytest --cov=schooldigger
16+
17+
pytest-3.9:
18+
extends: .pytest
19+
image: python:3.9-alpine
20+
pytest-3.10:
21+
extends: .pytest
22+
image: python:3.10-alpine
23+
pytest-3.11:
24+
extends: .pytest
25+
image: python:3.11-alpine
26+
pytest-3.12:
27+
extends: .pytest
28+
image: python:3.12-alpine
29+
pytest-3.13:
30+
extends: .pytest
31+
image: python:3.13-alpine

.openapi-generator-ignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
README.md
2+
LICENSE
3+
.github/**
4+
.gitignore
5+
pyproject.toml
6+
setup.py
7+
setup.cfg

.openapi-generator/FILES

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.gitlab-ci.yml
2+
.travis.yml
3+
docs/APIAutocompleteDistrictResult.md
4+
docs/APIAutocompleteSchoolResult23.md
5+
docs/APIBoundary12.md
6+
docs/APIChronicAbsenteeismRate.md
7+
docs/APICounty.md
8+
docs/APIDistrictAC.md
9+
docs/APIDistrictFull21.md
10+
docs/APIDistrictList21.md
11+
docs/APIDistrictListRank21.md
12+
docs/APIDistrictSum.md
13+
docs/APIDistrictSummary21.md
14+
docs/APIDropoutRate.md
15+
docs/APIGraduationRate.md
16+
docs/APILEARankHistory.md
17+
docs/APILEAYearlyDetail.md
18+
docs/APILatLong.md
19+
docs/APILocation.md
20+
docs/APIPolyline.md
21+
docs/APIRankHistory.md
22+
docs/APISchoolAC23.md
23+
docs/APISchoolFinance.md
24+
docs/APISchoolFull22.md
25+
docs/APISchoolList22.md
26+
docs/APISchoolListRank21.md
27+
docs/APISchoolReview.md
28+
docs/APISchoolSummary21.md
29+
docs/APISchoolSummary22.md
30+
docs/APITestScore.md
31+
docs/APITestScoreWrapper.md
32+
docs/APIYearlyDemographics.md
33+
docs/AutocompleteApi.md
34+
docs/DistrictsApi.md
35+
docs/RankingsApi.md
36+
docs/SchoolsApi.md
37+
git_push.sh
38+
requirements.txt
39+
schooldigger/__init__.py
40+
schooldigger/api/__init__.py
41+
schooldigger/api/autocomplete_api.py
42+
schooldigger/api/districts_api.py
43+
schooldigger/api/rankings_api.py
44+
schooldigger/api/schools_api.py
45+
schooldigger/api_client.py
46+
schooldigger/api_response.py
47+
schooldigger/configuration.py
48+
schooldigger/exceptions.py
49+
schooldigger/models/__init__.py
50+
schooldigger/models/api_autocomplete_district_result.py
51+
schooldigger/models/api_autocomplete_school_result23.py
52+
schooldigger/models/api_boundary12.py
53+
schooldigger/models/api_chronic_absenteeism_rate.py
54+
schooldigger/models/api_county.py
55+
schooldigger/models/api_district_ac.py
56+
schooldigger/models/api_district_full21.py
57+
schooldigger/models/api_district_list21.py
58+
schooldigger/models/api_district_list_rank21.py
59+
schooldigger/models/api_district_sum.py
60+
schooldigger/models/api_district_summary21.py
61+
schooldigger/models/api_dropout_rate.py
62+
schooldigger/models/api_graduation_rate.py
63+
schooldigger/models/api_lat_long.py
64+
schooldigger/models/api_location.py
65+
schooldigger/models/api_polyline.py
66+
schooldigger/models/api_rank_history.py
67+
schooldigger/models/api_school_ac23.py
68+
schooldigger/models/api_school_finance.py
69+
schooldigger/models/api_school_full22.py
70+
schooldigger/models/api_school_list22.py
71+
schooldigger/models/api_school_list_rank21.py
72+
schooldigger/models/api_school_review.py
73+
schooldigger/models/api_school_summary21.py
74+
schooldigger/models/api_school_summary22.py
75+
schooldigger/models/api_test_score.py
76+
schooldigger/models/api_test_score_wrapper.py
77+
schooldigger/models/api_yearly_demographics.py
78+
schooldigger/models/apilea_rank_history.py
79+
schooldigger/models/apilea_yearly_detail.py
80+
schooldigger/py.typed
81+
schooldigger/rest.py
82+
test-requirements.txt
83+
test/__init__.py
84+
test/test_api_autocomplete_district_result.py
85+
test/test_api_autocomplete_school_result23.py
86+
test/test_api_boundary12.py
87+
test/test_api_chronic_absenteeism_rate.py
88+
test/test_api_county.py
89+
test/test_api_district_ac.py
90+
test/test_api_district_full21.py
91+
test/test_api_district_list21.py
92+
test/test_api_district_list_rank21.py
93+
test/test_api_district_sum.py
94+
test/test_api_district_summary21.py
95+
test/test_api_dropout_rate.py
96+
test/test_api_graduation_rate.py
97+
test/test_api_lat_long.py
98+
test/test_api_location.py
99+
test/test_api_polyline.py
100+
test/test_api_rank_history.py
101+
test/test_api_school_ac23.py
102+
test/test_api_school_finance.py
103+
test/test_api_school_full22.py
104+
test/test_api_school_list22.py
105+
test/test_api_school_list_rank21.py
106+
test/test_api_school_review.py
107+
test/test_api_school_summary21.py
108+
test/test_api_school_summary22.py
109+
test/test_api_test_score.py
110+
test/test_api_test_score_wrapper.py
111+
test/test_api_yearly_demographics.py
112+
test/test_apilea_rank_history.py
113+
test/test_apilea_yearly_detail.py
114+
test/test_autocomplete_api.py
115+
test/test_districts_api.py
116+
test/test_rankings_api.py
117+
test/test_schools_api.py
118+
tox.ini

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.21.0

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "3.9"
5+
- "3.10"
6+
- "3.11"
7+
- "3.12"
8+
- "3.13"
9+
# uncomment the following if needed
10+
#- "3.13-dev" # 3.13 development branch
11+
#- "nightly" # nightly build
12+
# command to install dependencies
13+
install:
14+
- "pip install -r requirements.txt"
15+
- "pip install -r test-requirements.txt"
16+
# command to run tests
17+
script: pytest --cov=schooldigger

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 SchoolDigger
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SchoolDigger Python SDK
2+
3+
Official Python client for the [SchoolDigger API](https://developer.schooldigger.com) — K-12 school data for 120,000+ U.S. schools.
4+
5+
## Installation
6+
7+
```bash
8+
pip install schooldigger
9+
```
10+
11+
## Quick Start
12+
13+
```python
14+
import schooldigger
15+
16+
config = schooldigger.Configuration()
17+
config.api_key["appID"] = "YOUR_APP_ID"
18+
config.api_key["appKey"] = "YOUR_APP_KEY"
19+
20+
client = schooldigger.ApiClient(config)
21+
22+
# Search schools
23+
api = schooldigger.SchoolsApi(client)
24+
result = api.search_schools(st="WA", q="Lincoln")
25+
for school in result.school_list:
26+
print(f"{school.school_name}{school.address.city}, {school.address.state}")
27+
28+
# Get a specific school by SchoolDigger ID
29+
school = api.get_school("530966001632")
30+
print(f"Enrollment: {school.school_yearly_details[0].number_of_students}")
31+
```
32+
33+
## API Classes
34+
35+
| Class | Methods |
36+
|-------|---------|
37+
| `SchoolsApi` | `search_schools()`, `get_school()` |
38+
| `DistrictsApi` | `search_districts()`, `get_district()` |
39+
| `RankingsApi` | `get_school_rankings()`, `get_district_rankings()` |
40+
| `AutocompleteApi` | `autocomplete_schools()`, `autocomplete_districts()` |
41+
42+
## Authentication
43+
44+
All API calls require an `appID` and `appKey`. Get your free API key at [developer.schooldigger.com](https://developer.schooldigger.com).
45+
46+
## Documentation
47+
48+
- [API Reference](https://developer.schooldigger.com/docs)
49+
- [Get your free API key](https://developer.schooldigger.com)
50+
- [SchoolDigger.com](https://www.schooldigger.com)
51+
52+
## Plans
53+
54+
| Plan | Price | Highlights |
55+
|------|-------|------------|
56+
| DEV/TEST | Free | Enterprise-level access, 20 calls/day |
57+
| Basic | $19.90/mo | 1 year of data |
58+
| Pro | $89/mo | Boundaries, geo search, finance |
59+
| Enterprise | $189/mo | Full depth, boundary containment |
60+
61+
## License
62+
63+
MIT
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# APIAutocompleteDistrictResult
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**district_matches** | [**List[APIDistrictAC]**](APIDistrictAC.md) | List of the districts that match the query | [optional]
9+
10+
## Example
11+
12+
```python
13+
from schooldigger.models.api_autocomplete_district_result import APIAutocompleteDistrictResult
14+
15+
# TODO update the JSON string below
16+
json = "{}"
17+
# create an instance of APIAutocompleteDistrictResult from a JSON string
18+
api_autocomplete_district_result_instance = APIAutocompleteDistrictResult.from_json(json)
19+
# print the JSON string representation of the object
20+
print(APIAutocompleteDistrictResult.to_json())
21+
22+
# convert the object into a dict
23+
api_autocomplete_district_result_dict = api_autocomplete_district_result_instance.to_dict()
24+
# create an instance of APIAutocompleteDistrictResult from a dict
25+
api_autocomplete_district_result_from_dict = APIAutocompleteDistrictResult.from_dict(api_autocomplete_district_result_dict)
26+
```
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+
29+

0 commit comments

Comments
 (0)