Skip to main content

xlineparse

Python library to parse variable length delimited lines.

Usage

pip install xlineparse
import datetime as dt
from decimal import Decimal
from typing import Annotated, Literal

import xlineparse as xlp

FooLine = tuple[
    Literal["foo"],
    int,
    Decimal,
    Decimal | None,
    Annotated[bool, xlp.BoolField(true_value="Y", false_value="F")],
    Annotated[dt.date, xlp.DateField(format="%Y-%m-%d")],
    Annotated[dt.time, xlp.TimeField(format="%H%M%s")],
]
BarLine = tuple[
    Literal["bar"],
    int,
]
schema = xlp.Schema.from_type(
    delimiter="|",
    quote_str=None,
    trailing_delimiter=False,
    lines=FooLine | BarLine,
)

schema.parse_line("foo|1|3.14||Y|2012-01-02|123200")

#  Will return:

(
    "foo",
    1,
    Decimal("3.14"),
    None,
    True,
    dt.date(2012, 1, 2),
    dt.time(12, 32, 0),
)

Or directly construct Fields:

schema = xlp.Schema(
    delimiter="|",
    quote_str=None,
    trailing_delimiter=False,
    lines=[
        xlp.Line(
            name="a",
            fields=[
                xlp.DecimalField(
                    required=True,
                    round_decimal_places=None,
                    min_value=Decimal("2.0"),
                    max_value=None,
                )
            ],
        )
    ],
)
assert schema.parse_line("a|2.0")

#  Will return:

("a", Decimal("2.0"))

TODO:

  • Maybe the big decimals are just floats?
  • Allow delimiters to be escaped.
  • Can we make enums quicker by moving to Rust?

Install/Develop

uv pip install -e '.[dev]'
maturin develop

Make release

  • Add pypi token and user = __token__ to settings (do this once).
  • Upversion pyproject.toml.
git tag -a v0.0.x head -m v0.0.x
git push origin v0.0.x

Metadata

Release files for xlineparse 0.0.6

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

Built distributions (wheels)

Table of built distributions (wheels) for xlineparse 0.0.6
File
xlineparse-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
xlineparse-0.0.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.12 CPython 3.12 Linux glibc 2.5+ x86-32, Linux glibc 2.17+ x86-32 Details
xlineparse-0.0.6-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
xlineparse-0.0.6-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
xlineparse-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
xlineparse-0.0.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
xlineparse-0.0.6-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
xlineparse-0.0.6-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details
xlineparse-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
xlineparse-0.0.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
xlineparse-0.0.6-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
xlineparse-0.0.6-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details

Total release size: 6.9 MB

Release files / xlineparse-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xlineparse-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 657.8 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6dff9dae62f339802fa3aa698f08f2bcbcfc1adad51f7eb351ebeff3d017dc26
BLAKE2b-256 checksum
How to use checksums
720ccc74696aee116b06c226e9a421de97ee9ba362050ad2b9fa1eaac729d430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / xlineparse-0.0.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL xlineparse-0.0.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 652.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
5369069181b5de5f313833fbd661f9754e123c3b0e6901572de9c62402fb8d67
BLAKE2b-256 checksum
How to use checksums
a2fd5d91e29589245533a9cd4719636bd54c6473d80535ae221d3d6214b27b18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / xlineparse-0.0.6-cp312-cp312-macosx_11_0_arm64.whl

Download URL xlineparse-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Size 488.9 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
52d9b53fec7b3f69d3da785f959651d1d0c4033db34ed8f032c7e7185041929f
BLAKE2b-256 checksum
How to use checksums
37fbd8285d17768f654e459d14438be19e4d2072cb9496b2d2e25ee655e33a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / xlineparse-0.0.6-cp312-cp312-macosx_10_12_x86_64.whl

Download URL xlineparse-0.0.6-cp312-cp312-macosx_10_12_x86_64.whl
Size 488.2 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c7f4f8a5f9638003e9a5f56f0d87d76482dc1a5ae19967031a331aa6b03ad488
BLAKE2b-256 checksum
How to use checksums
35339aca6df117a06c30811b544ca3899c8553dce540d9f15ebbe3dc93a13bc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / xlineparse-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xlineparse-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 658.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
90118783c0bf77c80d7361f51f3626ceb5931637406e334a48e79dfe1c907249
BLAKE2b-256 checksum
How to use checksums
37167686cd5130b105f56c9ddc0d3641b43aa8c31c9352cde60639f7d5877ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / xlineparse-0.0.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL xlineparse-0.0.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 652.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
bee2ae28cad2441543a0f718f492f7c4a757c5b638168f53e1abd952d12425a6
BLAKE2b-256 checksum
How to use checksums
75c4eb5cbcc8a75b9d2b68cdc4f92f304443af26fd7080169d193127be38aa9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / xlineparse-0.0.6-cp311-cp311-macosx_11_0_arm64.whl

Download URL xlineparse-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Size 489.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4e3086ccf2b41da8594b56f0ad00b5a636090e3894340a1b0f603008ae1d652f
BLAKE2b-256 checksum
How to use checksums
92f20a8d3adc5437ffb23403bbefea3e30c7470bfc55a6c036c0131e3e80d760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / xlineparse-0.0.6-cp311-cp311-macosx_10_12_x86_64.whl

Download URL xlineparse-0.0.6-cp311-cp311-macosx_10_12_x86_64.whl
Size 488.7 kB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
873fec527eb9216d36f79564294339d31d93588ac853da1e4b77e20f09b63ec8
BLAKE2b-256 checksum
How to use checksums
44160ebaf1d17fce351616a5bdfafa70c41d110f3115072d0ec014471390a4b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / xlineparse-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xlineparse-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 658.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
35ef78204ce80616f2f87a42c27cbe8a72b85d3b059eedd5a64f746588ce41cf
BLAKE2b-256 checksum
How to use checksums
51378ac919f629f40e046c0f35d7be358f81c2a14c6391f1be81b5f365ad006a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release files / xlineparse-0.0.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL xlineparse-0.0.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 652.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
08a8892be1d66806aeab50f559cbecc78ed1a788ce38976923fb7be87a965e4a
BLAKE2b-256 checksum
How to use checksums
8bab5d788a93687e8cd956634e55657dfa521ae13693cbb8346ebf9b04d21ca9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release files / xlineparse-0.0.6-cp310-cp310-macosx_11_0_arm64.whl

Download URL xlineparse-0.0.6-cp310-cp310-macosx_11_0_arm64.whl
Size 489.5 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
37bbc3698d16b1f7200aefe88c9096cc5d245f8994d2e17c98153b1e3ffbd957
BLAKE2b-256 checksum
How to use checksums
433bb67b62d8d1c5de243b7cd8209177a3f8302ec763ca4792f38414ddbf961e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.11

Release files / xlineparse-0.0.6-cp310-cp310-macosx_10_12_x86_64.whl

Download URL xlineparse-0.0.6-cp310-cp310-macosx_10_12_x86_64.whl
Size 488.7 kB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
61ccbe833f1ddf3a430c3235f1b8933c9c9b6b5854b2585e5edcd58628cbb51b
BLAKE2b-256 checksum
How to use checksums
9a0c89517897819729ccb581e68a6ac0b87538f082d8ab0234f2b10717e2577c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Security for xlineparse 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