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.1.tar.gz (286.3 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.1-py3-none-any.whl (333.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svy-0.13.1.tar.gz
  • Upload date:
  • Size: 286.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svy-0.13.1.tar.gz
Algorithm Hash digest
SHA256 3a12c24ff68831faacaa49ddb5a2b1251e0c7fcfff3d7ac945a0cbf712e0dac0
MD5 6ef206caaf15462b2fe8ad9264a1a318
BLAKE2b-256 0bb345be4c6d60849e55ccf0bd9280d76d5f03e5c4d1d418d6743ffc2c39b38d

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.13.1.tar.gz:

Publisher: wheels.yml on samplics-org/svy-internal

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.13.1-py3-none-any.whl.

File metadata

  • Download URL: svy-0.13.1-py3-none-any.whl
  • Upload date:
  • Size: 333.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svy-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 485f6bf85703b61fa9de3ef45919a83adf88966954b7fce55d34c597950a05f5
MD5 97e4ae0bddcced6ab245b8e6c4b7b2fd
BLAKE2b-256 c49101cd16fb768de9604f7c27d83898d233bac42c8ab593d2664633c13d9011

See more details on using hashes here.

Provenance

The following attestation bundles were made for svy-0.13.1-py3-none-any.whl:

Publisher: wheels.yml on samplics-org/svy-internal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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