Skip to main content

LF-CRLF Converter

A simple Python library to convert line endings between LF (Unix) and CRLF (Windows) formats.

Features

  • Convert individual files between LF and CRLF line endings
  • Recursively convert all files in a directory with common extensions
  • Support for various text-based file formats (.txt, .py, .html, .css, .js, .json, .xml, .md)

Usage

Installation

pip install lf-crlf

Basic Usage

from lfcrlf import convert_file, convert_dir

#Convert a single file from LF to CRLF
convert_file('path/to/file.txt', 'lf')

#Convert a single file from CRLF to LF
convert_file('path/to/file.txt', 'crlf')

#Convert all files in a directory from LF to CRLF
convert_dir('path/to/directory', 'lf')

## Convert all files in a directory from CRLF to LF
convert_dir('path/to/directory', 'crlf')

Supported File Types

The library automatically processes files with these extensions:

  • .txt
  • .py
  • .html
  • .css
  • .js
  • .json
  • .xml
  • .md

Requirements

Python 3.6 or higher

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  • Fork the project
  • Create your feature branch git checkout -b feature/AmazingFeature
  • Commit your changes git commit -m 'Add some AmazingFeature'
  • Push to the branch git push origin feature/AmazingFeature

Support If you have any questions or issues, please open an issue on GitHub.

Metadata

Release files for lf-crlf 0.0.3

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

Source distribution (sdist)

Source distribution for lf-crlf 0.0.3
File Size Uploaded Provenance Actions
lf_crlf-0.0.3.tar.gz 2.9 kB Without provenance Details for lf_crlf-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lf-crlf 0.0.3
File Interpreter ABI Platform Actions
lf_crlf-0.0.3-py3-none-any.whl Python 3 none any Details for lf_crlf-0.0.3-py3-none-any.whl

Total release size: 5.8 kB

Release files / lf_crlf-0.0.3.tar.gz

Download URL lf_crlf-0.0.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aec1e5bbd78dcc8e2ba99f8c7bb9146e7e91c5c2f9210e8c746d6771bdb8a972
BLAKE2b-256 checksum
How to use checksums
da94b9cc2881cbf4898bed16cbffb5ac5afa5deca1eb4c1475cd818fc5eaa217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / lf_crlf-0.0.3-py3-none-any.whl

Download URL lf_crlf-0.0.3-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b86aa5df4bfccce4cec98c4b304bf5d666e019ca10b63474f3eefbdda6a868f0
BLAKE2b-256 checksum
How to use checksums
033d1af7fbe539bfec312e328f840a064930c887a68c6546a27f88de614c9a02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for lf-crlf 0.0.3

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