$npx skillfedfor your agent

pysam

Package for reading, manipulating, and writing genomic data

Worth itPyPI Software DevelopmentReleased Apr 20261.3M downloads / moMIT LicensePlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — pysam-0.24.0-cp310-cp310-macosx_10_9_x86_64.whl · pysam-0.24.0-cp310-cp310-macosx_11_0_arm64.whl · pysam-0.24.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
v0.24.0 · released 2026-04-27 · Python >=3.8

Yes. pysam is actively maintained, has no runtime dependencies, carries a permissive MIT license, and is essential for any Python-based genomic data processing. Medium install friction is offset by prebuilt wheels for modern Python versions and the absence of external runtime requirements. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires HTSlib C library and development headers; pysam is a compiled extension and cannot be used without a compatible binary wheel or build environment.
  • Medium install friction due to compiled C extensions via Cython wrapping HTSlib; prebuilt wheels available for common Python versions (3.10–3.13) and platforms (macOS, Linux, musl).
  • Active maintenance with last commit 2026-08-10.

License · maintenance · safety

MIT License (permissive) — MIT License (permissive) allows use in proprietary and open-source projects with minimal restrictions; attribution required.

last release 2026-04-27 (109 days) · last repo commit 2026-08-10 · 905 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,291,977 downloads/mo, #4,103 on PyPI

Verify before relying

import pysam

# Open and read a BAM file
bamfile = pysam.AlignmentFile('example.bam', 'rb')
for read in bamfile:
    print(read.query_name, read.query_sequence)
bamfile.close()
  • Whether the package works on Windows (classifiers list MacOS/POSIX/Unix but no Windows wheel evidence)
  • Performance characteristics for large genomic datasets
  • Exact HTSlib version bundled or required
Same gist for agents: .md · .json

What it is and what it does

pysam is a Python wrapper around HTSlib, the C library underlying samtools and bcftools, that lets you read and write genomic sequence data in standard formats (SAM, BAM, CRAM, VCF, BCF, BED, GFF, GTF, FASTA, FASTQ). It provides both low-level access to HTSlib's C API via Cython and a high-level Python interface for working with genomic data, including support for compression and random access through indexing.

The package is widely used in bioinformatics pipelines and genomic analysis workflows. It has no runtime dependencies beyond HTSlib itself (bundled in the wheel), making it straightforward to integrate into data processing scripts. Active maintenance and broad platform support (macOS, Linux) with prebuilt wheels for Python 3.10–3.13 mean installation is typically frictionless on supported systems.

Use it for

  • Parse and filter SAM/BAM files in a genomic analysis pipeline without calling samtools as a subprocess
  • Extract specific genomic regions or read alignments from indexed VCF/BCF files for variant analysis
  • Convert between genomic file formats (e.g., BAM to CRAM) programmatically within a Python workflow
  • Access samtools and bcftools functionality directly from Python without shell subprocess overhead
  • Build custom bioinformatics tools that need to read FASTA/FASTQ sequences and alignment data

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

pysam is actively maintained, has no runtime dependencies, carries a permissive MIT license, and is essential for any Python-based genomic data processing. Medium install friction is offset by prebuilt wheels for modern Python versions and the absence of external runtime requirements. No known vulnerabilities.

Install

pysam on PyPI

Before you install

Medium install friction due to compiled C extensions via Cython wrapping HTSlib; prebuilt wheels available for common Python versions (3.10–3.13) and platforms (macOS, Linux, musl). Active maintenance with last commit 2026-08-10.

Requires HTSlib C library and development headers; pysam is a compiled extension and cannot be used without a compatible binary wheel or build environment.

License in practice

MIT License (permissive) allows use in proprietary and open-source projects with minimal restrictions; attribution required.

Quickstart

import pysam

# Open and read a BAM file
bamfile = pysam.AlignmentFile('example.bam', 'rb')
for read in bamfile:
    print(read.query_name, read.query_sequence)
bamfile.close()

Verify before relying

  • Whether the package works on Windows (classifiers list MacOS/POSIX/Unix but no Windows wheel evidence)
  • Performance characteristics for large genomic datasets
  • Exact HTSlib version bundled or required

Package facts

LicenseMIT License permissive
Python supportSupports the current Python release >=3.8
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceActively maintained 109 days since the last release
Last repo commit
First released
Downloads1,291,977 / month, #4,103 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonTopic :: Scientific/EngineeringTopic :: Software Development

Evidence: pysam-0.24.0-cp310-cp310-macosx_10_9_x86_64.whl; pysam-0.24.0-cp310-cp310-macosx_11_0_arm64.whl; pysam-0.24.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pysam-0.24.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pysam-0.24.0-cp310-cp310-musllinux_1_2_aarch64.whl; pysam-0.24.0-cp310-cp310-musllinux_1_2_x86_64.whl; pysam-0.24.0-cp311-cp311-macosx_10_9_x86_64.whl; pysam-0.24.0-cp311-cp311-macosx_11_0_arm64.whl; pysam-0.24.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pysam-0.24.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pysam-0.24.0-cp311-cp311-musllinux_1_2_aarch64.whl; pysam-0.24.0-cp311-cp311-musllinux_1_2_x86_64.whl; pysam-0.24.0-cp312-cp312-macosx_10_13_x86_64.whl; pysam-0.24.0-cp312-cp312-macosx_11_0_arm64.whl; pysam-0.24.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pysam-0.24.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pysam-0.24.0-cp312-cp312-musllinux_1_2_aarch64.whl; pysam-0.24.0-cp312-cp312-musllinux_1_2_x86_64.whl; pysam-0.24.0-cp313-cp313-macosx_10_13_x86_64.whl; pysam-0.24.0-cp313-cp313-macosx_11_0_arm64.whl

Tags

Capabilities
genomic file parsingSAM BAM VCF file handlingbioinformatics data processingHTSlib Python wrappergenomic sequence analysisNGS data manipulationsamtools bcftools Python
Topics
bioinformaticsgenomicshtSlib-wrapper

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “genomic file parsing”

  • pysampysam reads, manipulates, and writes genomic data files…
  • gtfparseParses GTF (gene transfer format) files into DataFrames, extracting…
  • cyvcf2cyvcf2 is a Cython wrapper around htslib that parses VCF and BCF…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also cyvcf2 · dnaio · NREL-PySAM · pyfaidx · pyensembl · pybedtools · bio · pyteomics · pysylph · pybigtools