skillfed

FixedWidth

Two-way fixed-width <--> Python dict converter.

fixedwidth v1.3 1.1M downloads/30d#4,386 on PyPI49
Permissive license BSD AGING released

What it is and what it does

FixedWidth is a Python library for bidirectional conversion between fixed-width text records and Python dictionaries. It uses a configuration dictionary to define field positions, types, alignment, and padding, then parses fixed-width strings into dicts or serializes dicts back to fixed-width format. The library supports string, integer, and decimal types, with configurable date formatting and decimal precision.

The package has a minimal dependency footprint (only six) and low install friction. It was designed for production use and has reportedly run unchanged for several years. However, maintenance is aging—the latest release dates to 2018, and there is no recent activity. The library's main value lies in handling legacy fixed-width data formats, which remain common in certain data integration scenarios.

Use it for:

  • Parse fixed-width records into Python dicts for processing or database import
  • Generate fixed-width output files for systems that require strict positional field formatting
  • Debug and validate fixed-width file specifications by catching configuration errors early
  • Convert between fixed-width flat-file formats and in-memory Python data structures
  • Integrate fixed-width data pipelines in batch processing workflows

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts between Python dictionaries and fixed-width text files in both directions, with configuration-driven field parsing and validation.

Yes, if you need to work with fixed-width files. The package is lightweight, permissively licensed, and has proven stable in production. However, be aware that maintenance is aging (last release 2018) and Python version support is unspecified—test compatibility with your target Python version before relying on it in new projects.

Install

fixedwidth on PyPI

pip

pip install fixedwidth

uv

uv add fixedwidth

poetry

poetry add fixedwidth

Installing FixedWidth

Before you install

Low install friction with a single lightweight dependency (six). Maintenance is aging—last release was in 2018 and the repository has not been updated since 2025-04-22, though it remains unarchived and the package has been in production use for several years without modification.

License in practice

BSD permissive license places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install FixedWidth

from fixedwidth import FixedWidth

config = {
    'name': {'type': 'string', 'start_pos': 1, 'end_pos': 10, 'alignment': 'left', 'padding': ' '}
}
fw = FixedWidth(config)
record_dict = fw.parse(fixed_width_line)
fixed_width_line = fw.to_fixed_width(record_dict)

Verify before relying

  • Whether the package works with modern Python versions beyond those it was originally tested against
  • Whether the repository's last commit date (2025-04-22) indicates active maintenance or is a stale timestamp
  • Current compatibility with six and whether six remains actively maintained

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — six
Maintenance aging — 2,990 days since the last release
Last repo commit
First released
Downloads 1,085,695/month — #4,386 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: FixedWidth-1.3-py3-none-any.whl

Keywords: fixed, width

Tags

fixed-width file parserfixed width text conversiondict to fixed-widthfixed-width format handlerparse fixed-width recordsfixed-width data extraction
legacy-data-formatfile-parsingetl

More Text Processing packages