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
- Issues: github.com/samplics/svy/issues
- Discussions: github.com/samplics-org/svy/discussions
License
MIT License — Copyright © 2026 Samplics LLC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file svy-0.18.2.tar.gz.
File metadata
- Download URL: svy-0.18.2.tar.gz
- Upload date:
- Size: 337.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3c2df1691c9d86d17c5acb268c7b3623a925fe260e55d3419f9597b37aa75bd
|
|
| MD5 |
de87c98a4cd7a92126275fa8fbfc3d83
|
|
| BLAKE2b-256 |
4de42c28449ba767c52c8c4ea8119d4b9f1817c1f4b4ee2708b3b8655ad37ace
|
Provenance
The following attestation bundles were made for svy-0.18.2.tar.gz:
Publisher:
svy-wheels.yml on samplics-org/svy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svy-0.18.2.tar.gz -
Subject digest:
a3c2df1691c9d86d17c5acb268c7b3623a925fe260e55d3419f9597b37aa75bd - Sigstore transparency entry: 1580176115
- Sigstore integration time:
-
Permalink:
samplics-org/svy@cd63131ef142ea1df2dfba3be3c51adb0d69c527 -
Branch / Tag:
refs/tags/svy-v0.18.2 - Owner: https://github.com/samplics-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svy-wheels.yml@cd63131ef142ea1df2dfba3be3c51adb0d69c527 -
Trigger Event:
push
-
Statement type:
File details
Details for the file svy-0.18.2-py3-none-any.whl.
File metadata
- Download URL: svy-0.18.2-py3-none-any.whl
- Upload date:
- Size: 411.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00a248d97079a250b227005fd90f50f4e9981914fde43b61ff31a1076d54a54a
|
|
| MD5 |
5f5cbf4603854da2534d7a6e04b0135f
|
|
| BLAKE2b-256 |
bf4e50b9e211e948da27bb0c66d899934b23a4cfde43854851a16290e9a801cc
|
Provenance
The following attestation bundles were made for svy-0.18.2-py3-none-any.whl:
Publisher:
svy-wheels.yml on samplics-org/svy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
svy-0.18.2-py3-none-any.whl -
Subject digest:
00a248d97079a250b227005fd90f50f4e9981914fde43b61ff31a1076d54a54a - Sigstore transparency entry: 1580176462
- Sigstore integration time:
-
Permalink:
samplics-org/svy@cd63131ef142ea1df2dfba3be3c51adb0d69c527 -
Branch / Tag:
refs/tags/svy-v0.18.2 - Owner: https://github.com/samplics-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
svy-wheels.yml@cd63131ef142ea1df2dfba3be3c51adb0d69c527 -
Trigger Event:
push
-
Statement type: