Skip to main content

Convert DOS (CRLF) files to Unix (LF) files and vice vera, written in Python.

Project description

pydos2unix

Convert DOS (CRLF) files to Unix (LF) files and vice vera, written in Python.

Example Usage

from pydos2unix import dos2unix, unix2dos

# Convert example.txt from CRLF to LF
with open("example1.txt", "rb") as src:
    buffer = dos2unix(src)
with open("example1.txt", "wb") as dest:
    dest.write(buffer)

# Convert a LF byte array to CRLF
with open("example2.txt", "wb") as dest:
    buffer = unix2dos(b"Line 1\nLine 2\nLine 3\n")
    dest.write(buffer)

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

pydos2unix-0.0.1.tar.gz (233.6 kB view details)

Uploaded Source

Built Distribution

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

pydos2unix-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydos2unix-0.0.1.tar.gz
  • Upload date:
  • Size: 233.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pydos2unix-0.0.1.tar.gz
Algorithm Hash digest
SHA256 282b14436d17a5fb27bea6298aa43a99829c09885253a19fcf9dab38ded36e28
MD5 398ff143e083e94b20f0c090a234959c
BLAKE2b-256 6d03cb648806102529e9d0f8f01f42f90054a2f701c8f6f205038b786fe61adc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydos2unix-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pydos2unix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3006f7387128c7232574bf7d02e4233011010c8238f07dc3de0a727d3364de4d
MD5 4e5210e25da8c08024212803ec71702d
BLAKE2b-256 3c6f8c9e909754371b5baa15eba90de2771be84b7c1e3cb1e94bff8652e85b56

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