Metadata-Version: 2.4
Name: gssdata
Version: 0.1.0
Summary: Python client for General Social Survey (GSS) data
Project-URL: Homepage, https://github.com/MaxGhenis/gss
Project-URL: Documentation, https://maxghenis.github.io/gss
Project-URL: Repository, https://github.com/MaxGhenis/gss
Project-URL: Issues, https://github.com/MaxGhenis/gss/issues
Author-email: Max Ghenis <max@policyengine.org>
License-Expression: MIT
License-File: LICENSE
Keywords: general social survey,gss,norc,social science,survey data
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: pandas>=1.5.0
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Description-Content-Type: text/markdown

# gss

[![PyPI version](https://badge.fury.io/py/gss.svg)](https://badge.fury.io/py/gss)
[![CI](https://github.com/MaxGhenis/gss/actions/workflows/ci.yml/badge.svg)](https://github.com/MaxGhenis/gss/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://maxghenis.github.io/gss)

Python client for [General Social Survey (GSS)](https://gss.norc.org/) data.

## Installation

```bash
pip install gss
```

## Quick Start

```python
import gss

# Get time series for a variable
df = gss.trend("HOMOSEX")
print(df.head())
#    year  pct  n
# 0  1973   11  1446
# 1  1974   13  1434
# 2  1976   16  1466
# ...

# List all available variables
variables = gss.variables()
print(len(variables))  # 17 core variables

# Get variable metadata
info = gss.info("HOMOSEX")
print(info["question"])
# "What about sexual relations between two adults of the same sex..."
print(info["responses"])
# {1: "Always wrong", 2: "Almost always wrong", ...}
```

## Features

- **Simple API**: `trend()`, `variables()`, `info()` - that's it
- **Automatic caching**: Downloads GSS data once, caches locally
- **Pre-computed trends**: Fast access to time series for key variables
- **Full metadata**: Question text, response options, first year asked

## Available Variables

The package includes 17 frequently-studied GSS variables spanning social attitudes, political views, and trust:

| Variable | Description |
|----------|-------------|
| HOMOSEX | Attitudes toward same-sex relations |
| GRASS | Marijuana legalization support |
| PREMARSX | Premarital sex attitudes |
| ABANY | Abortion for any reason |
| FEPOL | Women suited for politics |
| CAPPUN | Death penalty opposition |
| GUNLAW | Gun permit support |
| NATRACE | Spending on race issues |
| NATEDUC | Spending on education |
| NATENVIR | Spending on environment |
| NATHEAL | Spending on health |
| EQWLTH | Government reduce inequality |
| HELPPOOR | Government help poor |
| TRUST | Social trust |
| FAIR | People try to be fair |
| POLVIEWS | Political ideology |
| PRAYER | School prayer ban approval |

## Documentation

Full documentation: [maxghenis.github.io/gss](https://maxghenis.github.io/gss)

## License

MIT
