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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lf_crlf-0.0.3.tar.gz.
File metadata
- Download URL: lf_crlf-0.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aec1e5bbd78dcc8e2ba99f8c7bb9146e7e91c5c2f9210e8c746d6771bdb8a972
|
|
| MD5 |
a6d809f242e93efa0ac4955e063f0c52
|
|
| BLAKE2b-256 |
da94b9cc2881cbf4898bed16cbffb5ac5afa5deca1eb4c1475cd818fc5eaa217
|
File details
Details for the file lf_crlf-0.0.3-py3-none-any.whl.
File metadata
- Download URL: lf_crlf-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b86aa5df4bfccce4cec98c4b304bf5d666e019ca10b63474f3eefbdda6a868f0
|
|
| MD5 |
32d1a9ad5815d117e2a88d6d6c3ce577
|
|
| BLAKE2b-256 |
033d1af7fbe539bfec312e328f840a064930c887a68c6546a27f88de614c9a02
|