Registry / data / dnaio
library1.2.4pypypi✓ verified 86d ago

A Python library for reading and writing FASTA and FASTQ files efficiently. Current version 1.2.4, released periodically with active development. It provides a simple iterator-based API and supports compression.

pip install dnaio
INSTALL
IMPORT
SIG · DNAIO
D
dnaio
datapythonv1.2.4
Install
2.0s avg
Import
116ms
Disk
19MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.0s · import 0.116s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

open
import dnaio
Main entry point; use dnaio.open() to read/write sequence files.
SequenceRecord
from dnaio import SequenceRecord
Data class for sequence records.

Basic usage: read and write FASTA/FASTQ using dnaio.open(). Records have .name, .sequence, .qual attributes.

import dnaio with dnaio.open('example.fasta') as f: for record in f: print(record.name, record.sequence) # Writing with dnaio.open('output.fasta', mode='w') as f: f.write(dnaio.SequenceRecord('seq1', 'ACGT'))
Debug
Known issues
gotchadnaio.open() returns an iterator, not a list. If you need random access or indexing, load records into a list first.
fix
records = list(dnaio.open('file.fastq'))
affects: all
deprecatedThe old dnaio.read() and dnaio.write() functions are deprecated since version 1.0. Use dnaio.open() instead.
fix
Replace dnaio.read('file') with dnaio.open('file') and dnaio.write('file', records) with dnaio.open('file', mode='w') as f: for r in records: f.write(r)
affects: >=1.0
gotchaFASTQ quality scores are automatically converted to Phred+33; if your file uses Phred+64, you must specify quality_scale=64.
fix
with dnaio.open('file.fastq', quality_scale=64) as f: ...
affects: all
Errors
Common errors & fixes
AttributeError: module 'dnaio' has no attribute 'read'
The legacy dnaio.read() and dnaio.write() functions were removed in version 1.0.0.
fix
Use dnaio.open() instead: with dnaio.open('file.fasta') as f: for record in f: ...
TypeError: '_io.TextIOWrapper' object is not iterable
Calling dnaio.open() on a file object without specifying format or mode correctly.
fix
Pass the filename as a string, not a file object. Ensure mode is 'r' (default) for reading.
Upgrade
Version history
1.2.4latest on PyPI · released Oct 12, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
dnaio — pip install dnaio · libregistry