Skip to main content

A tool to convert line endings between LF and CRLF

Project description

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 lfcrlf

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.

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

lf_crlf-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

lf_crlf-0.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file lf_crlf-0.0.1.tar.gz.

File metadata

  • Download URL: lf_crlf-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for lf_crlf-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c1a91e77d9605b91be3e94a372d48644f2315418469181576643031363edac3e
MD5 7c201a089f501e9fb2e27e1bd9b8d977
BLAKE2b-256 4bbe34d904361ccae5986e4a856af8d5a897fbdffd94dac14fc32ab9aa62b431

See more details on using hashes here.

File details

Details for the file lf_crlf-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lf_crlf-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for lf_crlf-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b29b8c5a621e86830fe71b54d4b8a227ea94934fb5dbb84a0fe2ff9cb1d333e
MD5 dfccdf561625e1f5086f4e7c98fe695e
BLAKE2b-256 3648b7464fde097fa9bb8d0d155d1b6bbd564d8f2c1501b5cb6ff5aafc864bb7

See more details on using hashes here.

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