Skip to main content

hypors

Hypothesis testing for Python, backed by the hypors Rust crate.

Every statistic is computed by the Rust library — these bindings only convert values across the boundary, so Python and Rust always agree.

Install

pip install hypors

Use

from hypors import TailType
from hypors.t import t_test

result = t_test([1.2, 2.3, 1.9, 2.5, 2.8], pop_mean=2.0, tail=TailType.Two, alpha=0.05)

print(result.test_statistic)
print(result.p_value)
print(result.reject_null)
print(result.to_dict())

Any iterable of numbers works — a list, tuple, generator, numpy array, pandas.Series or polars.Series. The package itself depends on none of them:

import numpy as np
import polars as pl

t_test(np.array([1.2, 2.3, 1.9]), 2.0, TailType.Two, 0.05)
t_test(pl.Series([1.2, 2.3, 1.9]), 2.0, TailType.Two, 0.05)

Tests available

Module Functions
hypors.t t_test, t_test_paired, t_test_ind, t_sample_size
hypors.z z_test, z_test_paired, z_test_ind, z_sample_size
hypors.proportion z_test, z_test_ind, prop_sample_size
hypors.anova anova, f_sample_size
hypors.chi_square independence, goodness_of_fit, variance, chi2_sample_size_gof, chi2_sample_size_ind, chi2_sample_size_variance
hypors.mann_whitney u_test
hypors.common TailType, TestResult

TailType and TestResult are also importable from the top level.

Results

Every test returns a TestResult with test_statistic, p_value, confidence_interval, null_hypothesis, alt_hypothesis and reject_null, plus to_dict() for serialising. Attributes are read-only.

Errors surface as ordinary Python exceptions: ValueError for empty or insufficient data, RuntimeError for a computation that could not be completed.

Types

The package ships py.typed and inline stubs, so editors and type checkers see the full API without any extra install:

from hypors import TailType, TestResult
from hypors.t import t_test

result: TestResult = t_test([1.0, 2.0, 3.0], 2.0, TailType.Two, 0.05)
p: float = result.p_value

Any iterable of numbers is accepted wherever data is taken — lists, tuples, generators, numpy arrays, polars series.

Notes

  • The Mann-Whitney U p-value matches scipy.stats.mannwhitneyu with method="asymptotic". Its test_statistic is min(U1, U2) while the p-value derives from U1, so compare p-values rather than statistics when checking against scipy.
  • Versions track the Rust crate: hypors on PyPI and hypors on crates.io share a version number.

License

MIT

Metadata

Release files for hypors 0.4.2

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

Source distribution (sdist)

Source distribution for hypors 0.4.2
File Size Uploaded Provenance Actions
hypors-0.4.2.tar.gz 46.1 kB Without provenance Details for hypors-0.4.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hypors 0.4.2
File Actions
hypors-0.4.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for hypors-0.4.2-cp39-abi3-win_amd64.whl
hypors-0.4.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for hypors-0.4.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
hypors-0.4.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for hypors-0.4.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
hypors-0.4.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for hypors-0.4.2-cp39-abi3-macosx_11_0_arm64.whl
hypors-0.4.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for hypors-0.4.2-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 1.6 MB

Release files / hypors-0.4.2.tar.gz

Download URL hypors-0.4.2.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d284be5a858f73eb226459a7fe4d6343693fedc432cd124c04f19ccd6e282d6e
BLAKE2b-256 checksum
How to use checksums
af5919ca38973ce7c4c19382a85bd001cb0b5ca7fa1362858c6b288d5b7f4a73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypors-0.4.2-cp39-abi3-win_amd64.whl

Download URL hypors-0.4.2-cp39-abi3-win_amd64.whl
Size 220.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c315f47511bdb394a9a89bdf28e65112bfdc98685c5894be79f0db50554c3cd1
BLAKE2b-256 checksum
How to use checksums
6e587692b77346aed6ac83b685987905f7710a079a6aa8a43115b50c07a49224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypors-0.4.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL hypors-0.4.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 366.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c41df6972337a5c0d1072445b26b9dcdc6b7ca1af632ff18e3af61f9f4649e08
BLAKE2b-256 checksum
How to use checksums
4a8f733d0c690d3463e94c632377ef479fac004d1c5fe8c8a217552b2a108e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypors-0.4.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL hypors-0.4.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 358.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9b3cc38c83b3291a153abda0a59b5a651a94347dae2da51b23adee653a4076f1
BLAKE2b-256 checksum
How to use checksums
84a03978d83a2a64b2f61d4984831018ec01ee37d498256875c24c62cd0c6206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypors-0.4.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL hypors-0.4.2-cp39-abi3-macosx_11_0_arm64.whl
Size 324.2 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
30ea956a06f93e73a42bed1798ebff9cdb1ef218725abf617b81844932c3b101
BLAKE2b-256 checksum
How to use checksums
853192e25f6c1d385a99d1d5a30534b31a1bcf6d7044584da7a3047b5d177ae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypors-0.4.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL hypors-0.4.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 325.2 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d15d73bd9a0185f53bf46b8edb25940125fb5b7f57dd097f5ae4cfd5f1b2b025
BLAKE2b-256 checksum
How to use checksums
9070f8ca516045969b03e4a4faea6e704c45ed53bdfc22dd1798b941d2936d35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hypors 0.4.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.4.2 This release

6 release files No 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