skillfed

dnaio

Read and write FASTA and FASTQ files efficiently

dnaio v1.2.4 92.4K downloads/30d#13,454 on PyPI70
Permissive license MIT AGING released

What it is and what it does

dnaio is a Python library for reading and writing FASTQ, FASTA, and uBAM sequence files with a focus on parsing speed and efficiency. It originated as part of the Cutadapt tool and has been refined since becoming standalone. The library automatically detects and handles compressed files (.gz, .bz2, .xz, .zst) and supports both single-file and two-file paired-end workflows, as well as interleaved paired-end formats. It can parse uBAM files directly from ONT basecallers like dorado.

The main entry point is dnaio.open(), which returns an iterator over sequence records. Each record exposes name, sequence, and quality attributes. The library prioritizes FASTQ and uBAM parsing; FASTA parsing is supported but not as heavily optimized. It does not support multi-line FASTQ files. Installation is straightforward via pip, with optional zstandard support for .zst compression.

Use it for:

  • Parse large FASTQ files from sequencing runs in genomics pipelines without loading entire files into memory
  • Read uBAM output directly from ONT dorado basecaller for real-time or batch processing
  • Handle automatically-compressed FASTQ/FASTA files across multiple compression formats in a single workflow
  • Process paired-end sequencing data stored in two separate files or a single interleaved file
  • Extract sequence and quality information for downstream bioinformatics analysis (alignment, QC, filtering)

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

dnaio reads and writes FASTQ, FASTA, and uBAM files with optimized parsing for bioinformatics workflows, automatically handling compressed formats like .gz, .bz2, .xz, and .zst.

Yes, if you work with FASTQ, FASTA, or uBAM files in bioinformatics. dnaio is production-stable (Development Status 5), has no known vulnerabilities, and offers efficient parsing with minimal dependencies (only xopen). The MIT license is unrestricted. Maintenance is aging (306 days since last release), but the repo remains active and the library is mature. Install friction is medium due to compiled components, but prebuilt wheels are available for modern Python and common platforms.

Install

dnaio on PyPI

pip

pip install dnaio

uv

uv add dnaio

poetry

poetry add dnaio

Installing dnaio

Before you install

Medium install friction due to compiled components (Cython-based), but prebuilt wheels cover modern Python versions (3.10–3.14) and major platforms. Last release was 306 days ago; repo is active and not archived, though maintenance pace is aging.

License in practice

MIT license is permissive; you can use, modify, and distribute dnaio freely in commercial and private projects with minimal restrictions.

Quickstart

pip install dnaio

import dnaio

with dnaio.open("reads.fastq.gz") as f:
    for record in f:
        print(record.name, len(record.sequence))

Requires Python 3.10 or later. Optional: install zstandard for .zst file support.

Verify before relying

  • Performance benchmarks comparing dnaio to other FASTQ parsers in the ecosystem
  • Memory footprint for large files (e.g., multi-gigabyte FASTQ datasets)
  • Interleaved paired-end parsing behavior and API details

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — xopen
Maintenance aging — 306 days since the last release
Last repo commit
First released
Downloads 92,387/month — #13,454 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dnaio-1.2.4-cp310-cp310-macosx_11_0_arm64.whl; dnaio-1.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp310-cp310-win_amd64.whl; dnaio-1.2.4-cp311-cp311-macosx_11_0_arm64.whl; dnaio-1.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp311-cp311-win_amd64.whl; dnaio-1.2.4-cp312-cp312-macosx_11_0_arm64.whl; dnaio-1.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp312-cp312-win_amd64.whl; dnaio-1.2.4-cp313-cp313-macosx_11_0_arm64.whl; dnaio-1.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp313-cp313-win_amd64.whl; dnaio-1.2.4-cp314-cp314-macosx_11_0_arm64.whl; dnaio-1.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp314-cp314t-macosx_11_0_arm64.whl; dnaio-1.2.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dnaio-1.2.4-cp314-cp314t-win_amd64.whl; dnaio-1.2.4-cp314-cp314-win_amd64.whl

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchProgramming Language :: CythonProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Bio-Informatics

Tags

fastq parser pythonfasta file readerubam parsingbioinformatics sequence filescompressed fastq handlingpaired-end fastqsequence data io
bioinformaticssequence-parsinggenomics

More Bio-Informatics packages