Python Compiler for Public SCF Files (scfpublic)
Author: Payton Crawford
Last Updated: November 19th, 2026
Table of Contents
Introduction
The purpose of these Python package is to provide a centralized package for downloading the Survey of Consumer Finances files and computing standard errors that are corrected for multiple imputation and the sample design. By doing so, I aim to make it easier and clearer how to properly use SCF data. Please refer to the official Federal Reserve Board website for the Survey of Consumer Finances. Their website includes the datasets, codebooks (for example, 2025) containing information by each year for each of the x-variables, and an updated SAS bulletin macro to define each of the bulletin variables. Additionally, they have a codebook search, a net worth flowchat, materials from previous surveys, and other relevant materials.
Installation
From anywhere in your terminal, run pip install scfpublic. This will run commands from pyproject.toml to install the Python package and its minimum dependencies locally in that environment. From there, you will be able to access any of the Python files in src/scfpublic by running the command import scfpublic at the top of a Python script.
- The Python dependencies that will be installed are listed in
requirements.txt. - For further in-depth details on how to utilize the package, please refer to the Jupyter Notebook in examples.
Directory Structure
-
examples
- Stores Jupyter notebooks detailing how to use each respective package with examples and base Python files showing examples of usage.
-
src/scfpublic
- Stores the Python files that are used each time the package is imported.
- scfpublic has the scfpublic package, which is used to load x-data, bulletin, and replicate weights files from their current storages into Python as a Pandas dataframe.
- cpi.py has the cpi package, which is used for creating the cpiadj and cpilag variables that mimics the SCF bulletin.
- util.py has the util package, which contains annual and monthly conversion functions following the SCF bulletin.
-
/scfcombo
- scfcombo.py has the scfcombo package, which is used to convert the SCF data and replicate weights files to compute imputation error, sampling error, and combined errors for user-defined analysis.
- stats.py has the scfcombo.stats package, which contains convenience wrapper functions around scf_estimate.
- Stores the Python files that are used each time the package is imported.
-
tests
- Stores Python test files for each of the above packages.
- To run the tests for each program, run the command
python3 -m pytest {tests directory}in your terminal.
-
variances
- Stores
variances.mddetails how the combined standard errors are computed and how to use the respective functions for your programming language of choice.
- Stores
Packages and Functions
scfpublic- Functions
download_year- Loads year, variables, and file type requested for public SCF datadownload_years- Loads multiple years, variables, and file type requested for public SCF datadownload_main_extr_years- Loads merged main and extract data using years and variables for public SCF data
cpi- Package for adding CPI adjustments by year- Functions
read_excel_from_url- Reads CPI-U-RS-ALLITEMS Excel filecpi_adjust- Creates cpiadj and cpilag variables by year
- Functions
scfcombo- Package for imputation and sampling error corrections- DataClass
scfcombo_result- Data class that stores statistic and regression information- Functions
display- Outputs formatted results to terminalsummary- Outputs data class information
- Functions
- Functions
prepare_scf_data- Prepares SCF data and replicate weights file into a dataset usable for scf_estimatescf_estimate- Takes user functions and outputs pooled estimate, imputation variance, sampling variance, and combined variance into a scfcombo_result object
stats- Convenience functions for basic statistics applications usingscf_estimate- Functions
scf_mean- Convenience wrapper for mean estimation around scf_estimatescf_quantile- Convenience wrapper for median estimation around scf_estimatescf_regression- Convenience wrapper for regression estimation around scf_estimatescf_total- Convenience wrapper for aggregate estimation around scf_estimate
- Functions
- DataClass
util- Package for basic SCF functions- Functions
aconv- Annual conversion functionmconv- Monthly conversion function
- Functions
- Functions
Citation: Payton Crawford (2026). scfpublic. Python package. ver. 1.0.3. https://github.com/CrawfordPayton/scfpublic.
Bibliography:
Board of Governors of the Federal Reserve System. (2026). 2025 Survey of Consumer Finances [Dataset]. https://doi.org/10.17016/8799.1.
Metadata
Release files for scfpublic 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scfpublic-1.0.3.tar.gz | 52.6 kB | Without provenance | Details for scfpublic-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scfpublic-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for scfpublic-1.0.3-py3-none-any.whl |
Total release size: 77.4 kB
Release files / scfpublic-1.0.3.tar.gz
| Download URL | scfpublic-1.0.3.tar.gz |
|---|---|
| Size | 52.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1031a101047da9f971774ef9fa0fdde642fa907eadd9604ce8f7676bcfbc19e
|
|
BLAKE2b-256 checksum How to use checksums |
32643ea576b803da3465f51c8c9ccb42ee0a50c5185c2b2087ccbb4c04a35110
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / scfpublic-1.0.3-py3-none-any.whl
| Download URL | scfpublic-1.0.3-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ffa4fa5387dfcccd7b2b7a334f4c289ee515d5211fc4eb4a8969e6643a1c5b3c
|
|
BLAKE2b-256 checksum How to use checksums |
f3b3848952b1ac9bae50e22d0ae2d22e7a22f01fb966c2cb5b7a3b94145d57f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for scfpublic 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.