Skip to main content

PyCPS

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Downloads

Overview

Python package for loading Current Population Survey (CPS) microdata into a pandas DataFrame using the Census Bureau Data API, including basic monthly CPS and CPS ASEC microdata.

Note: This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.

For an R version of this package, check out cpsR.

Setup Instructions

Install the package:

pip install pycpsdata  # Alas, pycps was taken

and store your Census API key in an environment variable named CENSUS_API_KEY.

Example Usage

from pycps import get_asec

asec = get_asec(2021, ["a_age", "marsupwt"])

asec
#         a_age  marsupwt
# 0          56    687.71
# 1          57    687.71
# 2          78    646.86
# 3          65   1516.95
# 4          66   1516.95
# ...       ...       ...
# 163538     69    514.11
# 163539     70    516.25
# 163540     66    516.25
# 163541     55    386.37
# 163542     52    386.37
#
# [163543 rows x 2 columns]

asec.marsupwt.sum()
# 326195439.67

Release files for pycpsdata 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycpsdata 1.0.1
File Size Uploaded
pycpsdata-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycpsdata 1.0.1
File Interpreter ABI Platform
pycpsdata-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / pycpsdata-1.0.1.tar.gz

Download URL pycpsdata-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4a6e218866c0d469254773c55c1102abf27451c88fad280e7bf85b043b51d7d8
BLAKE2b-256 checksum
How to use checksums
36a2038735288504b76973e11f99f64abc36505669954d819c0076b0cb6be807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / pycpsdata-1.0.1-py3-none-any.whl

Download URL pycpsdata-1.0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6638be027b56c9eeedfe0427163531f60117fb4f069c3a72a20553a95723b75a
BLAKE2b-256 checksum
How to use checksums
4b3af5e56e70c7b6070b68adc3e4353a92c45cd7aceee18d41c8a87dced242e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page