Skip to main content

nanofastq

License Python Versions Package Version CodSpeed

Tiny FASTQ reader (C + nanoarrow) exposing __arrow_c_stream__.

import pyarrow as pa
from nanofastq import read_fastq

table = pa.table(read_fastq("reads.fastq.gz"))

Examples

Load into DuckDB

import duckdb
from nanofastq import read_fastq

duckdb.register("fastq", read_fastq("example.fastq"))
duckdb.sql("select * from fastq").fetchall()

Load into a Polars dataframe

Note: this also requires installing PyArrow.

import polars as pl
from nanofastq import read_fastq

df = pl.DataFrame(read_fastq("example.fastq"))

Reading file-like objects

Starting with nanofastq v0.0.5, read_fastq also accepts a binary file object (anything with read(n) -> bytes), such as an open file, io.BytesIO, an fsspec file or an HTTP response. Gzip is detected from the content. The file is not closed for you.

If the file object is seekable, every scan starts from the position it had when read_fastq was called (as reported by .tell()), whether or not the position moved in between. So the result can be scanned more than once, and two readers can read the same file object without affecting each other.

If it is not seekable (a pipe, sys.stdin.buffer, an HTTP response), it can only be scanned once: starting a second scan after the first has read data raises ValueError. Opening a stream without reading from it, as DuckDB does to get the schema, doesn't count.

Pyodide and JupyterLite

nanofastq has wheels for Pyodide (Python 3.14). Install it with await micropip.install("nanofastq"), or %pip install nanofastq in JupyterLite.

A browser gives Python no sockets, so urllib.request and requests cannot download a file there. Fetch it with the browser instead and read it from memory:

import io

from pyodide.http import pyfetch
from nanofastq import read_fastq

url = "https://raw.githubusercontent.com/biopython/biopython/master/Tests/Quality/example.fastq"
resp = await pyfetch(url)
records = read_fastq(io.BytesIO(await resp.bytes()))

This downloads the whole file before reading it, but only the downloaded bytes are kept: for a .fastq.gz that is the compressed size, and decompressing and parsing still stream one batch at a time. The server must allow cross-origin requests (raw.githubusercontent.com does).

Development

Run the tests and the type check with ty (requires Tox):

tox p

Performance is tracked with CodSpeed. Running the benchmarks locally only checks that they work; the reported numbers come from CI:

uv run pytest benchmarks/test_perf.py --codspeed

Releasing

The version is derived from git tags with setuptools-scm; there is no version to edit in pyproject.toml. Release Drafter keeps a draft GitHub release up to date from merged pull requests (their labels pick the section and the next version). To release, review the draft and publish it: that creates the vX.Y.Z tag, builds the wheels and uploads them to PyPI (see .github/workflows/wheels.yml). Untagged commits get development versions such as 0.1.dev12+gabc1234.

License

MIT. The wheels also contain nanoarrow (Apache-2.0), nanobind (BSD-3-Clause) and, on Windows, zlib; their notices are in THIRD_PARTY_NOTICES.txt.

Metadata

Release files for nanofastq 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanofastq 0.0.5
File Size Uploaded Provenance Actions
nanofastq-0.0.5.tar.gz 40.9 kB With provenance Details for nanofastq-0.0.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nanofastq 0.0.5
File Actions
nanofastq-0.0.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl CPython 3.14 CPython 3.14 PyEmscripten 2026.0+ WebAssembly Details for nanofastq-0.0.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl
nanofastq-0.0.5-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for nanofastq-0.0.5-cp312-abi3-win_amd64.whl
nanofastq-0.0.5-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for nanofastq-0.0.5-cp312-abi3-musllinux_1_2_x86_64.whl
nanofastq-0.0.5-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details for nanofastq-0.0.5-cp312-abi3-musllinux_1_2_aarch64.whl
nanofastq-0.0.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for nanofastq-0.0.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
nanofastq-0.0.5-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for nanofastq-0.0.5-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
nanofastq-0.0.5-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for nanofastq-0.0.5-cp312-abi3-macosx_11_0_arm64.whl
nanofastq-0.0.5-cp312-abi3-macosx_10_13_x86_64.whl CPython 3.12 abi3 macOS 10.13+ x86-64 Details for nanofastq-0.0.5-cp312-abi3-macosx_10_13_x86_64.whl

