{ "info": { "author": "Miroslav Shubernetskiy", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "==========\nPy-Context\n==========\n\n.. image:: https://badge.fury.io/py/py-context.png\n :target: http://badge.fury.io/py/py-context\n\n.. image:: https://travis-ci.org/dealertrack/py-context.png?branch=master\n :target: https://travis-ci.org/dealertrack/py-context\n\n.. image:: https://coveralls.io/repos/dealertrack/py-context/badge.png?branch=master\n :target: https://coveralls.io/r/dealertrack/py-context?branch=master\n\nPython dict with stacked context data\n\n* Free software: MIT license\n* GitHub: https://github.com/dealertrack/py-context\n\nInstalling\n----------\n\nYou can install ``py-context`` using pip::\n\n $ pip install py-context\n\nExample\n-------\n\n::\n\n >>> context = Context({'user': 'Fred', 'city': 'Bedrock'})\n >>> context['user']\n 'Fred'\n >>> context['city']\n 'Bedrock'\n >>> context.push({'user': 'Barney'})\n >>> context['user']\n 'Barney'\n >>> context['city']\n 'Bedrock'\n >>> context.pop()\n {'user': 'Barney'}\n >>> context['user']\n 'Fred'\n\nContext also supports signals.\nSignal handler can be attached globally::\n\n >>> @context_key_changed.connect\n ... def handler(sender, context, key, new, old):\n ... print(key, new, old)\n\n >>> context = Context()\n >>> context['hello'] = 'world'\n hello world \n\nOr to individual context instances::\n\n >>> def handler(sender, context, key, new, old):\n ... print(key, new, old)\n >>> context = Context()\n >>> context_key_changed.connect(handler, sender=context)\n\nSupported signals::\n\n >>> @context_initialized.connect\n ... def handler(sender, context):\n ... pass\n\n >>> @pre_context_changed.connect\n ... def handler(sender, context):\n ... pass\n\n >>> @post_context_changed.connect\n ... def handler(sender, context):\n ... pass\n\n >>> @context_key_changed.connect\n ... def handler(sender, context, key, new, old):\n ... pass\n\nAdditionally, ``ClassSignallingContext`` can be used to subscribe signals\nby sender classes, not instances::\n\n >>> class TestContext(ClassSignallingContext):\n ... pass\n >>> def context_key_changed_handler(sender, context, key, new, old):\n ... print(key, new, old)\n >>> _ = context_key_changed.connect(context_key_changed_handler, sender=TestContext)\n\n >>> context = Context()\n >>> class_context = TestContext()\n\n >>> context['foo'] = 'bar'\n >>> class_context['foo'] = 'bar'\n foo bar \n\nTesting\n-------\n\nTo run the tests you need to install testing requirements first::\n\n $ make install\n\nThen to run tests, you can use ``nosetests`` or simply use Makefile command::\n\n $ nosetests -sv\n # or\n $ make test\n\n\n\n\nHistory\n-------\n\n0.3.1 (2018-04-11)\n~~~~~~~~~~~~~~~~~~\n\n* Added support for ``*args``, ``**kwargs`` in ``Context.push()``.\n* Added ``__dir__`` support.\n\n0.3.0 (2018-02-16)\n~~~~~~~~~~~~~~~~~~\n\n* Added signals support - ``context_initialized``, ``pre_context_changed``,\n ``post_context_changed`` and ``context_key_changed``. See README for examples.\n\n0.2.1 (2017-07-28)\n~~~~~~~~~~~~~~~~~~\n\n* Excluding tests from being installed\n\n0.2.0 (2017-05-11)\n~~~~~~~~~~~~~~~~~~\n\n* Add attribute support\n* Add make watch target\n\n0.1.0 (2017-03-22)\n~~~~~~~~~~~~~~~~~~\n\n* First release on PyPI.\n\n\nCredits\n-------\n\nOriginally ``Context`` was taken from `Genshi `_ project.\nSee ``LICENSE`` for copyright notices.\n\nDevelopment Lead\n~~~~~~~~~~~~~~~~\n\n* Miroslav Shubernetskiy - https://github.com/miki725\n\nContributors\n~~~~~~~~~~~~\n\n* Serkan Hosca - https://github.com/shosca\n\n\nCopyright (C) 2006-2010 Edgewall Software\n\nCopyright (C) 2017 Dealertrack Technologies, Inc.\n\nAll rights reserved.\n\n::\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n 3. The name of the author may not be used to endorse or promote\n products derived from this software without specific prior\n written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS\n OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dealertrack/py-context", "keywords": "context stack", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py-context", "package_url": "https://pypi.org/project/py-context/", "platform": "", "project_url": "https://pypi.org/project/py-context/", "project_urls": { "Homepage": "https://github.com/dealertrack/py-context" }, "release_url": "https://pypi.org/project/py-context/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Python dict with stacked context data", "version": "0.3.1" }, "last_serial": 3756479, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0795bf829e34b3c4ab7426d105596b15", "sha256": "a82977e578ac2b81ce8005d897370f074820f50a12e83c3eaaf741e74edf9689" }, "downloads": -1, "filename": "py_context-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0795bf829e34b3c4ab7426d105596b15", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 10500, "upload_time": "2017-04-25T14:00:44", "url": "https://files.pythonhosted.org/packages/09/87/aa71dd3c884c7349f516d1dca49740a6a6dfa402cfc554567bb285e22077/py_context-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfa61425ce8e47ab2c8c4ab9dda0dda1", "sha256": "f48e00ecd393d03944f5854c57452938d2485679620fd6c859d7f4615be19b27" }, "downloads": -1, "filename": "py-context-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bfa61425ce8e47ab2c8c4ab9dda0dda1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8057, "upload_time": "2017-04-25T14:00:42", "url": "https://files.pythonhosted.org/packages/f7/7c/38932e1a8015389cb95ac6715136041fe27b15552266c50c211265768cda/py-context-0.1.0.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "4c2f99a884f0a9a5e1bdabfa364ea66b", "sha256": "90741fa0538a36d300cb3958d1dc8842f9c35623f257fbd286ff84c62d964208" }, "downloads": -1, "filename": "py_context-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4c2f99a884f0a9a5e1bdabfa364ea66b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 10718, "upload_time": "2017-05-11T15:07:21", "url": "https://files.pythonhosted.org/packages/9b/9b/d8d8c15b7d9bf8ce8c36e1a92c261f0ec42c2a3e024008b7b4f7677862ad/py_context-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5e5fe2b89971ee63640901b604af5c2e", "sha256": "8bfcea3b1fc0a4d73189e2c28f61a1d30bc6a25499bec76db5d568073222ef9d" }, "downloads": -1, "filename": "py-context-0.2.tar.gz", "has_sig": false, "md5_digest": "5e5fe2b89971ee63640901b604af5c2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8268, "upload_time": "2017-05-11T15:07:20", "url": "https://files.pythonhosted.org/packages/b4/22/22daef8f8adc8c199925ed06fa188962c0378dbd2cdbebdf5882e2de19d6/py-context-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "58389b0ced752f83bd0b2a399d3c16aa", "sha256": "a4494e6a59635c6819b1219bc4f3dbda52fe1717f737f2fdd01680e2aabde1ea" }, "downloads": -1, "filename": "py_context-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "58389b0ced752f83bd0b2a399d3c16aa", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8405, "upload_time": "2017-07-28T15:36:14", "url": "https://files.pythonhosted.org/packages/60/d6/0b4fe229b099319efcd4009bce70d888719dd11a84157a3b0dd8fa607e3f/py_context-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf7281dedfb2d545e9e6fe2fb6f5d881", "sha256": "5ce731228c77bf5e4ac1ecb2540998f2036ca925af7df6670153804b2fd6bebc" }, "downloads": -1, "filename": "py-context-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cf7281dedfb2d545e9e6fe2fb6f5d881", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8298, "upload_time": "2017-07-28T15:36:12", "url": "https://files.pythonhosted.org/packages/65/da/54684fd6f8711f92f613374ccfd74936e34a3c9a69c6d9fde850fc9e672e/py-context-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "94dde221a3acc4dfabf4f54ec6cf7449", "sha256": "1d3889f7dac46afac04b5321651aa01ba795427a6d54c9edde4cc2c5eccd0f02" }, "downloads": -1, "filename": "py_context-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "94dde221a3acc4dfabf4f54ec6cf7449", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 10403, "upload_time": "2018-02-19T20:10:57", "url": "https://files.pythonhosted.org/packages/67/b9/ea43d66ae8a47dbd4c71842384057ec365089577c1f041bbc63d89f613d5/py_context-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f48440b307e840770391d5abd0ce5968", "sha256": "f87ae9999d740b61f848ab2b5b51f176e57f81973b72e35de4a8c33527ca71e3" }, "downloads": -1, "filename": "py-context-0.3.0.tar.gz", "has_sig": false, "md5_digest": "f48440b307e840770391d5abd0ce5968", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9936, "upload_time": "2018-02-19T20:10:54", "url": "https://files.pythonhosted.org/packages/6c/90/952d396bfe16f133f239652ea152571c22b26a6a0cc5b67dde02348ffed7/py-context-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "17acb21fb1e0c4f9e5233132904ec3c4", "sha256": "f4ab31a6e8aff4ff5318da9891e68d4dc691b7952327fd5d4b8a7668fb709cad" }, "downloads": -1, "filename": "py_context-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "17acb21fb1e0c4f9e5233132904ec3c4", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7641, "upload_time": "2018-04-11T19:56:56", "url": "https://files.pythonhosted.org/packages/41/ed/424393adc1e43c8810c1fce8108b59914255cb27d26ec15d4199b225b2aa/py_context-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "139e98ac14f51eaa75230c09c320d975", "sha256": "124070aead63fb91b2e95920be1fe0bdcd49b6fb1cd89971e8ecc3b5530cc20d" }, "downloads": -1, "filename": "py-context-0.3.1.tar.gz", "has_sig": false, "md5_digest": "139e98ac14f51eaa75230c09c320d975", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10136, "upload_time": "2018-04-11T19:56:54", "url": "https://files.pythonhosted.org/packages/55/f2/91bca75b7a89a28cb8c0c7db0404be0ab28f660ac848c91f0753b516b37d/py-context-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "17acb21fb1e0c4f9e5233132904ec3c4", "sha256": "f4ab31a6e8aff4ff5318da9891e68d4dc691b7952327fd5d4b8a7668fb709cad" }, "downloads": -1, "filename": "py_context-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "17acb21fb1e0c4f9e5233132904ec3c4", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7641, "upload_time": "2018-04-11T19:56:56", "url": "https://files.pythonhosted.org/packages/41/ed/424393adc1e43c8810c1fce8108b59914255cb27d26ec15d4199b225b2aa/py_context-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "139e98ac14f51eaa75230c09c320d975", "sha256": "124070aead63fb91b2e95920be1fe0bdcd49b6fb1cd89971e8ecc3b5530cc20d" }, "downloads": -1, "filename": "py-context-0.3.1.tar.gz", "has_sig": false, "md5_digest": "139e98ac14f51eaa75230c09c320d975", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10136, "upload_time": "2018-04-11T19:56:54", "url": "https://files.pythonhosted.org/packages/55/f2/91bca75b7a89a28cb8c0c7db0404be0ab28f660ac848c91f0753b516b37d/py-context-0.3.1.tar.gz" } ] }