{ "info": { "author": "Sylvain Raybaud", "author_email": "sylvain.raybaud@crans.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Convenience\nTools for everyday use.\n\nSource and install files are available under BSD License here: [https://gitlab.com/sylvainraybaud/convenience](https://gitlab.com/sylvainraybaud/convenience)\n\nThis package *HAS NOT* been tested with Python 2.\n\n## API\n\n* ``xopen``: a wrapper around ``open`` and ``gzip.open`` returning an ``XFile`` object, which is a wrapper around ``File`` and ``gzip.GzipFile``. ``XFile`` implements methods ``open``, ``close``, ``read``, ``readline``, ``readlines``, ``write`` with the same parameters as ``File`` methods. It also implements ``__iter__`` and ``__next__`` to make it iterable and ``__enter__`` and ``__exit__`` to make it usable in ``with`` statements. Files whose names end with *.gz* are treated as gzip files, all other files are treated as uncompressed files.\n\n* ``Logger``: a wrapper around ``logging`` module. A ``Logger`` object is intialized with a ``verbosity`` parameter which is translated into a ``logging`` value (``WARNING``, ``INFO`` or ``DEBUG``). It implements ```debug```, ```info```, ```warning``` and ``error`` methods. They all take a string as first argument argument. ``error`` takes an extra argument, ``code``. When called, ``error`` print its first parameter then calls ``exit(code)``.\n\n* ```header, blue, green, yellow, orange, red, bold, underline```: apply decoration to string (see ```example.py```)\n\n## Using\n\nA good example being worth a thousand words, please see [example.py](https://gitlab.com/sylvainraybaud/convenience/blob/master/example.py)\n\n## Installing\n\n````bash\npip install convenience\n````\n\n## TODO\n\n* Use magic number instead of file extension to detected gzipped files, when applicable.\n* Handle more compression format.\n* Double check handling of various text encodings.\n* Python 2 compatibility.\n* Add more magic.\n\n## Contributing\n\nPlease make a pull request on gitlab. You can mail me at \n\n````first_name [dot] family_name [at] crans [dot] org````\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/sylvainraybaud/convenience", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "convenience", "package_url": "https://pypi.org/project/convenience/", "platform": "", "project_url": "https://pypi.org/project/convenience/", "project_urls": { "Homepage": "https://gitlab.com/sylvainraybaud/convenience" }, "release_url": "https://pypi.org/project/convenience/0.2/", "requires_dist": null, "requires_python": "", "summary": "Convenience tool: wrapper around regular/gzip files, Logger, text colors", "version": "0.2" }, "last_serial": 3974485, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "668f3710f5a16136ba8ede9a25de462f", "sha256": "1ea89dd6d3034ca594a09f6a25da51c7fcc5d3d0c6756b5ff5be963eba281c45" }, "downloads": -1, "filename": "convenience-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "668f3710f5a16136ba8ede9a25de462f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4422, "upload_time": "2018-06-18T17:35:23", "url": "https://files.pythonhosted.org/packages/2a/9f/6bc4fc10ea93d4b4f36793bd3e925453361d7423b26866213ddeb0b77bf7/convenience-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e7adfdcdd7d7374293900b1fefb1d6c", "sha256": "7448f0ef2ccc8d19f5433389aca948bcb4f945c28ba666cb3da51bbac4715d6a" }, "downloads": -1, "filename": "convenience-0.2.tar.gz", "has_sig": false, "md5_digest": "4e7adfdcdd7d7374293900b1fefb1d6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3847, "upload_time": "2018-06-18T17:35:25", "url": "https://files.pythonhosted.org/packages/59/72/2c21786fb34ea2cd9143687c965480527bc13f56ce22c597695480ee5a4d/convenience-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "668f3710f5a16136ba8ede9a25de462f", "sha256": "1ea89dd6d3034ca594a09f6a25da51c7fcc5d3d0c6756b5ff5be963eba281c45" }, "downloads": -1, "filename": "convenience-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "668f3710f5a16136ba8ede9a25de462f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4422, "upload_time": "2018-06-18T17:35:23", "url": "https://files.pythonhosted.org/packages/2a/9f/6bc4fc10ea93d4b4f36793bd3e925453361d7423b26866213ddeb0b77bf7/convenience-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e7adfdcdd7d7374293900b1fefb1d6c", "sha256": "7448f0ef2ccc8d19f5433389aca948bcb4f945c28ba666cb3da51bbac4715d6a" }, "downloads": -1, "filename": "convenience-0.2.tar.gz", "has_sig": false, "md5_digest": "4e7adfdcdd7d7374293900b1fefb1d6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3847, "upload_time": "2018-06-18T17:35:25", "url": "https://files.pythonhosted.org/packages/59/72/2c21786fb34ea2cd9143687c965480527bc13f56ce22c597695480ee5a4d/convenience-0.2.tar.gz" } ] }