Total release size: 2.1 MB

Release files / nanofastq-0.0.5.tar.gz

Download URL nanofastq-0.0.5.tar.gz
Size 40.9 kB
Tags Source
SHA-256 checksum
How to use checksums
72234b7e1e5d3218bb8ab93f05e6e3547aa420ee4ede6045205254d6e5d02de5
BLAKE2b-256 checksum
How to use checksums
eba35b0523e1424114efb7a1110e2a6c69897c6c9551965b8267b5b353f652ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl

Download URL nanofastq-0.0.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Size 53.5 kB
Tags CPython 3.14 PyEmscripten 2026.0+ WebAssembly
SHA-256 checksum
How to use checksums
537ea807c714552ba1efcef3dcc875783860c82d9940a21a027d9681f5a92b9b
BLAKE2b-256 checksum
How to use checksums
5178d2ac809ff4fcee9b9637e42e5046f9d866b66d2dcb1dfe112ec2d8bfffc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-win_amd64.whl

Download URL nanofastq-0.0.5-cp312-abi3-win_amd64.whl
Size 340.5 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c9e82a8150defd2dab081a689ef8895f3ba63cfdc94932bcded516839fbaffb1
BLAKE2b-256 checksum
How to use checksums
be5febe0b372853ccc40eafb290432c2e356f504659839a0958d85b485ff7758
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL nanofastq-0.0.5-cp312-abi3-musllinux_1_2_x86_64.whl
Size 613.3 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
6d60b9a4404a5c3d8dc1f5b1a1d13585a5b85a57ccb67ed78092eff9b3f23953
BLAKE2b-256 checksum
How to use checksums
c6afd31fcf96c608591c3f9e008343f0755a2b35153004921e82d8292c724f35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL nanofastq-0.0.5-cp312-abi3-musllinux_1_2_aarch64.whl
Size 576.6 kB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a99ad7585f9c6523b4445f53551a0e798b5eb82b245ca12f629cdff945085f66
BLAKE2b-256 checksum
How to use checksums
0feca7f7b3ee9bf5d56b50ec02f67fd4fce4abf829e796bfbbe61c153df7d1bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL nanofastq-0.0.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 156.3 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
a17befc276450009a0d089e83e34207bd9b483759143b07edc353b2a65d414b2
BLAKE2b-256 checksum
How to use checksums
4ba0013f4e2712df62c0b0fe07dbcaba47f26214962d026614606edc805376f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL nanofastq-0.0.5-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 135.0 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
7a8687390d3c787842e57dabea8be067aeaf02d2c471b827b3b0ec511e1c8a2c
BLAKE2b-256 checksum
How to use checksums
574427622fc5e2e69db4c1f33ee6a0aef3504f126c3872e48a07f956ba582d2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-macosx_11_0_arm64.whl

Download URL nanofastq-0.0.5-cp312-abi3-macosx_11_0_arm64.whl
Size 81.6 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
28b9eb475857ae9219f9a1b240ed423c647a572c166bcc3df6202cd91b872225
BLAKE2b-256 checksum
How to use checksums
aa22c4dc26161602599a68aa75759c19804bf2001ac4d3c74b066524cb7f23e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / nanofastq-0.0.5-cp312-abi3-macosx_10_13_x86_64.whl

Download URL nanofastq-0.0.5-cp312-abi3-macosx_10_13_x86_64.whl
Size 96.7 kB
Tags CPython 3.12 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
7ad1d558c820a9b19129c96676af7593d2e454f56ef70e83186a3151ebaffe91
BLAKE2b-256 checksum
How to use checksums
afe09d759b0d97bfcf61bc28cccbf4005b2498b24d161d2ffd5a041eee127219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for nanofastq 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for nanofastq-0.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page