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.1

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.1
File Size Uploaded Provenance Actions
gtfreader-0.3.1.tar.gz 20.1 kB Without provenance Details for gtfreader-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gtfreader 0.3.1
File Interpreter ABI Platform Actions
gtfreader-0.3.1-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.28+ x86-64, Linux glibc 2.5+ x86-64 Details for gtfreader-0.3.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
gtfreader-0.3.1-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.5+ x86-64, Linux glibc 2.28+ x86-64 Details for gtfreader-0.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl

Total release size: 383.3 kB

Release files / gtfreader-0.3.1.tar.gz

Download URL gtfreader-0.3.1.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dacc2cb31d201057932c688274c555f1911ee2b8ab55c895293780b75b573ef8
BLAKE2b-256 checksum
How to use checksums
7c6cbb8f378c4bd5369235124bed4f3e0a452c79445e3559806c1ee53113525f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL gtfreader-0.3.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl
Size 216.0 kB
Tags CPython 3.13 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
88673d46bbb5909db6967cc41a8f0e0e5d3e494ff241d7ee897fdd17470471ad
BLAKE2b-256 checksum
How to use checksums
2997182af2188695c53511fcc835df7c8a3b55cf71d504d693062be86418711e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

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

Security for gtfreader 0.3.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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