Skip to main content

ihs29x

A simple spec-driven streaming ("SAX-style") parser for IHS 297 and 298 files, based on the specifications provided by twoninetyex. It handles 297 and 298 files in either fixed or comma delimited format. In accordance with my reading of the spec, it even handles intermixed formats within a single file, based on (sub-)file headers.

The only interesting function is ihs29x.stream_records, which may be called on an open file-like object in text mode.

Live documentation is available at https://derrickturk.github.io/ihs29x-python/docs/ihs29x.html.

Available under the MIT license.


Usage

For example, try:

import sys

from ihs29x import stream_records


def main(argv: list[str]) -> int:
    if len(argv) != 2:
        print(f'Usage {argv[0]} <298-or-297-file>', file=sys.stderr)
        return 2

    with open(argv[1]) as f:
        for r in stream_records(f):
            print(r)

    return 0


if __name__ == '__main__':
    sys.exit(main(sys.argv))

(c) 2023 terminus, LLC

Metadata

Release files for ihs29x 0.1.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 ihs29x 0.1.0
File Size Uploaded
ihs29x-0.1.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ihs29x 0.1.0
File Interpreter ABI Platform
ihs29x-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / ihs29x-0.1.0.tar.gz

Download URL ihs29x-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8b5e385b3ec616f89ec062cb07ac28f43016edd4f1544adca811df4a1dc60022
BLAKE2b-256 checksum
How to use checksums
e9cbe98850c3d0cac1a1af9b1ad4038fdd2e217d90bbd9b2e411b08f3da31bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / ihs29x-0.1.0-py3-none-any.whl

Download URL ihs29x-0.1.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73778612a8a7c06d746298e8b108d7b2113a510a5f3961e1f26b55983115fac9
BLAKE2b-256 checksum
How to use checksums
e26b88edd1000ec3bd030e40e159628ac2883264009465879dab92b87530d0cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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