Skip to main content

Fixed width text parser to array

Parsing different defined text formats to array data

Parser - parse anything according to the format definition

For use cases check tests folder

Format definition:

definition = {
    'FIELD_1': [0, 1, 'string'],
    'FIELD_2': [1, 10, 'float'],
    'FIELD_3': [11, 10, 'float'],
    'FIELD_4': [23, 1, 'integer'],
    'FIELD_5': [24, 2, 'string'],
    'FIELD_6': [26, 4, 'integer', 0],
    'FIELD_7': [30, 4, 'integer', None],
    'FIELD_8': [34, 4, 'float', None],
    'FIELD_9': [38, 4, 'float', 0.0],
}

Field definition 'FIELD_6': [26, 4, 'integer', 0]

  • 'FIELD_6' - field name
  • 26 - index of text line where the field starts (count starts from 0)
  • 4 - field length in characters
  • string - field value type (allowed types: string, integer, float)
  • 0 - default value if empty in text line record

For every data type default value is always None if field results as empty string. For every data type it is possible to set default value in format definition.

Specific format parsers

  • Seismic.SpsParser.Sps21Parser - SPS format version num. SPS 2.1, JAN2006
  • Seismic.VibratorParser.ApsParser
  • Seismic.VibratorParser.CogParser
  • Seismic.VibratorParser.VapsParser

File formats

References

Metadata

Release files for FixedWidthTextParser 0.4.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 FixedWidthTextParser 0.4.1
File Size Uploaded
FixedWidthTextParser-0.4.1.tar.gz 9.6 kB Details

Built distribution (wheel)

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

Total release size: 22.5 kB

Release files / FixedWidthTextParser-0.4.1.tar.gz

Download URL FixedWidthTextParser-0.4.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c51a7e06d5bfd09e97e24c7a014aea6e61cc43f1ffb9018e1db4f50a5e351857
BLAKE2b-256 checksum
How to use checksums
4263f18b7f935760ef7a058a57d8af4b6e9d7fb46f28959dd26e5ca33d87373a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / FixedWidthTextParser-0.4.1-py3-none-any.whl

Download URL FixedWidthTextParser-0.4.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbb86f48cc44c24c580b28de3ee6c9ff1584486de97a97419a11f93d587452bb
BLAKE2b-256 checksum
How to use checksums
97c91ebfa44fda30870ae06fddc6f55d08e42c999ac25ff67afeeb980d7ac8bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

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