{ "info": { "author": "Allen Wild", "author_email": "allenwild93@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "# pydircolors - color filenames for terminal display\nDo you like file/directory listings in your terminal to be colorized? Do you like how GNU coreutils'\n`ls` command does it? Want to incorporate that functionality into a Python application? Then\n`pydircolors` is the library for you!\n\nThis library is currently in Alpha development stage, but I'm getting close to an initial release.\n\n## System Requirements\n`pydircolors` is intended for console use on POSIX-like systems. It's developed on Linux, but should\nwork in any terminal that supports xterm-style 16 color escape sequences and environments with\nPOSIX-compatible `stat()` syscalls. Notably, `cmd.exe` terminals on native Windows are not\nsupported, but Cygwin works.\n\n`pydircolors` requires Python 3.3 or newer. The main limitation is that the `dir_fd` and\n`follow_symlinks` keyword args to [`os.stat()`](https://docs.python.org/3/library/os.html#os.stat)\nare used, which were added in Python 3.3. It'd be possible to add support for older versions\n(including Python 2.7) with compatibility shims. If you ask nicely, I'll a) be overjoyed that\nsomeone's actually using this library, and b) will consider adding that functionality.\n\nDistributions are built using [flit](https://github.com/takluyver/flit) and PEP 517 rather than\nsetuptools (setup.py). Installing from PyPi using pip works as usual, flit is only needed for\nbuilding sdists and wheels from git source.\n\n## Installation\nInstall with pip:\n\n pip install dircolors\n\nInstall from source (should be used in a venv, don't run pip as root):\n\n flit install\n pip install . # requires pip >= 19.0\n\nInstall from source in editable development mode (should be used in a venv):\n\n flit install -s\n\nOn Arch Linux and its derivatives, you can install the\n[python-dircolors](https://aur.archlinux.org/packages/python-dircolors) AUR package.\n\n### Helper Makefile\nThis repo contains a makefile as a convenience that wraps some common development tasks. Possible\nmake targets are:\n * `test` (the default): run unit tests\n * `venv`: set up a new python3 venv in the 'venv' directory and install an up-to-date pip,\n ipython, and everything from requirements-dev.txt (including flit). You should run\n `source ./venv/bin/activate` after `make venv` to enter the venv.\n * `lint`: run pylint\n * `dist`: build distribution sdist and wheel with flit\n * `clean`: remove built dist packages and all \\_\\_pycache\\_\\_ files\n * `distclean`: clean, plus remove the entire venv\n\n## Usage\nStart by creating a `Dircolors` object and calling its `format()` method with the filename you want\nto colorize.\n\n```python\nimport dircolors\ndc = dircolors.Dircolors()\nprint(dc.format('README.md'))\nprint(dc.format('dist/pydircolors.tar.gz')\nprint(dc.format('pydircolors.tar.gz', cwd='dist'))\n```\n\nAs seen above, the `cwd` keyword argument looks for the filename relative to that directory. `cwd`\ncan be a string of the directory name, or an integer directory descriptor returned by `os.open()` on\nthe directory.\n\nSymlinks are intelligently supported too. Set `follow_symlinks=True` to follow links and format the\nlink name like its target file. Set `follow_symlinks=False` (the default) and `show_target=True` to\nprint the link name, colored like a link, an ASCII arrow (`->`), and the link target, formatted\naccordingly.\n\n```\n>>> print(dc.format('a_link', show_target=True))\na_link -> link_target\n```\n\nIf you've already run `os.stat()` on a file, you can re-use the result to avoid extra syscall\noverhead with the `format_mode()` method. `format_mode()` accepts arbitrary text to format (which\nneed not actually be the filename) and the file mode, which can be an `os.stat_result` object (as\nreturned by `os.stat()` or an integer of representing the `st_mode` field.\n\n```python\nstat_result = os.stat('some_file')\nprint(dc.format_mode('some_file', stat_result))\nprint(dc.format_mode('a_link', 0o0120777))\n```\n\n## Dircolors database sources\nBy default, `Dircolors` objects load from the `LS_COLORS` environment variable, just like GNU `ls`.\nA variety of functions to load from custom `LS_COLORS` strings or `.dircolors` files are available\nas well. All load functions will clear the currently loaded database, even if they fail to load any\nuseful data.\n\n```python\ndc.load_from_environ() # load from the LS_COLORS environment variable (the default)\ndc.load_from_environ(env_var_name) # load from a different environment variable\ndc.load_from_lscolors('rs=0:di=01;34:') # load from an LS_COLORS string\ndc.load_defaults() # use the defaults as generated by `dircolors -p`\ndc.load_from_dircolors('.dircolors') # load from a dircolors filename\ndc.load_from_dircolors(open_file_obj) # load from an open file-like object\n```\n\n## Documentation\nFormal documentation is a TODO item. For now, this README provides basic usage and the docstrings in\n[`dircolors.py`](https://github.com/aswild/pydircolors/blob/master/dircolors/dircolors.py) provide\nmore details.\n\n## License\n`pydircolors` is released under the Apache 2.0 license. Copyright 2019 Allen Wild \\\n\nSee the LICENSE.txt file for more information.\n\n## TODO\nItems needed for a v0.1.0 release:\n * Clean up `pyls` and add some argparse support. Also document it here.\n * Add tests for the color formatting functionality rather than just loading data.\n * Upload to PyPi\n\nItems needed for a v1.0.0 release:\n * Sphinx documentation\n * Enhanced `pyls` functionality\n * Commit to a stable API\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aswild/pydircolors", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "dircolors", "package_url": "https://pypi.org/project/dircolors/", "platform": "", "project_url": "https://pypi.org/project/dircolors/", "project_urls": { "Homepage": "https://github.com/aswild/pydircolors" }, "release_url": "https://pypi.org/project/dircolors/0.0.4/", "requires_dist": null, "requires_python": ">=3.3", "summary": "Python library to colorize filenames in a terminal based on their type ", "version": "0.0.4" }, "last_serial": 5768127, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5502c3d9de98c16e3b3d3212d65ba33b", "sha256": "8562f5de73853c11359e5f7c81c6b976455edb60fba4cbaca6a82c52caf5c5b6" }, "downloads": -1, "filename": "dircolors-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5502c3d9de98c16e3b3d3212d65ba33b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 15046, "upload_time": "2019-08-24T18:57:23", "url": "https://files.pythonhosted.org/packages/e1/39/14f6ddab4ba2fb4f66f069bfe1255c4898e5377dc894f841911c9bdfa24b/dircolors-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06c61dea58d7ad31d7dcfbdb960f22b1", "sha256": "2d14f984ec5a048e475df0d618abce5e63de69cdc2dbe3273aa3f7f55c63fc28" }, "downloads": -1, "filename": "dircolors-0.0.1.tar.gz", "has_sig": false, "md5_digest": "06c61dea58d7ad31d7dcfbdb960f22b1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 14204, "upload_time": "2019-08-24T18:57:25", "url": "https://files.pythonhosted.org/packages/f1/aa/025a81872eece093f906c916235143bed1cafc7092c098626c086e3b95d0/dircolors-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "bfdf84ca94d1aab2fdcc3bec130efdef", "sha256": "566e63073aca38be1a41756fe67b137c62896cf31d3494dc30f895e452bfd4c9" }, "downloads": -1, "filename": "dircolors-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "bfdf84ca94d1aab2fdcc3bec130efdef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 16463, "upload_time": "2019-08-24T19:34:14", "url": "https://files.pythonhosted.org/packages/8b/b7/ce21d91daf9ba993c220215218c916a4fb3a0b4c16cbc424f4c53cc65cc2/dircolors-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4d7e413a41db5be1a72fdafc3dd20bab", "sha256": "fe277273ac25bb662c9d91bfc3382aa2be97a9ead38fa4e8024f68743c189685" }, "downloads": -1, "filename": "dircolors-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4d7e413a41db5be1a72fdafc3dd20bab", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 16055, "upload_time": "2019-08-24T19:34:15", "url": "https://files.pythonhosted.org/packages/b5/d3/85ed541b740b3a10e361ae85b16b476e40b6e0ff326d17d59895a33e1dce/dircolors-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a944873c2f802eb5f8b3d0d762e9f896", "sha256": "42eaaecfd964dfffa07c0926e96389bb9f7bccc83f5e421a28d0c234fbd318ef" }, "downloads": -1, "filename": "dircolors-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a944873c2f802eb5f8b3d0d762e9f896", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 37491, "upload_time": "2019-09-01T20:01:51", "url": "https://files.pythonhosted.org/packages/72/34/218f2c4f83e308bb031b898942232a7cf0b6da2e35ff3dfa9e6934410ff7/dircolors-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4356d8854d85027296c6aee9c56a8015", "sha256": "5eafb59bac41c9853c8fdf6741465421718d0eb84c1c79845cfe93cef6b1acc5" }, "downloads": -1, "filename": "dircolors-0.0.3.tar.gz", "has_sig": false, "md5_digest": "4356d8854d85027296c6aee9c56a8015", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 20433, "upload_time": "2019-09-01T20:01:57", "url": "https://files.pythonhosted.org/packages/4f/5f/99ffb3542d80adaf06491b0d987ca55e6e7dac5530f5e373f8d97f7d9eb1/dircolors-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "b21be09b40dca3ceb61831b01697c420", "sha256": "37884cefea7bf52ebbbb97743af9f970df08f4e15fb51bac24eb937f9a8d6a73" }, "downloads": -1, "filename": "dircolors-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b21be09b40dca3ceb61831b01697c420", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 37931, "upload_time": "2019-09-01T21:24:55", "url": "https://files.pythonhosted.org/packages/ed/98/047a6bb58f31bddf74f03e22fd59975fd1821ba29800ba768f85427970e3/dircolors-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2c4355d4f6704aa163495cd09a158d9", "sha256": "b705c101d9066aa64000392c8ea0af843f7f8a9a94e08b96868ee775a9c70a33" }, "downloads": -1, "filename": "dircolors-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d2c4355d4f6704aa163495cd09a158d9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 21579, "upload_time": "2019-09-01T21:24:58", "url": "https://files.pythonhosted.org/packages/7d/a5/7e53c058422098b3b4df83bc0d5fe9039981d543db4c3084ba059288dcde/dircolors-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b21be09b40dca3ceb61831b01697c420", "sha256": "37884cefea7bf52ebbbb97743af9f970df08f4e15fb51bac24eb937f9a8d6a73" }, "downloads": -1, "filename": "dircolors-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b21be09b40dca3ceb61831b01697c420", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 37931, "upload_time": "2019-09-01T21:24:55", "url": "https://files.pythonhosted.org/packages/ed/98/047a6bb58f31bddf74f03e22fd59975fd1821ba29800ba768f85427970e3/dircolors-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2c4355d4f6704aa163495cd09a158d9", "sha256": "b705c101d9066aa64000392c8ea0af843f7f8a9a94e08b96868ee775a9c70a33" }, "downloads": -1, "filename": "dircolors-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d2c4355d4f6704aa163495cd09a158d9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 21579, "upload_time": "2019-09-01T21:24:58", "url": "https://files.pythonhosted.org/packages/7d/a5/7e53c058422098b3b4df83bc0d5fe9039981d543db4c3084ba059288dcde/dircolors-0.0.4.tar.gz" } ] }