Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

This package provides tools for building fast parsers of files composed of fields width records where one of the fields in the record specifies what type of record the line is.

The parsers built using this package yield named tuples containing the information in each row.

The parsers are specified using a simple and succinct declarative style:

from fixed import Parser, Record, Field, Discriminator, Skip

class Header(Record):
    type = Discriminator('H')
    row_count = Field(8, int)

class Data(Record):
    type = Discriminator('D')
    source = Field(5)
    junk = Skip(10)
    destination = Field(5)

 parser = Parser(Header, Data)

Release history Release notifications | RSS feed

This release

1.0dev This release

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