Skip to main content

Python client for General Social Survey (GSS) data

Project description

gss

PyPI version CI Documentation

Python client for General Social Survey (GSS) data.

Installation

pip install gss

Quick Start

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gssdata-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gssdata-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file gssdata-0.1.0.tar.gz.

File metadata

  • Download URL: gssdata-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gssdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cce679d1132f51f440e15ea47b00532a750e288df06b1667575eae86f77b22de
MD5 1a8b1e37936cfb8114d00a3e528536b2
BLAKE2b-256 e4fd840f9dbf0f4ee7ae917a88f5658df06c98c3e57c7daa4e8d822afc77c183

See more details on using hashes here.

File details

Details for the file gssdata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gssdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gssdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fca959148257944db496dec93e2675b677db1f58c2cb6e3d266e068af1dedd18
MD5 af55af0659e73f15d920cf8e8e177049
BLAKE2b-256 f1bfa5e2eea41cfb08053cf47d728713a4fc095e256f9e321b8b94db55a99bc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page