Skip to main content

gtfreader

Fast GTF reading into pandas DataFrames.

Install

python -m pip install -e .

Optional: parse on every core

pandas' CSV parser is single-threaded, and on a large GTF the nine fixed columns are about a third of the cost of reading. With pyarrow installed that part is parsed on every core instead:

python -m pip install -e ".[fast-io]"

read_gtf is 1.5x faster end to end at 10^6 rows on twelve cores. It is only the tabular parse that speeds up; expanding the attribute column is the rest of the work and is unchanged.

pandas remains the reference implementation and the fallback. The pyarrow path is skipped when pyarrow is missing, when nrows is set, when a file is shaped in a way it does not model, and whenever the two parsers would disagree -- the result is the same frame either way.

Example

from gtfreader import read_gtf

df = read_gtf("annotation.gtf")
print(df.columns)
print(df.head())

Metadata

Release files for gtfreader 0.3.0

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

Source distribution (sdist)

Source distribution for gtfreader 0.3.0
File Size Uploaded
gtfreader-0.3.0.tar.gz 19.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for gtfreader 0.3.0
File Interpreter ABI Platform
gtfreader-0.3.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details
gtfreader-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.5+ x86-64 Details

Total release size: 382.6 kB

Release files / gtfreader-0.3.0.tar.gz

Download URL gtfreader-0.3.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
99a09fe695229779376d13b81a186c714687ec9de9ed64dfb2ae52be2bfc557e
BLAKE2b-256 checksum
How to use checksums
9c01135abc57ed3e5dc5325411d8603457e41965ccaf4fcdec5d62b810a25ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gtfreader-0.3.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl

Download URL gtfreader-0.3.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
Size 215.8 kB
Tags CPython 3.13 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
f3037996e0792b39bf989e0aa9be95b441046bc04aa8bb9dc81802210c72c0d3
BLAKE2b-256 checksum
How to use checksums
ed2af9da79cc98b37846e9e34bb8b093e7810b73d07561a736c9dbc2fb03927c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / gtfreader-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl

Download URL gtfreader-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
Size 147.1 kB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cd4f194c2867375ec22e847cc4e4bbcc76da6564d2098b3fb3f6cb14e1e02461
BLAKE2b-256 checksum
How to use checksums
e2c7be5c1eb68bf70deeca831b7640cda96c39d4f1ada4e4e0bfed559052eaf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

3 release files

0.2.0

3 release files

0.1.2

3 release files

0.1.1

6 release files

0.1.0

1 release file

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