pycpsdata


Namepycpsdata JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/matt-saenz/PyCPS
SummaryLoad CPS microdata into a pandas DataFrame using the Census API.
upload_time2023-10-15 00:06:12
maintainer
docs_urlNone
authorMatt Saenz
requires_python<4,>=3.10
license
keywords pycpsdata pycps cps current population survey microdata census bureau
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyCPS

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Downloads](https://static.pepy.tech/badge/pycpsdata)](https://pepy.tech/project/pycpsdata)

## Overview

Python package for loading [Current Population Survey (CPS)](https://www.census.gov/programs-surveys/cps/about.html) microdata into a [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) using the Census Bureau Data API, including [basic monthly CPS](https://www.census.gov/data/datasets/time-series/demo/cps/cps-basic.html) and [CPS ASEC](https://www.census.gov/data/datasets/time-series/demo/cps/cps-asec.html) 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](https://github.com/matt-saenz/cpsR).

## Setup Instructions

Install the package:

```shell
pip install pycpsdata  # Alas, pycps was taken
```

and store your [Census API key](https://api.census.gov/data/key_signup.html) in an environment variable named `CENSUS_API_KEY`.

## Example Usage

```python
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
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/matt-saenz/PyCPS",
    "name": "pycpsdata",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": "",
    "keywords": "pycpsdata,pycps,cps,current population survey,microdata,census bureau",
    "author": "Matt Saenz",
    "author_email": "mattsaenz165@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/36/a2/038735288504b76973e11f99f64abc36505669954d819c0076b0cb6be807/pycpsdata-1.0.1.tar.gz",
    "platform": null,
    "description": "# PyCPS\n\n[![Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Downloads](https://static.pepy.tech/badge/pycpsdata)](https://pepy.tech/project/pycpsdata)\n\n## Overview\n\nPython package for loading [Current Population Survey (CPS)](https://www.census.gov/programs-surveys/cps/about.html) microdata into a [pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) using the Census Bureau Data API, including [basic monthly CPS](https://www.census.gov/data/datasets/time-series/demo/cps/cps-basic.html) and [CPS ASEC](https://www.census.gov/data/datasets/time-series/demo/cps/cps-asec.html) microdata.\n\nNote: This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.\n\nFor an R version of this package, check out [cpsR](https://github.com/matt-saenz/cpsR).\n\n## Setup Instructions\n\nInstall the package:\n\n```shell\npip install pycpsdata  # Alas, pycps was taken\n```\n\nand store your [Census API key](https://api.census.gov/data/key_signup.html) in an environment variable named `CENSUS_API_KEY`.\n\n## Example Usage\n\n```python\nfrom pycps import get_asec\n\nasec = get_asec(2021, [\"a_age\", \"marsupwt\"])\n\nasec\n#         a_age  marsupwt\n# 0          56    687.71\n# 1          57    687.71\n# 2          78    646.86\n# 3          65   1516.95\n# 4          66   1516.95\n# ...       ...       ...\n# 163538     69    514.11\n# 163539     70    516.25\n# 163540     66    516.25\n# 163541     55    386.37\n# 163542     52    386.37\n#\n# [163543 rows x 2 columns]\n\nasec.marsupwt.sum()\n# 326195439.67\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Load CPS microdata into a pandas DataFrame using the Census API.",
    "version": "1.0.1",
    "project_urls": {
        "Bug Reports": "https://github.com/matt-saenz/PyCPS/issues",
        "Homepage": "https://github.com/matt-saenz/PyCPS",
        "Source": "https://github.com/matt-saenz/PyCPS"
    },
    "split_keywords": [
        "pycpsdata",
        "pycps",
        "cps",
        "current population survey",
        "microdata",
        "census bureau"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b3af5e56e70c7b6070b68adc3e4353a92c45cd7aceee18d41c8a87dced242e3",
                "md5": "0f79b74cf7626bec9b7ed2cb897af656",
                "sha256": "6638be027b56c9eeedfe0427163531f60117fb4f069c3a72a20553a95723b75a"
            },
            "downloads": -1,
            "filename": "pycpsdata-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f79b74cf7626bec9b7ed2cb897af656",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.10",
            "size": 5379,
            "upload_time": "2023-10-15T00:06:10",
            "upload_time_iso_8601": "2023-10-15T00:06:10.627389Z",
            "url": "https://files.pythonhosted.org/packages/4b/3a/f5e56e70c7b6070b68adc3e4353a92c45cd7aceee18d41c8a87dced242e3/pycpsdata-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36a2038735288504b76973e11f99f64abc36505669954d819c0076b0cb6be807",
                "md5": "c3b9567b0f93e24cc3ff016d39e09f14",
                "sha256": "4a6e218866c0d469254773c55c1102abf27451c88fad280e7bf85b043b51d7d8"
            },
            "downloads": -1,
            "filename": "pycpsdata-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c3b9567b0f93e24cc3ff016d39e09f14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 6064,
            "upload_time": "2023-10-15T00:06:12",
            "upload_time_iso_8601": "2023-10-15T00:06:12.307217Z",
            "url": "https://files.pythonhosted.org/packages/36/a2/038735288504b76973e11f99f64abc36505669954d819c0076b0cb6be807/pycpsdata-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-15 00:06:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matt-saenz",
    "github_project": "PyCPS",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pycpsdata"
}
        
Elapsed time: 0.12514s