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

A base install makes no network calls: its example datasets are the subsets packaged with svy. svy[remote] adds downloads of the full example datasets from the svyLab catalog; svy[all] installs both extras.

Coding agents. svy ships agent skills: guidance for coding agents such as Claude Code, matching the installed version. Run this once per project, from the project folder:

uv run svy-skills    # or svy-skills with the environment active; svy.skills.install() from Python

It links the skills into .claude/skills/, so upgrading svy updates them. Rerun it when a release adds a skill or after recreating the environment; --copy copies them instead, e.g. to commit them.


Quick Start

import svy

# Load example data, with its survey design and labels
hld_sample = svy.datasets.load("hld_sample_wb_2023")

# 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

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

Metadata

Release files for svy 0.36.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.36.0
File Size Uploaded Provenance Actions
svy-0.36.0.tar.gz 1.7 MB With provenance Details for svy-0.36.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.5 MB

Release files / svy-0.36.0.tar.gz

Download URL svy-0.36.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
295f3e9233e2c37cf18adb6a592bced0a2fcf733c812618fc770f59276ec0166
BLAKE2b-256 checksum
How to use checksums
fcc124d6291108d6303da133fe98bfb8bcb36c2f56a5680b6d1913c3c5c37c67
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 Oct 28, 2026.

Transparency log

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

Download URL svy-0.36.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ac5dc3679c88327a9ef85923a42b66cf34fb543ad413b11f0afba16d9eb77aaa
BLAKE2b-256 checksum
How to use checksums
d8281e82d93974e58cf549106c30735eef453b721a39d4ab8c6c5946bf6f3024
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 Oct 28, 2026.

Transparency log

Security for svy 0.36.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for svy-0.36.0.tar.gz

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 Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.36.0 This release

2 release files Full provenance

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