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.2.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.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lf_crlf-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f61c577b3cc38931c95bd4811ae5c514a9957fc74a005d4241de2b4c961a5466
MD5 d21a0e9b5b428616c8ff3098fe5ad16d
BLAKE2b-256 8286810b64d5bb6d9c3a2086eaf24f34c2c8aee19db5ce96e3ef9848045a3073

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lf_crlf-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c684c25de3c9a54222ec5370ca6c90132947da5bd6fd1a93fa2ec1ccd6610a05
MD5 2e28cb7c2cb6c1e394f5732938d3e6e4
BLAKE2b-256 dd53db4ff8568a21f2893628fa6f1e76f4899b413f976b33f264994042121692

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