class ipumspy.noextract.download_noextract_data(collection, filename=None)[source]#

A convenience function to download non-extractable IPUMS data directly from the IPUMS website

Suggested usage to retrieve YRBSS data:

>>> from ipumspy.readers import read_microdata
>>> from ipumspy.noextract_collections import read_noextract_codebook, download_noextract_data
>>> yrbss_codebook = read_noextract_codebook("yrbss")
>>> download_noextract_data("yrbss")
>>> read_microdata(yrbss_codebook, "yrbss.dat.gz")

N.B. You must use read_noextract_codebook() to parse the codebook provided in this package or else read_microdata will fail.

  • collection (str) – A valid non-extractable IPUMS data collection (yrbss or nyts)

  • filename (Optional, FilnameType) – Files to download the data to. Defaults to ipums-<collection>.dat.gz


ValueError – If an invalid or extractable IPUMS data collection is specified