pysam-developers/pysam

Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.

Cython

911

2,322 commits

updated Oct 12, 2026

See the code

README

=====
Pysam
=====

|build-status| |docs|

Pysam is a python module for reading and manipulating files in the
SAM/BAM format. The SAM/BAM format is a way to store efficiently large
numbers of alignments (`Li 2009`_), such as those routinely created by
next-generation sequencing methods.

Pysam is a lightweight wrapper of the samtools_ C-API. Pysam also
includes an interface for tabix_.

If you are using the conda packaging manager (e.g. miniconda or anaconda),
you can install pysam from the `bioconda channel <https://bioconda.github.io/>`_::

   conda config --add channels bioconda
   conda config --add channels conda-forge
   conda config --set channel_priority strict
   conda install pysam

Installation through bioconda is the recommended way to install pysam
as it resolves non-python dependencies and uses pre-configured
compilation options. Especially for OS X this will potentially save a
lot of trouble.

The current version of pysam wraps 3rd-party code from htslib-1.24, samtools-1.24, and bcftools-1.24.

Pysam is available through `PyPI <https://pypi.org/project/pysam/>`_.
To install, type::

   pip install pysam

Pysam documentation is available
`here <http://pysam.readthedocs.org/en/latest/>`_

Questions and comments are very welcome and should be sent to the
`pysam user group <http://groups.google.com/group/pysam-user-group>`_

.. _samtools: http://samtools.sourceforge.net/
.. _tabix: http://samtools.sourceforge.net/tabix.shtml
.. _Li 2009: http://www.ncbi.nlm.nih.gov/pubmed/19505943

.. |build-status| image:: https://github.com/pysam-developers/pysam/actions/workflows/ci.yaml/badge.svg
    :alt: build status
    :scale: 100%
    :target: https://github.com/pysam-developers/pysam/actions/workflows/ci.yaml

.. |docs| image:: https://readthedocs.org/projects/pysam/badge/?version=latest
    :alt: Documentation Status
    :scale: 100%
    :target: https://pysam.readthedocs.org/en/latest/?badge=latest

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

bioinformatics
htslib
ngs
python

pysam-developers/pysam

Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.

Cython

911

2,322 commits

updated Oct 12, 2026

See the code

README

=====
Pysam
=====

|build-status| |docs|

Pysam is a python module for reading and manipulating files in the
SAM/BAM format. The SAM/BAM format is a way to store efficiently large
numbers of alignments (`Li 2009`_), such as those routinely created by
next-generation sequencing methods.

Pysam is a lightweight wrapper of the samtools_ C-API. Pysam also
includes an interface for tabix_.

If you are using the conda packaging manager (e.g. miniconda or anaconda),
you can install pysam from the `bioconda channel <https://bioconda.github.io/>`_::

   conda config --add channels bioconda
   conda config --add channels conda-forge
   conda config --set channel_priority strict
   conda install pysam

Installation through bioconda is the recommended way to install pysam
as it resolves non-python dependencies and uses pre-configured
compilation options. Especially for OS X this will potentially save a
lot of trouble.

The current version of pysam wraps 3rd-party code from htslib-1.24, samtools-1.24, and bcftools-1.24.

Pysam is available through `PyPI <https://pypi.org/project/pysam/>`_.
To install, type::

   pip install pysam

Pysam documentation is available
`here <http://pysam.readthedocs.org/en/latest/>`_

Questions and comments are very welcome and should be sent to the
`pysam user group <http://groups.google.com/group/pysam-user-group>`_

.. _samtools: http://samtools.sourceforge.net/
.. _tabix: http://samtools.sourceforge.net/tabix.shtml
.. _Li 2009: http://www.ncbi.nlm.nih.gov/pubmed/19505943

.. |build-status| image:: https://github.com/pysam-developers/pysam/actions/workflows/ci.yaml/badge.svg
    :alt: build status
    :scale: 100%
    :target: https://github.com/pysam-developers/pysam/actions/workflows/ci.yaml

.. |docs| image:: https://readthedocs.org/projects/pysam/badge/?version=latest
    :alt: Documentation Status
    :scale: 100%
    :target: https://pysam.readthedocs.org/en/latest/?badge=latest

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

bioinformatics
htslib
ngs
python

Project health

Overall

4.4/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

PyPI

Latest release

0.24.1 · Sep 7, 2026

Releases this year

2

Significant stargazers

Ashwin Ramaswami

359 followers · starred Jan 2021

Alberto Schiabel

382 followers · starred Dec 2020

Nathan Weeks

55 followers · starred May 2022

Félix Raimundo

57 followers · starred Mar 2018