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. 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.0b2

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.0b2
File Size Uploaded Provenance Actions
pysnptools-1.1.0b2.tar.gz 276.6 kB With provenance Details for pysnptools-1.1.0b2.tar.gz

Built distribution (wheel)

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

Total release size: 613.8 kB

Release files / pysnptools-1.1.0b2.tar.gz

Download URL pysnptools-1.1.0b2.tar.gz
Size 276.6 kB
Tags Source
SHA-256 checksum
How to use checksums
21f902f075c0d2ee7351cfb09f69d891f400ddc37199639b4000c36cbe6d5b81
BLAKE2b-256 checksum
How to use checksums
64e79d2d8aaf402a1df6f1b7a190b6b33558fd99f308cf001e049a2b364b0d20
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.0b2-py3-none-any.whl

Download URL pysnptools-1.1.0b2-py3-none-any.whl
Size 337.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cfd8c0b19b32712d63c43442eab41f897a978f0c4df4c469cfcd832ba9a0c16
BLAKE2b-256 checksum
How to use checksums
36e64f47182912157c1661b92dedf10f698fec28baf71ab08212c803c2fd2a0b
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.0b2

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.0b2.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