{ "info": { "author": "zb3", "author_email": "sgv@o2.pl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development" ], "description": "zgitignore\n==========\nzgitignore is a small library to check if a file has been excluded by a ``.zgitignore`` file (those are compatible with ``.gitignore`` / ``.dockerignore`` files).\n\n\nInstallation\n------------\n\nAs simple as it can be via pip::\n\n $ pip install zgitignore\n\nOr direct installation from source::\n\n $ git clone git://github.com/zb3/zgitignore.git\n $ cd zgitignore\n $ python setup.py install\n\n\nUsage\n-----\n\n.. code:: python\n\n import zgitignore\n\n #ZgitIgnore class stores the patterns, optionally takes two parameters: ignore_case and docker\n #by default, it is case sensitive to match .gitignore behaviour\n #for .dockerignore compatibility, use docker=True\n f = zgitignore.ZgitIgnore(['build/', 'dist/', '*egg-info'])\n\n #Patterns ending with / will match folders only:\n print('build file ignored?: ', f.is_ignored('build')) #False\n\n #When matching directories, set second parameter to True:\n print('build folder ignored?: ', f.is_ignored('build', True)) #True\n\n #It is case sensitive by default:\n print('BUILD folder ignored?: ', f.is_ignored('BUILD', True)) #False\n\n #Want it to be case-insensitive? No problem\n f = zgitignore.ZgitIgnore(['*pycache*', '*pyc'], True) #second parameter is ignore_case\n \n print('PYCACHE file ignored?', f.is_ignored('PYCACHE')) #True\n\n #You can also add patterns later\n ignorefile = zgitignore.ZgitIgnore(ignore_case=True, docker=True) #this is compatible with .dockerignore files\n \n try:\n with open('.gitignore', 'r') as f:\n ignorefile.add_patterns(f.read().splitlines())\n except:\n pass\n\n #You can start paths with ./ or not.\n #Paths are normalized to match Unix style paths\n print('./a/b/c/d/e ignored?', ignorefile.is_ignored('./a/b/c/d/e'))\n\n #But by default, parent directories aren't checked recursively\n #To check them, use check_parents=True\n f = zgitignore.ZgitIgnore(['build/'])\n \n print('build/test ignored?', f.is_ignored('build/test')) #False\n print('build/test ignored when check_parents=True?', f.is_ignored('build/test', check_parents=True)) #True\n\nFormat\n------\nzgitignore supports format similar to ``.gitignore`` file format. Differences are:\n\n\n- ``**`` works everywhere\n ::\n\n ``aaa**ooo``\n\n Will match ``aaapotato2000/beeeee/llllll/sdsdooo``\n- It can embed custom regex via ``{}``. You can use ``\\}`` to pass ``}`` to regex and ``\\\\`` to pass ``\\`` to regex\n ::\n\n aaa{12(34|56|78)oo(aa|bb|dd)ii}888\n\n Will match ``aaa1256oobbii888``\n ::\n\n aaa{#[0-9a-f]{3,6\\}}888\n\n Will match ``aaa#00ffff888``\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zb3/zgitignore", "keywords": "gitignore exclude pattern", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zgitignore", "package_url": "https://pypi.org/project/zgitignore/", "platform": "", "project_url": "https://pypi.org/project/zgitignore/", "project_urls": { "Homepage": "https://github.com/zb3/zgitignore" }, "release_url": "https://pypi.org/project/zgitignore/0.8.2/", "requires_dist": null, "requires_python": "", "summary": "Check if a file is ignored by a .zgitignore file, compatible with .gitignore syntax", "version": "0.8.2" }, "last_serial": 4389368, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "68d6158e80b95b4c10c7bdfaaad1a2ac", "sha256": "7bd7425f5efc64d14800efa623a2c3e59c6a6536ba2d895463c0a33b3e2efd0c" }, "downloads": -1, "filename": "zgitignore-0.6.tar.gz", "has_sig": false, "md5_digest": "68d6158e80b95b4c10c7bdfaaad1a2ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5488, "upload_time": "2014-12-27T15:20:19", "url": "https://files.pythonhosted.org/packages/1f/cd/b239efe89f5f7128681a4031e1102a9707820d5bb10123e40619f38c9093/zgitignore-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "afd0374a3a760c60f738054643cd2870", "sha256": "58fa7cf05661214401767f86bfe09a6502e9e5eac68923c6ff1feee6bf5c7810" }, "downloads": -1, "filename": "zgitignore-0.7.tar.gz", "has_sig": false, "md5_digest": "afd0374a3a760c60f738054643cd2870", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5502, "upload_time": "2015-03-27T12:15:12", "url": "https://files.pythonhosted.org/packages/8b/f9/813b3990c7eae6f7978d784fe9cba76f055605d45447e36b249b4751625b/zgitignore-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "3aff5c04834a1c4fe5d7fa2c1a4f71b9", "sha256": "c6f679c8de55099c2a37f58b2bf553cfaef6b080c8410ed86c59bb88961a5b26" }, "downloads": -1, "filename": "zgitignore-0.7.1.tar.gz", "has_sig": false, "md5_digest": "3aff5c04834a1c4fe5d7fa2c1a4f71b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5599, "upload_time": "2015-08-20T09:09:35", "url": "https://files.pythonhosted.org/packages/76/5b/a888d8201812cca5df16b0c8208df6046e7c1efb650c84125b34e8257f7d/zgitignore-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "816c88b1543ca3b5a865a9ff20e48ee2", "sha256": "d35d009b42831a2010423a0dbf7ffaed11935b455511d42ec009486cee312153" }, "downloads": -1, "filename": "zgitignore-0.8.0.tar.gz", "has_sig": false, "md5_digest": "816c88b1543ca3b5a865a9ff20e48ee2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5720, "upload_time": "2017-09-06T14:07:04", "url": "https://files.pythonhosted.org/packages/8d/ab/4dbba4077f232ed0651619c96dbda30bedb72066a074c94b24100d0dc579/zgitignore-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "e6660d269e8fc9b3af4528c7c0cb2b70", "sha256": "046484eb87e97be5afa6c6fd53fc34b840886e867954db4c2284489db75b8ede" }, "downloads": -1, "filename": "zgitignore-0.8.1.tar.gz", "has_sig": false, "md5_digest": "e6660d269e8fc9b3af4528c7c0cb2b70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5728, "upload_time": "2018-09-14T08:30:49", "url": "https://files.pythonhosted.org/packages/16/bb/703a253e7e5c5e8fb6cde531fc42420760d68aa12576cee8e7ae9be34ebe/zgitignore-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "3350cd24548c5d6942873aae1916d05c", "sha256": "2af9b83afa1e8c3f9537812f7070dbe5d56b5c7d0bcda7bbf57d8e00201d6590" }, "downloads": -1, "filename": "zgitignore-0.8.2.tar.gz", "has_sig": false, "md5_digest": "3350cd24548c5d6942873aae1916d05c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5941, "upload_time": "2018-10-18T08:35:10", "url": "https://files.pythonhosted.org/packages/fc/15/85a0520545b0788e76768ae371dd5f9b6c7a71d5165cf31e2ac89b184080/zgitignore-0.8.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3350cd24548c5d6942873aae1916d05c", "sha256": "2af9b83afa1e8c3f9537812f7070dbe5d56b5c7d0bcda7bbf57d8e00201d6590" }, "downloads": -1, "filename": "zgitignore-0.8.2.tar.gz", "has_sig": false, "md5_digest": "3350cd24548c5d6942873aae1916d05c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5941, "upload_time": "2018-10-18T08:35:10", "url": "https://files.pythonhosted.org/packages/fc/15/85a0520545b0788e76768ae371dd5f9b6c7a71d5165cf31e2ac89b184080/zgitignore-0.8.2.tar.gz" } ] }