eol


Nameeol JSON
Version 0.7.5 PyPI version JSON
download
home_pagehttp://github.com/trentm/eol
Summarya command-line script and Python module for working with text file end-of-line (EOL) characters
upload_time2010-10-24 07:12:02
maintainerNone
docs_urlNone
authorTrent Mick
requires_pythonNone
licenseMIT
keywords eol cli cr crlf lf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            `eol` is both a command-line script `eol` and a Python module `eol` for working
with end-of-line chars in text files.

This project lives here: <http://github.com/trentm/eol>

## Installation

To install in your Python's global site-packages use one of the
following:

    pip install eol
    pypm install eol   # if you use ActivePython (http://www.activestate.com/activepython)

But you use a
[virtualenv](http://www.arthurkoziel.com/2008/10/22/working-virtualenv/),
right? If so, then use one of the following:

    pip -E path/to/env install eol
    pypm -E path/to/env install eol


## Command-line examples

**List the EOL-style** of given paths:

    $ eol *.txt
    foo_cr.txt: Mac Classic (CR)
    foo_crlf.txt: Windows (CRLF)
    foo_empty.txt: No EOLs
    foo_lf.txt: Unix (LF)
    foo_mixed.txt: Mixed, predominantly Unix (LF)

Recursively:
    
    $ eol -r ~/src/redis
    /Users/trentm/src/redis/.gitignore: Unix (LF)
    /Users/trentm/src/redis/BETATESTING.txt: Unix (LF)
    /Users/trentm/src/redis/BUGS: Unix (LF)
    /Users/trentm/src/redis/COPYING: Unix (LF)
    ...
    /Users/trentm/src/redis/zmalloc.h: Unix (LF)
    /Users/trentm/src/redis/.git/HEAD: Unix (LF)
    /Users/trentm/src/redis/.git/config: Unix (LF)
    ...
    /Users/trentm/src/redis/client-libraries/README: Unix (LF)
    /Users/trentm/src/redis/design-documents/REDIS-CLUSTER: Unix (LF)
    /Users/trentm/src/redis/doc/AppendOnlyFileHowto.html: Unix (LF)
    /Users/trentm/src/redis/doc/AuthCommand.html: Unix (LF)
    ...

**Find files** with the given EOL-style:

    $ eol -f dos -x .svn -r ~/src/python
    /Users/trentm/src/python/Doc/make.bat
    /Users/trentm/src/python/Lib/email/test/data/msg_26.txt
    /Users/trentm/src/python/Lib/encodings/cp720.py
    /Users/trentm/src/python/Lib/test/decimaltestdata/and.decTest
    ...
    /Users/trentm/src/python/PC/VS8.0/x64.vsprops
    /Users/trentm/src/python/PCbuild/pcbuild.sln
    ...

**Convert files** to a given EOL-style:

    $ eol ~/src/python/Tools/msi/merge.py
    /Users/trentm/src/python/Tools/msi/merge.py: Windows (CRLF)
    $ eol -c cr ~/src/python/Tools/msi/merge.py
    
    # But who really wants CR (aka Mac Classic, '\r') EOLs.
    # "native" is an alias for the EOL-style native to the current platform
    $ eol -c native ~/src/python/Tools/msi/merge.py
    converted `/Users/trentm/src/python/Tools/msi/merge.py' to LF EOLs
    $ eol ~/src/python/Tools/msi/merge.py
    /Users/trentm/src/python/Tools/msi/merge.py: Unix (LF)


## Module examples

**List the EOL-style** of given paths:

    >>> import eol, glob
    >>> for path in glob.glob("*.txt")
    >>> for path in glob.glob("*.txt"):
    ...   print path, eol.eol_info_from_path(path)
    ... 
    foo_cr.txt ('\r', '\r')         # (<detected-eols>, <suggested-eols>)
    foo_crlf.txt ('\r\n', '\r\n')
    foo_empty.txt (None, '\n')      # suggests the native EOL for empty content
    foo_lf.txt ('\n', '\n')
    foo_mixed.txt (<class 'eol.MIXED'>, '\n')

Recursively:
    
    >>> for i in eol.eol_info_from_path_patterns(["/Users/trentm/src/redis"], recursive=True): print i
    ... 
    ('/Users/trentm/src/redis/.gitignore', '\n', '\n')
    ('/Users/trentm/src/redis/BETATESTING.txt', '\n', '\n')
    ('/Users/trentm/src/redis/BUGS', '\n', '\n')
    ('/Users/trentm/src/redis/COPYING', '\n', '\n')
    ...

**Convert files** to a given EOL-style:

    >>> path = "/Users/trentm/src/python/Tools/msi/merge.py"
    >>> eol.eol_info_from_path(path)
    ('\r\n', '\r\n')
    >>> eol.convert_path_eol(path, "\n")
    >>> eol.eol_info_from_path(path)
    ('\n', '\n')
            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/trentm/eol",
    "name": "eol",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "eol cli cr crlf lf",
    "author": "Trent Mick",
    "author_email": "trentm@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/25/f5/b0019907b9f0e7885191de507a18cbe018c58006a2f4576ca11604b14338/eol-0.7.5.zip",
    "platform": "UNKNOWN",
    "description": "`eol` is both a command-line script `eol` and a Python module `eol` for working\nwith end-of-line chars in text files.\n\nThis project lives here: <http://github.com/trentm/eol>\n\n## Installation\n\nTo install in your Python's global site-packages use one of the\nfollowing:\n\n    pip install eol\n    pypm install eol   # if you use ActivePython (http://www.activestate.com/activepython)\n\nBut you use a\n[virtualenv](http://www.arthurkoziel.com/2008/10/22/working-virtualenv/),\nright? If so, then use one of the following:\n\n    pip -E path/to/env install eol\n    pypm -E path/to/env install eol\n\n\n## Command-line examples\n\n**List the EOL-style** of given paths:\n\n    $ eol *.txt\n    foo_cr.txt: Mac Classic (CR)\n    foo_crlf.txt: Windows (CRLF)\n    foo_empty.txt: No EOLs\n    foo_lf.txt: Unix (LF)\n    foo_mixed.txt: Mixed, predominantly Unix (LF)\n\nRecursively:\n    \n    $ eol -r ~/src/redis\n    /Users/trentm/src/redis/.gitignore: Unix (LF)\n    /Users/trentm/src/redis/BETATESTING.txt: Unix (LF)\n    /Users/trentm/src/redis/BUGS: Unix (LF)\n    /Users/trentm/src/redis/COPYING: Unix (LF)\n    ...\n    /Users/trentm/src/redis/zmalloc.h: Unix (LF)\n    /Users/trentm/src/redis/.git/HEAD: Unix (LF)\n    /Users/trentm/src/redis/.git/config: Unix (LF)\n    ...\n    /Users/trentm/src/redis/client-libraries/README: Unix (LF)\n    /Users/trentm/src/redis/design-documents/REDIS-CLUSTER: Unix (LF)\n    /Users/trentm/src/redis/doc/AppendOnlyFileHowto.html: Unix (LF)\n    /Users/trentm/src/redis/doc/AuthCommand.html: Unix (LF)\n    ...\n\n**Find files** with the given EOL-style:\n\n    $ eol -f dos -x .svn -r ~/src/python\n    /Users/trentm/src/python/Doc/make.bat\n    /Users/trentm/src/python/Lib/email/test/data/msg_26.txt\n    /Users/trentm/src/python/Lib/encodings/cp720.py\n    /Users/trentm/src/python/Lib/test/decimaltestdata/and.decTest\n    ...\n    /Users/trentm/src/python/PC/VS8.0/x64.vsprops\n    /Users/trentm/src/python/PCbuild/pcbuild.sln\n    ...\n\n**Convert files** to a given EOL-style:\n\n    $ eol ~/src/python/Tools/msi/merge.py\n    /Users/trentm/src/python/Tools/msi/merge.py: Windows (CRLF)\n    $ eol -c cr ~/src/python/Tools/msi/merge.py\n    \n    # But who really wants CR (aka Mac Classic, '\\r') EOLs.\n    # \"native\" is an alias for the EOL-style native to the current platform\n    $ eol -c native ~/src/python/Tools/msi/merge.py\n    converted `/Users/trentm/src/python/Tools/msi/merge.py' to LF EOLs\n    $ eol ~/src/python/Tools/msi/merge.py\n    /Users/trentm/src/python/Tools/msi/merge.py: Unix (LF)\n\n\n## Module examples\n\n**List the EOL-style** of given paths:\n\n    >>> import eol, glob\n    >>> for path in glob.glob(\"*.txt\")\n    >>> for path in glob.glob(\"*.txt\"):\n    ...   print path, eol.eol_info_from_path(path)\n    ... \n    foo_cr.txt ('\\r', '\\r')         # (<detected-eols>, <suggested-eols>)\n    foo_crlf.txt ('\\r\\n', '\\r\\n')\n    foo_empty.txt (None, '\\n')      # suggests the native EOL for empty content\n    foo_lf.txt ('\\n', '\\n')\n    foo_mixed.txt (<class 'eol.MIXED'>, '\\n')\n\nRecursively:\n    \n    >>> for i in eol.eol_info_from_path_patterns([\"/Users/trentm/src/redis\"], recursive=True): print i\n    ... \n    ('/Users/trentm/src/redis/.gitignore', '\\n', '\\n')\n    ('/Users/trentm/src/redis/BETATESTING.txt', '\\n', '\\n')\n    ('/Users/trentm/src/redis/BUGS', '\\n', '\\n')\n    ('/Users/trentm/src/redis/COPYING', '\\n', '\\n')\n    ...\n\n**Convert files** to a given EOL-style:\n\n    >>> path = \"/Users/trentm/src/python/Tools/msi/merge.py\"\n    >>> eol.eol_info_from_path(path)\n    ('\\r\\n', '\\r\\n')\n    >>> eol.convert_path_eol(path, \"\\n\")\n    >>> eol.eol_info_from_path(path)\n    ('\\n', '\\n')",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "a command-line script and Python module for working with text file end-of-line (EOL) characters",
    "version": "0.7.5",
    "split_keywords": [
        "eol",
        "cli",
        "cr",
        "crlf",
        "lf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25f5b0019907b9f0e7885191de507a18cbe018c58006a2f4576ca11604b14338",
                "md5": "6becb0e915b475552e1be477f2a49fae",
                "sha256": "1a30348a5cddbf0fc16309c9f284b761a624eda33357b42c81256325185ce3bd"
            },
            "downloads": -1,
            "filename": "eol-0.7.5.zip",
            "has_sig": false,
            "md5_digest": "6becb0e915b475552e1be477f2a49fae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25271,
            "upload_time": "2010-10-24T07:12:02",
            "upload_time_iso_8601": "2010-10-24T07:12:02.006394Z",
            "url": "https://files.pythonhosted.org/packages/25/f5/b0019907b9f0e7885191de507a18cbe018c58006a2f4576ca11604b14338/eol-0.7.5.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2010-10-24 07:12:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "trentm",
    "github_project": "eol",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "eol"
}
        
Elapsed time: 0.03452s