SimpleFixedWidth
A simple and very lightweight library for working with fixed width files.
Fixed_Width_Spec
class Field
Signature
Field(number: int, name: int, string: bool, size:int)
- number: int (Positional identifier for the field)
- name: str (Name of the field)
- string: bool (Indicates if the field is a string, if false it is numeric)
- size: int (Length of the field)
Example
Field(5, 'Name', True, 30)
class RecordType
Signature
RecordType(name="", fields=[])
- name: str (Name of the RecordType, if you have more than one)
- fields: list (List of fields for the specification tied to the RecordType)
- field_widths: tuple (Returns tuple of the widths from the fields)
- field_names: list (Returns list of the field names)
Fixed_Width_Record
function get_fields
Slices a string 's' in segments 'args' wide. Negative widths represent ignored padding fields.
Parameters
- s: string
- args: list of widths for the string, negative numbers are skipped
Returns string 's' in a list, minus the skipped fields
function get_line
Takes a string and extracts the record identifier if it exists.
Parameters
- string (String to be sliced into a list of fields)
- rec_type_start=-1 (If the string contains a record identifier, this will start to parse it out)
- rec_type_end=-1 (If the string contains a record identifier, this will end to parse it out)
Returns Tuple of the record identifier and the string it was in.
Metadata
Release files for SimpleFixedWidth 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SimpleFixedWidth-0.0.2.tar.gz | 2.2 kB | Without provenance | Details for SimpleFixedWidth-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SimpleFixedWidth-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for SimpleFixedWidth-0.0.2-py3-none-any.whl |
Total release size: 6.9 kB
Release files / SimpleFixedWidth-0.0.2.tar.gz
| Download URL | SimpleFixedWidth-0.0.2.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59ce222698e2335d5901d4e35d9177d4132fb716fd9d428a77c26d3bd9bcd0a6
|
|
BLAKE2b-256 checksum How to use checksums |
b406414db257afa1940b78f1add4aa5fdaf5fa53f50a8b47e0340af034322a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
|
Release files / SimpleFixedWidth-0.0.2-py3-none-any.whl
| Download URL | SimpleFixedWidth-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4e58dfa476465e6bd68a3c09d4a1df870ffce5ec996fd3372da4ff899822694
|
|
BLAKE2b-256 checksum How to use checksums |
1e1d7f91cc71410d33e0451bc6b7139212376c980834a42f0ed2c13a391e9954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
|
Security for SimpleFixedWidth 0.0.2
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.