Skip to main content

Fixed-width file parser for legacy logistics & supply chain data

Project description

FixedWidth Forge

PyPI version PyPI - Python Version GitHub

Parse legacy fixed-width files from logistics, warehouses, ERP systems, and mainframes — instantly.

Turn messy carrier reports, shipment manifests, and COBOL exports into clean CSV or JSON with a simple YAML schema.

Why Logistics & Supply Chain?

Legacy formats like fixed-width flat files, EDI, and proprietary mainframes are the glue of the supply chain. fwforge provides the bridge to modern data pipelines without the enterprise bloat.

Features

  • Schema-Driven: Define column layouts in YAML. Supports start+length or start+end positions.
  • Ultra-Fast: Built on Python principles for rapid parsing of multi-gigabyte flat files.
  • Batch Processing: Process entire directories of manifest exports with one command.
  • Inference Engine: Use --infer to automatically generate a baseline schema from a sample data file.
  • Clean Output: Transform legacy data to clean CSV or JSON with built-in type casting.

Installation

pip install fwforge

Install from source (latest dev):

pip install git+https://github.com/TallowX92/fwforge.git

Quick Start

1. Infer a schema

Start from scratch with a sample file:

fwforge --infer -i data.txt > my-layout.yaml

2. Parse data

Convert legacy data to CSV (using the included sample):

fwforge -i data.txt -s layout.yaml -f csv -o output.csv
cat output.csv

3. Batch process a folder

fwforge -i ./daily_manifests/ -s manifest.yaml -f json

Example Schema (layout.yaml)

name: "Freight-Manifest-v1"
columns:
  - name: "carrier_code"
    start: 0
    length: 5
    trim: true
    type: "string"
  - name: "weight"
    start: 20
    length: 10
    trim: true
    type: "float"

Development

# Clone and setup
git clone https://github.com/TallowX92/fwforge.git
cd fwforge
uv sync
uv run pytest -v

# Run CLI
uv run fwforge --help

Roadmap

  • More robust type casting (dates, currency, custom)
  • Schema validation + strict mode
  • Better inference (header detection, multi-line records)
  • Performance / memory improvements for GB+ files
  • Standalone binary releases
  • Expanded output formats (parquet, etc.)

Changelog

See CHANGELOG.md for release notes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fwforge-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fwforge-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file fwforge-0.1.0.tar.gz.

File metadata

  • Download URL: fwforge-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fwforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c74a8677e1d619c255fa998edebd77e34a83737dadd0223d81e8a13b1877a81
MD5 f04b2023976f64fbe2aad6b0b2d2f66f
BLAKE2b-256 91e773a57bd1d15c4c02ed305b425eb0dbcb3298596d2f91748b1276af6e3148

See more details on using hashes here.

File details

Details for the file fwforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fwforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fwforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 029531c86257adf9a8e9c58f83103a1b1209a0c384781713210dd863c1bb3762
MD5 a14c5c8a5f69de76cd9aca6147ae8a99
BLAKE2b-256 5d123438aa6d9046944631d84e6a0b039c22ce5bc3a3a55eeda7fecf4ca7b1b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page