Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PySnpTools

PySnpTools is a library for reading and manipulating genetic data.

Main Features:

  • SnpReader: Efficiently read genetic PLINK formats including *.bed/bim/fam files. Also, efficiently read parts of files, read kernel data, and standardize data. New features include multi-threaded BED reading, cluster-ready BED data, on-the-fly SNP generation, and larger in-memory data.

  • Experimental GPU arrays: Read, standardize, and construct kernels with CuPy. ARRAY_MODULE and ARRAY_DTYPE supply optional backend/precision environment defaults. See the GPU guide and workflow notebook. The cupy extra installs CuPy directly. BED reads decode on the CPU, then transfer to CuPy for GPU standardization and kernel construction.

  • DistReader: Efficiently work with unphased BGEN format and other diploid, biallelic distribution data. Also, efficiently read parts of files. See Distribution IPython Notebook.

  • util: In one line, intersect and re-order IIDs from snpreader and other sources. Also, efficiently extract a submatrix from an ndarray.

  • IntRangeSet: Efficiently manipulate ranges of integers - for example, genetic position - with set operators including union, intersection, and set difference.

  • mapreduce1: Run loops locally, on multiple processors, or on any cluster.

  • filecache: Read and write files locally or from/to any remote storage.

Install

pip install pysnptools

Requires Python 3.11.5 or later. Core Python 3.15 support excludes HDF5, BGEN, and CuPy because their required wheels are not currently available together.

For the experimental GPU beta:

pip install "pysnptools[cupy]==1.1.0b1"

GPU use requires compatible NVIDIA hardware, a driver, and CuPy's CUDA setup. Python 3.15 is currently CPU-only; see the GPU guide for platform limits.

HDF5 support is optional. To read or write HDF5 files, install:

pip install pysnptools[hdf5]

Existing HDF5 users upgrading from an earlier release should install this extra.

If you need support for BGEN files, instead do:

pip install pysnptools[bgen]

Documentation

Code

Contacts

Testing

PySnpTools has two test runners. Run pytest from the repository root for pytest tests and doctests in Python modules, reStructuredText, and Markdown. Run python -m pysnptools.test for the legacy unittest suite, which assembles reader, standardizer, utility, optional-format, and doctest checks. These runners cover overlapping but different sets of tests.

Two doctest examples in pysnptools.distreader.bgen require external QCTool v2: Bgen.genwrite and Bgen.write. Install QCTool v2 from the official QCTool site, then set QCTOOLPATH to the command or executable path used to launch it. For example, on Linux or macOS:

export QCTOOLPATH=/absolute/path/to/qctool

On Windows, install QCTool in WSL and set QCTOOLPATH to the WSL launch command and Linux executable path, as described in the Bgen.write API documentation. The BGEN doctest fails with a message naming qctool when this configuration is missing; it does not silently skip.

Metadata

Release files for pysnptools 1.1.0b1

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

Source distribution (sdist)

Source distribution for pysnptools 1.1.0b1
File Size Uploaded Provenance Actions
pysnptools-1.1.0b1.tar.gz 267.7 kB With provenance Details for pysnptools-1.1.0b1.tar.gz

Built distribution (wheel)

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

Total release size: 604.9 kB

Release files / pysnptools-1.1.0b1.tar.gz

Download URL pysnptools-1.1.0b1.tar.gz
Size 267.7 kB
Tags Source
SHA-256 checksum
How to use checksums
69a312353d1c6952ed5f4d3cf4c48afff511f66660f27c07fc2a99c646d56fa6
BLAKE2b-256 checksum
How to use checksums
6481217fae612de4f83d2b1b0c9f8fe91a7da4b9a0d29633bdb1bba2e7b904ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / pysnptools-1.1.0b1-py3-none-any.whl

Download URL pysnptools-1.1.0b1-py3-none-any.whl
Size 337.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f953a3ca9d40dfb9bfa9bfd81ac75808c304e8e58060fcd8a271e766d8bdc476
BLAKE2b-256 checksum
How to use checksums
8aaa0b795456a6126f9cbe9f94db7d57140bcea5584205cf4d89254b8c39fadc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for pysnptools 1.1.0b1

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 pysnptools-1.1.0b1.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 Nov 24, 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.3.10

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