Skip to main content

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: gitlab.com/samplics/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

Quick Start

import svy

# Load example data
hld_data = svy.load_dataset(name="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 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


License

MIT License — Copyright © 2026 Samplics LLC

Project details


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.13.0.tar.gz (281.6 kB view details)

Uploaded Source

Built Distribution

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

svy-0.13.0-py3-none-any.whl (329.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svy-0.13.0.tar.gz
  • Upload date:
  • Size: 281.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for svy-0.13.0.tar.gz
Algorithm Hash digest
SHA256 d22553f319657d564d14471275a84596dd7810ff320df9c4eac7749b0a9c0213
MD5 35d7ff162980f5e6fccd57dba209ae01
BLAKE2b-256 a6c19a5f1fde782fd4f325a24bbc65e26b4a1acc38fd9e73e5030f97f3bedcbe

See more details on using hashes here.

File details

Details for the file svy-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: svy-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 329.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for svy-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a534e2d28b487914197397115d453819774c4f130dcdc1b678927a79a5944c2a
MD5 59b11bb9e2340c77dbc083cc17d65b7d
BLAKE2b-256 9f9acbcec0b6de4c231514be9f3e171c10261e50b54276f6fce047a23ac834f9

See more details on using hashes here.

Supported by

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