Skip to main content

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


License

MIT License — Copyright © 2026 Samplics LLC

Release files for svy 0.28.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svy 0.28.0
File Size Uploaded
svy-0.28.0.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for svy 0.28.0
File Interpreter ABI Platform
svy-0.28.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.1 MB

Release files / svy-0.28.0.tar.gz

Download URL svy-0.28.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
9bf99c08a4b1461de515c6ed193110441ad84e3929105019c3c218c3e0e5e143
BLAKE2b-256 checksum
How to use checksums
50f6a1ad4074749394eaba35b5741b85fcdaf813cc8e9ce596432e593e4dc9b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release files / svy-0.28.0-py3-none-any.whl

Download URL svy-0.28.0-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fa0fda0dd2661aae9aa9d35271f11b23451e5e46f8364f40e9d928944ea8ad92
BLAKE2b-256 checksum
How to use checksums
5d73976c375bd6998ae48c461c1358436d819117b6c5db076242d3138e9c9de5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.30.0

2 release files

0.29.0

2 release files

This release

0.28.0 This release

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.21.0

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.17.3

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.11.0

9 release files

0.10.0

9 release files

0.9.0

9 release files

0.8.0

9 release files

0.7.0

9 release files

0.6.0

9 release files

0.5.0

9 release files

0.4.0

9 release files

0.3.0

12 release files

0.1.0

5 release files

0.0.10

5 release files

0.0.9

5 release files

0.0.8

5 release files

0.0.7

5 release files

0.0.6

5 release files

0.0.5

5 release files

0.0.4

5 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page