Skip to main content

# Fixed Width Data File Creator This is a simple library for creating fixed-width text data files or text files (txt or csv) separated by a certain separator character.

You can use it to exchange data between APIS and other applications.

## Installation

To install the package, just run the command below:

pip install pyFixedWidthDataFile

## Usage

  1. Instantiate the class:

from pyFixedWidthDataFile import FWDataFile app = FWDataFile(path_to_specs_folder, optional_separator)

  • path_to_specs_folder: Path to the folder containing the Specs Files;

  • optional_separator: Separation character between fields (optional)

  1. Specs Files: Files, JSON standard, with specifications of the fields contained in the lines (records).

see example in tests/specs

Open the record with “{”, enter the name clause, it is mandatory. Open the list of objects of type field with “fields {”, enter the id of the field and enter the characteristics of the field.

# Characteristics List * name: (required) name of the field * start_pos: (required) starting position * end_pos: (required) end position * format: (required) field type, which can be: > 1. alpha: alphanumeric, text > 2. num: numeric (integer, floating point) * default: (optional) default value of the field, if there is no default value the field will not be filled with spaces, even if it is numeric. * decimals: (optional) only for numeric fields, number of decimal places * ignore: (optional) field to be ignored * required: (optional) mandatory field * regex: (optional) regular expression operations field

  1. Inject the lines from the file:

app.append_line(“header”,cod_client=”1234”,name_client=”Alexandre Defendi”)

  1. use the result:

print(app)

“R000001PED1234 Alexandre Defendi X”

## License

This project is under the MIT license. See the [LICENSE](LICENSE.txt) file for more details.

Metadata

Release files for pyFixedWidthDataFile 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyFixedWidthDataFile 0.0.6
File Size Uploaded Provenance Actions
pyFixedWidthDataFile-0.0.6.tar.gz 6.3 kB Without provenance Details for pyFixedWidthDataFile-0.0.6.tar.gz

Built distribution (wheel)

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

Total release size: 13.5 kB

Release files / pyFixedWidthDataFile-0.0.6.tar.gz

Download URL pyFixedWidthDataFile-0.0.6.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ac2a1ffe95b335417ce535bff83ef3fe3022b314739404e20d42e5eefa06d674
BLAKE2b-256 checksum
How to use checksums
cd4c76cfb4d1d3c4023fb227dd907f770e7bcd43c315d0a52a292432e90b2aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyFixedWidthDataFile-0.0.6-py3-none-any.whl

Download URL pyFixedWidthDataFile-0.0.6-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d5dc0098aa70c6c8e1597253ae13e973050359d2c42158e1ea8cfa6edcc0af3
BLAKE2b-256 checksum
How to use checksums
05030b1bce05e99697d6348e6025786f28202132d8e25594b675dbb1a20e17d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for pyFixedWidthDataFile 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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