genpeds 1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
genpeds-1.0/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2025 Ravan Hawrami
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.
genpeds-1.0/PKG-INFO ADDED
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.4
2
+ Name: genpeds
3
+ Version: 1.0
4
+ Summary: Work with NCES IPEDS data: from admissions to graduation
5
+ Author-email: Ravan Hawrami <ravanhawrami@gmail.com>
6
+ License-Expression: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.13.3
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.md
12
+ Requires-Dist: pandas
13
+ Requires-Dist: numpy
14
+ Requires-Dist: openpyxl
15
+ Requires-Dist: xlrd
16
+ Requires-Dist: requests
17
+ Requires-Dist: bs4
18
+ Requires-Dist: us
19
+ Dynamic: license-file
20
+
21
+ # genpeds
22
+ A Python package for working with NCES IPEDS data, particularly for studying trends by gender.
23
+
24
+ The Integrated Postsecondary Education Data System ([IPEDS](https://nces.ed.gov/ipeds/about-ipeds)), ran by the National Center for Education Statistics ([NCES](https://nces.ed.gov/)), is a collection of surveys annually conducted on a range of subjects, from finances and admissions to enrollment and graduation. All postsecondary institutions that participate in federal student aid financial aid programs are required to participate in these surveys.
25
+
26
+ Per [IPEDS](https://nces.ed.gov/ipeds/about-ipeds):
27
+ > "IPEDS provides basic data needed to describe — and analyze trends in — postsecondary education in the United States, in terms of the numbers of students enrolled, staff employed, dollars expended, and degrees earned. Congress, federal agencies, state governments, education providers, professional associations, private businesses, media, students and parents, and others rely on IPEDS data for this basic information on postsecondary institutions."
28
+
29
+ `genpeds` provides a Python API for requesting, and cleaning IPEDS data for a host of subject, particularly for studying college trends by gender.
30
+
31
+ ## Usage
32
+
33
+ ### Install
34
+ ```bash
35
+ pip install genpeds
36
+ ```
37
+
38
+ ### API
39
+
40
+ #### Downloading IPEDS Data
41
+ To just request IPEDS data, you can use the `scrape_ipeds_data()` standalone function:
42
+
43
+ ```python
44
+ from genpeds import scrape_ipeds_data
45
+
46
+ # ex. download Characteristics data for years 2013-2023:
47
+ scrape_ipeds_data(subject='characteristics',
48
+ year_range=(2013,2023),
49
+ see_progress=True)
50
+ # if see_progress==True, download confirmation statements will be printed
51
+
52
+ # for year_range param, you can pass (inclusive) tuple range, list of years, or single year
53
+ # ex. download enrollment data for 1980/1990 and 2015/2016:
54
+ scrape_ipeds_data(subject='enrollment',
55
+ year_range=[1980,1990,2015,2016],
56
+ see_progress=True)
57
+ # download completion data for 1990
58
+ scrape_ipeds_data(subject='completion',
59
+ year_range=1990,
60
+ see_progress=True)
61
+ ```
62
+
63
+ #### Subject Classes
64
+ If you'd also like to clean data in order to study trends, you can use the various subject classes; you can also just download data with these classes, so it's recommended to primarily use these classes.
65
+
66
+ ```python
67
+ from genpeds import Enrollment
68
+
69
+ enroll_20s = Enrollment(year_range=(2020,2023)) # enrollment data for the 20s
70
+
71
+ enroll_20s.get_description() # returns description of subject, enrollment in this case
72
+
73
+ enroll_20s.get_available_vars() # returns dict of var names and descriptions
74
+ ```
75
+
76
+ The key methods we'll be using 99% of the time are:
77
+
78
+ - `.scrape()`, which downloads subject data
79
+ - `.clean()`, which cleans subject data
80
+ - `.run()`, which downloads and cleans subject data (along with some further options)
81
+
82
+ ```python
83
+ from genpeds import Graduation
84
+
85
+ grad_aughts = Graduation(year_range=(2000,2009))
86
+
87
+ grad_aughts.scrape(see_progress=False) # downloads grad data for 2000-2009
88
+
89
+ grad_df = grad_aughts.clean(degree_level='bach',
90
+ rm_disk=True)
91
+ # .clean() returns a Pandas DataFrame
92
+ # degree_level specifies the level of graduation data
93
+ # rm_disk determines if previously downloaded data should be removed from disk after data is cleaned and returned in a DataFrame
94
+
95
+ grad_df = grad_aughts.run(degree_level='assc',
96
+ see_progress=False,
97
+ merge_with_char=True,
98
+ rm_disk=False)
99
+ # .run() downloads subject data, then cleans it
100
+ # returns Pandas DataFrame
101
+ # merge_with_char, if True, downloads Characteristics data (e.g., school names, addresses) and merges with subject data
102
+
103
+ # to look up variable descriptions, you can either use:
104
+ # .get_available_vars() -> dict
105
+ # .lookup_var() -> str
106
+ grad_aughts.lookup_var('gradrate_wtmen')
107
+ # returns: 'Graduation rate for non-Hispanic White men (within 150 percent of normal time taken to graduate).'
108
+ ```
109
+
110
+ ### Subjects
111
+ IPEDS [covers](https://nces.ed.gov/ipeds/about-ipeds) eight main subjects:
112
+ 1. Institutional Characteristics
113
+ 2. Admissions
114
+ 3. Enrollment
115
+ 4. Degrees and Certificates Conferred
116
+ 5. Student Persistence and Success
117
+ 6. Institutional Prices
118
+ 7. Student Financial Aid
119
+ 8. institutional Resources including Human, resources, Finance, and Academic Libraries
120
+
121
+ `genpeds` currently supports the first five subjects:
122
+
123
+ - **Characteristics** (e.g., school name, address, longitude/latitude, etc.) (available 1984-2023)
124
+ ```python
125
+ from genpeds import scrape_ipeds_data, Characteristics
126
+
127
+ scrape_ipeds_data(subject='characteristics',
128
+ year_range=(1984,2023))
129
+
130
+ chardat = Characteristics(year_range=(1984,2023))
131
+ ```
132
+ - **Admissions** (e.g., SAT/ACT scores, admit rates by gender, etc.) (available 2001-2023)
133
+ ```python
134
+ from genpeds import scrape_ipeds_data, Admissions
135
+
136
+ scrape_ipeds_data(subject='admissions',
137
+ year_range=(2001,2023))
138
+
139
+ admdat = Admissions(year_range=(2001,2023))
140
+ ```
141
+ - **Enrollment** (e.g., enrollment by race/gender/level, etc.) (available 1984-2023)
142
+ ```python
143
+ from genpeds import scrape_ipeds_data, Enrollment
144
+
145
+ scrape_ipeds_data(subject='enrollment',
146
+ year_range=(1984,2023))
147
+
148
+ enrolldat = Enrollment(year_range=(1984,2023))
149
+ ```
150
+ - **Completion** (e.g., degree completion by race/gender/subject/level, etc.) (available 1984-2023)
151
+ ```python
152
+ from genpeds import scrape_ipeds_data, Completion
153
+
154
+ scrape_ipeds_data(subject='completion',
155
+ year_range=(1984,2023))
156
+
157
+ completedat = Completion(year_range=(1984,2023))
158
+ ```
159
+ - **Graduation** (e.g., graduation rate by race/gender/level, etc.) (available 2000-2023)
160
+ ```python
161
+ from genpeds import scrape_ipeds_data, Graduation
162
+
163
+ scrape_ipeds_data(subject='graduation',
164
+ year_range=(2000,2023))
165
+
166
+ graddat = Graduation(year_range=(2000,2023))
167
+
168
+ grad_df = graddat.run(degree_level='bach',
169
+ merge_with_char=True)
170
+ ```
171
+
172
+ In the future, the remaining subjects will likely be added to `genpeds`. But just with the already provided subjects, you can study school-level trends for their male and female students, from admissions to completion.
genpeds-1.0/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # genpeds
2
+ A Python package for working with NCES IPEDS data, particularly for studying trends by gender.
3
+
4
+ The Integrated Postsecondary Education Data System ([IPEDS](https://nces.ed.gov/ipeds/about-ipeds)), ran by the National Center for Education Statistics ([NCES](https://nces.ed.gov/)), is a collection of surveys annually conducted on a range of subjects, from finances and admissions to enrollment and graduation. All postsecondary institutions that participate in federal student aid financial aid programs are required to participate in these surveys.
5
+
6
+ Per [IPEDS](https://nces.ed.gov/ipeds/about-ipeds):
7
+ > "IPEDS provides basic data needed to describe — and analyze trends in — postsecondary education in the United States, in terms of the numbers of students enrolled, staff employed, dollars expended, and degrees earned. Congress, federal agencies, state governments, education providers, professional associations, private businesses, media, students and parents, and others rely on IPEDS data for this basic information on postsecondary institutions."
8
+
9
+ `genpeds` provides a Python API for requesting, and cleaning IPEDS data for a host of subject, particularly for studying college trends by gender.
10
+
11
+ ## Usage
12
+
13
+ ### Install
14
+ ```bash
15
+ pip install genpeds
16
+ ```
17
+
18
+ ### API
19
+
20
+ #### Downloading IPEDS Data
21
+ To just request IPEDS data, you can use the `scrape_ipeds_data()` standalone function:
22
+
23
+ ```python
24
+ from genpeds import scrape_ipeds_data
25
+
26
+ # ex. download Characteristics data for years 2013-2023:
27
+ scrape_ipeds_data(subject='characteristics',
28
+ year_range=(2013,2023),
29
+ see_progress=True)
30
+ # if see_progress==True, download confirmation statements will be printed
31
+
32
+ # for year_range param, you can pass (inclusive) tuple range, list of years, or single year
33
+ # ex. download enrollment data for 1980/1990 and 2015/2016:
34
+ scrape_ipeds_data(subject='enrollment',
35
+ year_range=[1980,1990,2015,2016],
36
+ see_progress=True)
37
+ # download completion data for 1990
38
+ scrape_ipeds_data(subject='completion',
39
+ year_range=1990,
40
+ see_progress=True)
41
+ ```
42
+
43
+ #### Subject Classes
44
+ If you'd also like to clean data in order to study trends, you can use the various subject classes; you can also just download data with these classes, so it's recommended to primarily use these classes.
45
+
46
+ ```python
47
+ from genpeds import Enrollment
48
+
49
+ enroll_20s = Enrollment(year_range=(2020,2023)) # enrollment data for the 20s
50
+
51
+ enroll_20s.get_description() # returns description of subject, enrollment in this case
52
+
53
+ enroll_20s.get_available_vars() # returns dict of var names and descriptions
54
+ ```
55
+
56
+ The key methods we'll be using 99% of the time are:
57
+
58
+ - `.scrape()`, which downloads subject data
59
+ - `.clean()`, which cleans subject data
60
+ - `.run()`, which downloads and cleans subject data (along with some further options)
61
+
62
+ ```python
63
+ from genpeds import Graduation
64
+
65
+ grad_aughts = Graduation(year_range=(2000,2009))
66
+
67
+ grad_aughts.scrape(see_progress=False) # downloads grad data for 2000-2009
68
+
69
+ grad_df = grad_aughts.clean(degree_level='bach',
70
+ rm_disk=True)
71
+ # .clean() returns a Pandas DataFrame
72
+ # degree_level specifies the level of graduation data
73
+ # rm_disk determines if previously downloaded data should be removed from disk after data is cleaned and returned in a DataFrame
74
+
75
+ grad_df = grad_aughts.run(degree_level='assc',
76
+ see_progress=False,
77
+ merge_with_char=True,
78
+ rm_disk=False)
79
+ # .run() downloads subject data, then cleans it
80
+ # returns Pandas DataFrame
81
+ # merge_with_char, if True, downloads Characteristics data (e.g., school names, addresses) and merges with subject data
82
+
83
+ # to look up variable descriptions, you can either use:
84
+ # .get_available_vars() -> dict
85
+ # .lookup_var() -> str
86
+ grad_aughts.lookup_var('gradrate_wtmen')
87
+ # returns: 'Graduation rate for non-Hispanic White men (within 150 percent of normal time taken to graduate).'
88
+ ```
89
+
90
+ ### Subjects
91
+ IPEDS [covers](https://nces.ed.gov/ipeds/about-ipeds) eight main subjects:
92
+ 1. Institutional Characteristics
93
+ 2. Admissions
94
+ 3. Enrollment
95
+ 4. Degrees and Certificates Conferred
96
+ 5. Student Persistence and Success
97
+ 6. Institutional Prices
98
+ 7. Student Financial Aid
99
+ 8. institutional Resources including Human, resources, Finance, and Academic Libraries
100
+
101
+ `genpeds` currently supports the first five subjects:
102
+
103
+ - **Characteristics** (e.g., school name, address, longitude/latitude, etc.) (available 1984-2023)
104
+ ```python
105
+ from genpeds import scrape_ipeds_data, Characteristics
106
+
107
+ scrape_ipeds_data(subject='characteristics',
108
+ year_range=(1984,2023))
109
+
110
+ chardat = Characteristics(year_range=(1984,2023))
111
+ ```
112
+ - **Admissions** (e.g., SAT/ACT scores, admit rates by gender, etc.) (available 2001-2023)
113
+ ```python
114
+ from genpeds import scrape_ipeds_data, Admissions
115
+
116
+ scrape_ipeds_data(subject='admissions',
117
+ year_range=(2001,2023))
118
+
119
+ admdat = Admissions(year_range=(2001,2023))
120
+ ```
121
+ - **Enrollment** (e.g., enrollment by race/gender/level, etc.) (available 1984-2023)
122
+ ```python
123
+ from genpeds import scrape_ipeds_data, Enrollment
124
+
125
+ scrape_ipeds_data(subject='enrollment',
126
+ year_range=(1984,2023))
127
+
128
+ enrolldat = Enrollment(year_range=(1984,2023))
129
+ ```
130
+ - **Completion** (e.g., degree completion by race/gender/subject/level, etc.) (available 1984-2023)
131
+ ```python
132
+ from genpeds import scrape_ipeds_data, Completion
133
+
134
+ scrape_ipeds_data(subject='completion',
135
+ year_range=(1984,2023))
136
+
137
+ completedat = Completion(year_range=(1984,2023))
138
+ ```
139
+ - **Graduation** (e.g., graduation rate by race/gender/level, etc.) (available 2000-2023)
140
+ ```python
141
+ from genpeds import scrape_ipeds_data, Graduation
142
+
143
+ scrape_ipeds_data(subject='graduation',
144
+ year_range=(2000,2023))
145
+
146
+ graddat = Graduation(year_range=(2000,2023))
147
+
148
+ grad_df = graddat.run(degree_level='bach',
149
+ merge_with_char=True)
150
+ ```
151
+
152
+ In the future, the remaining subjects will likely be added to `genpeds`. But just with the already provided subjects, you can study school-level trends for their male and female students, from admissions to completion.
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 77.0.3"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "genpeds"
7
+ description = "Work with NCES IPEDS data: from admissions to graduation"
8
+ requires-python = ">=3.13.3"
9
+ classifiers = [
10
+ "Programming Language :: Python :: 3",
11
+ "Operating System :: OS Independent",
12
+ ]
13
+ version = "1.0"
14
+ authors = [{"name" = "Ravan Hawrami", "email" = "ravanhawrami@gmail.com"}]
15
+ readme = {"file" = "README.md", content-type = "text/markdown"}
16
+ dependencies = ["pandas", "numpy", "openpyxl", "xlrd", "requests", "bs4", "us"]
17
+ license = "MIT"
18
+ license-files = ["LICENSE.md"]
19
+
20
+ [project-urls]
21
+ Homepage = "https://github.com/rhawrami/genpeds"
22
+
23
+ [project-scripts]
24
+ genpeds-cli = "genpeds.cli:main"
genpeds-1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,16 @@
1
+ '''Work with gendered NCES IPEDS data: from admissions to graduation'''
2
+
3
+ __version__ = '1.0'
4
+
5
+ from genpeds.core import Characteristics, Admissions, Enrollment, Completion, Cip, Graduation
6
+ from genpeds.downloader import scrape_ipeds_data
7
+
8
+ __all__ = [
9
+ 'Characteristics',
10
+ 'Admissions',
11
+ 'Enrollment',
12
+ 'Completion',
13
+ 'Cip',
14
+ 'Graduation',
15
+ 'scrape_ipeds_data'
16
+ ]