{ "info": { "author": "Daniel Kovacs <@neonihil>", "author_email": "mondomhogynincsen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": ".. image:: https://qtils.readthedocs.io/en/latest/_images/qtils-logo.png\n\n------\n\n.. image:: https://img.shields.io/github/v/tag/ultralightweight/qtils \n :target: http://github.com/ultralightweight/qtils\n :alt: GitHub tag (latest SemVer)\n\n.. image:: https://travis-ci.org/ultralightweight/qtils.svg?branch=master\n :target: https://travis-ci.org/ultralightweight/qtils\n :alt: Travis CI build status\n\n.. image:: https://coveralls.io/repos/github/ultralightweight/qtils/badge.svg?branch=master\n :target: https://coveralls.io/github/ultralightweight/qtils?branch=master\n :alt: Code Coverage\n\n.. image:: https://readthedocs.org/projects/qtils/badge/?version=latest \n :target: https://qtils.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/qtils\n :target: https://pypi.org/project/qtils/\n :alt: PyPI\n\n.. image:: https://img.shields.io/github/issues-raw/ultralightweight/qtils\n :target: https://github.com/ultralightweight/qtils/issues\n :alt: GitHub issues\n\n=========\nOverview\n=========\n\nQtils - pronounced as cutieels - is a syntactic sugar library to make sweet Python coding even sweeter.\n\n\nDedication\n------------\n\nThis library is dedicated to **P\u00e1l Hubai, Surfy**, my programming Master who spent countless hours answering\nmy questions, providing code examples, and guiding me towards the right approach when I was learning programming\nas a child.\n\n\nFeatures\n------------\n\n- Convenient collections `qdict `_, `qlist `_ and `QEnum `_\n\n- Self-formatting object in `PrettyObject `_\n\n- Two-way formatter/parser for file sizes, for example '5.4 GB', in `DataSize `_\n\n- Weak reference property decorator `weakproperty `_\n\n- Cached property decorator `cachedproperty `_\n\n- Class logger decorator `logged `_\n\n- Common string transformations in `qtils.string_utils `_\n\n\nResources\n------------\n\n- Sources are available on `GitHub `_\n \n- Installer is available on `PyPI `_\n\n- Usage guide and more examples are available in the `tutorials `_\n\n- Documentation is `available online on ReadTheDocs `_\n\n- Migrating from ``sutils``? See the `sutils migration guide here `__.\n\n- Contributions are always welcome. Please see the `Developer's guide `__ on getting started.\n\n\n\n================\nGetting Started\n================\n\n\nInstallation \n--------------\n\n\nInstalling the latest release from PyPI using ``pip``:\n\n.. code-block:: bash\n\n $ pip install qtils\n\n\n**Installing the latest release from PyPI and saving it to** ``requirements.txt`` **using** ``pip``:\n\n.. code-block:: bash\n\n $ pip install -s requirements.txt qtils\n\n\n\nInstalling the latest pre-release from GitHub:\n\n.. code-block:: bash\n\n $ pip install -e https://github.com/ultralightweight/qtils.git#master\n\n\n\nExamples\n-----------\n\n\nAttribute dictionary\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n >>> from qtils import *\n\n >>> d = qdict(hello = \"world\")\n >>> d.hello\n 'world'\n >>> d.answer = 42\n >>> d['answer']\n 42\n\n\nSee more examples in the `qdict tutorial `_, see the API reference `here `__.\n\n\nObjects with self-formatting capability\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n >>> class MyObject(PrettyObject):\n ... __pretty_fields__ = [\n ... 'hello',\n ... 'answer',\n ... ]\n ... def __init__(self, hello, answer):\n ... self.hello = hello\n ... self.answer = answer\n >>> obj = MyObject('world', 42)\n >>> print(obj)\n <__main__.MyObject object at ... hello='world', answer=42>\n\n\nSee more examples in the `PrettyObject tutorial `_, see the API reference `here `__\n\nCached property\n~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python \n\n >>> class DeepThought(object):\n ... @cachedproperty\n ... def answer_to_life_the_universe_and_everything(self):\n ... print('Deep Thought is thinking')\n ... # Deep Thought: Spends a period of 7.5 million years\n ... # calculating the answer\n ... return 42\n ...\n >>> deep_thougth = DeepThought()\n >>> deep_thougth.answer_to_life_the_universe_and_everything # first call, getter is called\n Deep Thought is thinking\n 42\n >>> deep_thougth.answer_to_life_the_universe_and_everything # second call, getter is not called\n 42\n >>> del deep_thougth.answer_to_life_the_universe_and_everything # removing cached value\n >>> deep_thougth.answer_to_life_the_universe_and_everything # getter is called again\n Deep Thought is thinking\n 42\n\nSee more examples in the `cachedproperty tutorial `_, see the API reference `here `__.\n\n\n\nWeak reference property\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python \n\n >>> from qtils import weakproperty\n\n >>> class Foo(object):\n ... @weakproperty\n ... def bar(self, value): pass\n >>>\n\n # The code above is the functional equivalent of writing:\n\n >>> import weakref\n >>> class Foo(object):\n ... @property\n ... def bar(self, value): \n ... return self._bar() if self._bar is not None else None\n ... @bar.setter\n ... def bar(self, value): \n ... if value is not None:\n ... value = weakref.ref(value)\n ... self._bar = value\n >>>\n\n\nSee more examples in the `weakproperty tutorial `_, see the API reference `here `__.\n\n\nFormatting and parsing file sizes\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n >>> print(DataSize(123000))\n 123 k\n >>> DataSize('1.45 megabytes')\n 1450000\n >>> DataSize('1T').format(unit=\"k\", number_format=\"{:,.0f} {}\")\n '1,000,000,000 k'\n\n\nSee more examples in the `formatting module tutorial `_, see the API reference `here `__.\n\n\nDynamic module exports\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n >>> from qtils import qlist\n\n >>> __all__ = qlist()\n\n >>> @__all__.register\n ... class Foo(object):\n ... pass\n\n\nSee more examples in the `qlist tutorial `_, see the API reference `here `__.\n\n\n\nAdding a class-private logger\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n >>> @logged\n ... class LoggedFoo():\n ... def __init__(self):\n ... self.__logger.info(\"Hello World from Foo!\")\n ...\n\n\nSee more examples in the `logging module tutorial `_, see the API reference `here `__.\n\n\n=============\nContributing\n=============\n\nPull requests are always welcome! Please see the `Developer's Guide `__ on getting started with qtils development. \n\n\n========\nLicence\n========\n\nThis library is available under `GNU Lesser General Public Licence v3 `_.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ultralightweight/qtils", "keywords": "", "license": "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "maintainer": "Daniel Kovacs", "maintainer_email": "mondomhogynincsen@gmail.com", "name": "qtils", "package_url": "https://pypi.org/project/qtils/", "platform": "", "project_url": "https://pypi.org/project/qtils/", "project_urls": { "Homepage": "https://github.com/ultralightweight/qtils" }, "release_url": "https://pypi.org/project/qtils/0.10.2/", "requires_dist": null, "requires_python": "", "summary": "Qtils - pronounces as `cuteels` - is a syntactic sugar library to make sweet Python coding even sweeter.", "version": "0.10.2" }, "last_serial": 5998571, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "76efe2efe4cd33c8257e01af0fb7313b", "sha256": "3d09490418abdd37d4f2727160c6782f4461bd5b62fa7cf4cdc59181c3384a69" }, "downloads": -1, "filename": "qtils-0.10.0.tar.gz", "has_sig": false, "md5_digest": "76efe2efe4cd33c8257e01af0fb7313b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31492, "upload_time": "2019-10-19T03:20:58", "url": "https://files.pythonhosted.org/packages/b8/fa/f3d8e7ced78b498a4b671902782c60cab23dbf8cc1fde2925846452e5d17/qtils-0.10.0.tar.gz" } ], "0.10.2": [ { "comment_text": "", "digests": { "md5": "9bd246f45b711c16838e6cc20169be54", "sha256": "659c7ef9da89ef2473c51c25dd939b5f04a5156f13daf128ff3e3ae44f48c7cb" }, "downloads": -1, "filename": "qtils-0.10.2.tar.gz", "has_sig": false, "md5_digest": "9bd246f45b711c16838e6cc20169be54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32598, "upload_time": "2019-10-19T03:38:12", "url": "https://files.pythonhosted.org/packages/06/d9/0099d8054fe7573840f7758c252e837f9c8e340b96f1ed7ac9c08ac30f72/qtils-0.10.2.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "0f39187ee571073d48ec84ae4428fd2c", "sha256": "fe38e16540e13292114b40d3234bf08d815d87bb9c8dae8bcd29318d6807179c" }, "downloads": -1, "filename": "qtils-0.9.0.tar.gz", "has_sig": false, "md5_digest": "0f39187ee571073d48ec84ae4428fd2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21539, "upload_time": "2019-10-07T23:38:51", "url": "https://files.pythonhosted.org/packages/a0/d7/b227afcd57673d31ea936eb0721e28544fe314f172199106b4e3d3e32175/qtils-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "15f44e45781a0657eb24b193a58d84f1", "sha256": "17eaad093a367778eacbe76cb57c45c8d5fb1ce6368911125e807e24c3a62a38" }, "downloads": -1, "filename": "qtils-0.9.1.tar.gz", "has_sig": false, "md5_digest": "15f44e45781a0657eb24b193a58d84f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21539, "upload_time": "2019-10-07T23:44:56", "url": "https://files.pythonhosted.org/packages/c1/53/1f66a6d9149af6b3aec1a7e43506f783b896d44b666f86d753ece06e4d2a/qtils-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "387424ad268a844a6704fab251c63648", "sha256": "eeea2ac825ec955d6f91e1f1893695b3cf54bc372a49df238a1a1a7c5a068a93" }, "downloads": -1, "filename": "qtils-0.9.2.tar.gz", "has_sig": false, "md5_digest": "387424ad268a844a6704fab251c63648", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21913, "upload_time": "2019-10-08T01:30:00", "url": "https://files.pythonhosted.org/packages/21/29/ca76cd573512d2206329f968a5cff66a61d9f7d73fa3c21a478bce146ed7/qtils-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "d35c0bc712616086d37cae0a552ffdc4", "sha256": "07ef9808128afe77e4ce6d41bc0d0a9d091e1304507b2075ac884b1d81ce5424" }, "downloads": -1, "filename": "qtils-0.9.3.tar.gz", "has_sig": false, "md5_digest": "d35c0bc712616086d37cae0a552ffdc4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21907, "upload_time": "2019-10-08T01:30:55", "url": "https://files.pythonhosted.org/packages/51/41/a21a3bf53a353d6b071bcc3087c44c417cfa64f272ace5803e9881255021/qtils-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "a0a4b6238f906112611a3385e096d00d", "sha256": "4fd99862b26692160d09985e5d44c9bdc924e3968fe57a2ed04dc34e126cb957" }, "downloads": -1, "filename": "qtils-0.9.4.tar.gz", "has_sig": false, "md5_digest": "a0a4b6238f906112611a3385e096d00d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22943, "upload_time": "2019-10-08T02:23:39", "url": "https://files.pythonhosted.org/packages/15/4f/70a365feba083b2b763afd14e40da80cd82931a9dbd7cc86694654743985/qtils-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "df49e16a16b6d70a85b2b0ffb0d79c7c", "sha256": "af128951ddcfb52f435af54bcc2992d42caec1e764d569add59b593b618940c5" }, "downloads": -1, "filename": "qtils-0.9.5.tar.gz", "has_sig": false, "md5_digest": "df49e16a16b6d70a85b2b0ffb0d79c7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27535, "upload_time": "2019-10-09T13:11:02", "url": "https://files.pythonhosted.org/packages/73/45/d8cd0dbed1ae6033f6bd4dc86019c58a22325d91a20678f34823ce1d7ccf/qtils-0.9.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bd246f45b711c16838e6cc20169be54", "sha256": "659c7ef9da89ef2473c51c25dd939b5f04a5156f13daf128ff3e3ae44f48c7cb" }, "downloads": -1, "filename": "qtils-0.10.2.tar.gz", "has_sig": false, "md5_digest": "9bd246f45b711c16838e6cc20169be54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32598, "upload_time": "2019-10-19T03:38:12", "url": "https://files.pythonhosted.org/packages/06/d9/0099d8054fe7573840f7758c252e837f9c8e340b96f1ed7ac9c08ac30f72/qtils-0.10.2.tar.gz" } ] }