{"id":23621,"library":"dnaio","title":"dnaio","description":"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.","status":"active","version":"1.2.4","language":"python","source_language":"en","source_url":"https://github.com/marcelm/dnaio","tags":["bioinformatics","fasta","fastq","file-io"],"install":[{"cmd":"pip install dnaio","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Main entry point; use dnaio.open() to read/write sequence files.","symbol":"open","correct":"import dnaio"},{"note":"Data class for sequence records.","symbol":"SequenceRecord","correct":"from dnaio import SequenceRecord"}],"quickstart":{"code":"import dnaio\n\nwith dnaio.open('example.fasta') as f:\n    for record in f:\n        print(record.name, record.sequence)\n\n# Writing\nwith dnaio.open('output.fasta', mode='w') as f:\n    f.write(dnaio.SequenceRecord('seq1', 'ACGT'))","lang":"python","description":"Basic usage: read and write FASTA/FASTQ using dnaio.open(). Records have .name, .sequence, .qual attributes."},"warnings":[{"fix":"records = list(dnaio.open('file.fastq'))","message":"dnaio.open() returns an iterator, not a list. If you need random access or indexing, load records into a list first.","severity":"gotcha","affected_versions":"all"},{"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)","message":"The old dnaio.read() and dnaio.write() functions are deprecated since version 1.0. Use dnaio.open() instead.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"with dnaio.open('file.fastq', quality_scale=64) as f: ...","message":"FASTQ quality scores are automatically converted to Phred+33; if your file uses Phred+64, you must specify quality_scale=64.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.2.4':16 'activ':20 'api':29 'base':28 'bioinformat':33 'compress':32 'current':14 'develop':21 'dnaio':1 'effici':13 'fasta':9,34 'fastq':11,35 'file':12,37 'file-io':36 'io':38 'iter':27 'iterator-bas':26 'librari':4 'period':18 'provid':23 'python':3 'read':6 'releas':17 'simpl':25 'support':31 'version':15 'write':8","created_at":"2026-05-01T08:08:44.458891+00:00","updated_at":"2026-05-01T08:08:44.458891+00:00","problems":[{"fix":"Use dnaio.open() instead: with dnaio.open('file.fasta') as f: for record in f: ...","cause":"The legacy dnaio.read() and dnaio.write() functions were removed in version 1.0.0.","error":"AttributeError: module 'dnaio' has no attribute 'read'"},{"fix":"Pass the filename as a string, not a file object. Ensure mode is 'r' (default) for reading.","cause":"Calling dnaio.open() on a file object without specifying format or mode correctly.","error":"TypeError: '_io.TextIOWrapper' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.4","cli_name":"","cli_version":null,"type":"library","homepage":"https://dnaio.readthedocs.io/","github":"https://github.com/marcelm/dnaio","docs":null,"changelog":"https://dnaio.readthedocs.io/en/latest/changes.html","pypi":"https://pypi.org/project/dnaio/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}