Skip to main content

End-to-end surveys: design, sample, analyze, report.

Project description

svy

Modern Python tools for complex survey analysis, built for real-world statistical workflows.

svy is a rigorously design-based yet production-oriented library for survey design, weighting, and estimation — without sacrificing transparency or scalability.

🌐 Website: svylab.com 📘 Documentation: svylab.com/docs/svy 📦 Source: github.com/samplics-org/svy/packages


What is svy?

svy is designed for people who actually work with complex survey data, including national statistical offices, public health and development programs, survey methodologists, and data scientists working with complex samples.

Correct inference first — without hiding assumptions or sacrificing usability.

Validation

svy has been validated against R's survey package, producing numerically identical results across Taylor linearization, replication methods, and complex survey designs. See the full comparison.


Installation

pip install svy # svy[report] for rich outputs

or

uv add svy

Quick Start

import svy

# Load example data
hld_data = svy.datasets.load("hld_sample_wb_2023")

# Define the survey design
hld_design = svy.Design(stratum=("geo1", "urbrur"), psu="ea", wgt="hhweight")

# Create a sample object
hld_sample = svy.Sample(data=hld_data, design=hld_design)

# Estimate the mean of total expenditure
tot_exp_mean = hld_sample.estimation.mean(y="tot_exp")

print(tot_exp_mean)

Capabilities

  • Complex survey design — strata, clusters, weights
  • Design-based estimation with valid standard errors
  • Replication methods — BRR, bootstrap, jackknife, SDR
  • Categorical data analysis — tabulation, crosstabulation, t-test, Rao-Scott test
  • Generalized linear models — logistic, Poisson, Gamma with survey weights
  • Explicit, inspectable, reproducible outputs
  • Built on Polars, NumPy, SciPy, msgspec and Rust

Related Packages

Package Purpose Install
svy Core survey design & estimation pip install svy
svy-sae Small Area Estimation pip install svy-sae
svy-io SPSS / Stata / SAS I/O pip install svy-io

Documentation

Full documentation, tutorials, and methodological notes: 👉 svylab.com/docs/svy


Feedback


License

MIT License — Copyright © 2026 Samplics LLC

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

svy-0.18.1.tar.gz (337.1 kB view details)

Uploaded Source

Built Distribution

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

svy-0.18.1-py3-none-any.whl (411.5 kB view details)

Uploaded Python 3

File details

Details for the file svy-0.18.1.tar.gz.

File metadata

  • Download URL: svy-0.18.1.tar.gz
  • Upload date:
  • Size: 337.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for svy-0.18.1.tar.gz
Algorithm Hash digest
SHA256 c2a6a4fae6b53b6ba7d9a188e8c6dd4aaa9355f4a3fc50618207c0773e0293d9
MD5 37861fb0a9c33720fc7c9c2c21fa104a
BLAKE2b-256 a7d95a0f02cd26eadd118dcdcfaa21ad0fe834aaabeeec85c973f4ec7da9527e

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.18.1.tar.gz:

Publisher: svy-wheels.yml on samplics-org/svy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svy-0.18.1-py3-none-any.whl.

File metadata

  • Download URL: svy-0.18.1-py3-none-any.whl
  • Upload date:
  • Size: 411.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for svy-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f26824527d264bb081a96620ae198e2a76a02124872feb7b0780815cb931a934
MD5 6fd5822580f2c09b9a99c32982be0ba2
BLAKE2b-256 c0ceee84d49fffc48a21a4e282aeadae0ae27fb1de3d9710febc1cff080a3725

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.18.1-py3-none-any.whl:

Publisher: svy-wheels.yml on samplics-org/svy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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