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

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.19.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

svy-0.19.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svy-0.19.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for svy-0.19.1.tar.gz
Algorithm Hash digest
SHA256 1f7387f1323e0c60095ac49d209ef998a4a8c6d5e9382c15ef1b8db2e055f907
MD5 f9d5d5358aac8653fa9d27778ebb4ac8
BLAKE2b-256 5595e2be19c14f6778f85bc2de0aae13f205ba68c45b92d14f9e941d9e68431f

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.19.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.19.1-py3-none-any.whl.

File metadata

  • Download URL: svy-0.19.1-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for svy-0.19.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c58a035df94ae40c3813b1ebb5982bf152ed6e959b2a580fa69a1caa9c59f2ed
MD5 278e50c462855fb846066169928f87a8
BLAKE2b-256 eabe22de24fe65ddfe4eff1b14e7aea301a0c74c39e5bfdcbf252137af307d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.19.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.

Release history Release notifications | RSS feed

0.24.1

2 files

0.24.0

2 files

0.23.0

2 files

0.22.1

2 files

0.22.0

2 files

0.21.0

2 files

0.20.1

2 files

0.20.0

2 files

This release

0.19.1 This release

2 files

0.19.0

2 files

0.18.2

2 files

0.18.1

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.1

2 files

0.15.1

2 files

0.15.0

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

12 files

0.11.0

9 files

0.10.0

9 files

0.9.0

9 files

0.8.0

9 files

0.7.0

9 files

0.6.0

9 files

0.5.0

9 files

0.4.0

9 files

0.3.0

12 files

0.2.0

15 files

0.1.0

5 files

0.0.10

5 files

0.0.9

5 files

0.0.8

5 files

0.0.7

5 files

0.0.6

5 files

0.0.5

5 files

0.0.4

5 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page