Skip to main content

High-performance line ending normalization for Python.

Project description

eolify

High-performance line ending normalization for Python, powered by Rust.

eolify provides fast and memory-efficient conversion between LF (\n) and CRLF (\r\n) line endings for text, files, and streams.

Features

  • Fast Rust implementation
  • Supports LF and CRLF normalization
  • Memory-efficient file processing
  • Cross-platform
  • Typed API with Python type hints

Installation

pip install eolify

Pre-built wheels are available for common platforms, so a Rust toolchain is usually not required.

Quick Start

Normalize text

import eolify

text = "hello\r\nworld\r\n"

normalized = eolify.normalize_text(
    text,
    eolify.Mode.LF,
)

print(repr(normalized))
# 'hello\nworld\n'

Normalize a file

import eolify

eolify.normalize_file(
    "input.txt",
    "output.txt",
    eolify.Mode.LF,
)

By default, the destination file must not already exist.

eolify.normalize_file(
    "input.txt",
    "output.txt",
    eolify.Mode.LF,
    overwrite=True,
)

API

normalize_text(text, mode) -> str

Normalize line endings in a string.

Parameters:

  • text: Input text.
  • mode: Mode.LF or Mode.CRLF.

Returns:

  • The normalized string.

normalize_file(input, output, mode, overwrite=False) -> None

Normalize line endings while copying one file to another.

Parameters:

  • input: Source file path.
  • output: Destination file path.
  • mode: Mode.LF or Mode.CRLF.
  • overwrite: Whether an existing destination file may be replaced.

Modes

eolify.Mode.LF
eolify.Mode.CRLF

Why eolify?

Python's built-in newline handling is often sufficient, but there are situations where explicit normalization is desirable:

  • Converting files between platforms
  • Preparing source archives
  • Processing generated files
  • Build and CI pipelines
  • Working with mixed line endings

eolify uses the same Rust implementation as the eolify crate, providing predictable and efficient normalization behavior.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eolify-0.1.4.tar.gz (7.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

eolify-0.1.4-cp39-abi3-win_amd64.whl (121.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

eolify-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl (241.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

eolify-0.1.4-cp39-abi3-macosx_11_0_arm64.whl (213.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file eolify-0.1.4.tar.gz.

File metadata

  • Download URL: eolify-0.1.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eolify-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9421cc9fde990a376433ed14ddaf5aab5458cf57f76fafdcc1ee449010de34a6
MD5 afdc5435b5c8646791c1b02715f09b0e
BLAKE2b-256 d8a28383a7f61f171231d84c5be9208eb52642cb84b714be5fc45246f38de52c

See more details on using hashes here.

Provenance

The following attestation bundles were made for eolify-0.1.4.tar.gz:

Publisher: publish.yml on cygnus9/eolify-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eolify-0.1.4-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: eolify-0.1.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 121.0 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eolify-0.1.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 858c386c127f1faff5502b139c9ea6308074e91a90671fe6ce96532942182689
MD5 2b1c3b7800128f98bebe94cdf1acad78
BLAKE2b-256 e3db754a2dd86e81c2c05822e608f0ae600b31fb9ff16fc6a3a747bb9f1b8a56

See more details on using hashes here.

Provenance

The following attestation bundles were made for eolify-0.1.4-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on cygnus9/eolify-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eolify-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for eolify-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aac5343e34eca4a8ef0368b0f1f5722e40b9f5d12689d599fdb5b1c84368109f
MD5 8ebb62007e1fa2bf921cf0a520beed93
BLAKE2b-256 28b6b9e101ef2af4d130f80f897faf82c153683d0d8686dd52eac98f34f733a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for eolify-0.1.4-cp39-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on cygnus9/eolify-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eolify-0.1.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: eolify-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 213.4 kB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eolify-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4d9f6b8c9d335d240072ab23290edbd64729f52c47bae62d2742cda6527b2fc
MD5 44e7ae163d14dbd5b3c7292609cbf157
BLAKE2b-256 16b4c31fbe2df95c641190acc853f9ffd4d1abef6d76a8571f32b56fb48355fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for eolify-0.1.4-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on cygnus9/eolify-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page