svy
Modern Python tools for complex survey analysis, built for real-world statistical workflows.
svy is a rigorously design-based, production-oriented library for survey design, weighting, and estimation.
🌐 Website: svylab.com 📘 Documentation: svylab.com/docs/svy 📦 Source: github.com/samplics-org/svy
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 (to at least six significant digits) across Taylor linearization, replication methods, and complex survey designs — except where svy adopts a different, justifiable adjustment by design, most of which align with the conventions used in established software such as Stata. 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, and msgspec
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-org/svy/issues
- Discussions: github.com/samplics-org/svy/discussions
License
MIT License — Copyright © 2026 Samplics LLC
Release files for svy 0.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| svy-0.25.0.tar.gz | 1.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| svy-0.25.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.0 MB
Release files / svy-0.25.0.tar.gz
| Download URL | svy-0.25.0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
870ef8104e10c6f7e8bfd3cf1c71ccad2e07d41bb79fc8163a4b9c7f7900a93c
|
|
BLAKE2b-256 checksum How to use checksums |
a5a4e4d727237a1b267f0fbfda7e8462e9919d7de079484a52fec7e2ef61e6df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / svy-0.25.0-py3-none-any.whl
| Download URL | svy-0.25.0-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
decaffa4f516b8c9a89bb91f2720deba94488c88a13cd247ea2306138738ade2
|
|
BLAKE2b-256 checksum How to use checksums |
ea034ef892f053604306177394d2e2e2b9633f91f242f14a1b5cbb83dd07a9c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency log