{ "info": { "author": "Gandi", "author_email": "feedback@gandi.net", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI" ], "description": "===========\npyramid_kvs\n===========\n\n.. image:: https://travis-ci.org/Gandi/pyramid_kvs.svg?branch=master\n :target: https://travis-ci.org/Gandi/pyramid_kvs\n\nSome Key Value Store basics for pyramid:\n\nTwo KVS are implemented:\n - memcache\n - redis\n\nHere are the provides features:\n\n - An application cache, shared by every request.\n - A session manager\n - A rate limit per session holder\n - A perl session reader (except you are migrating a perl website,\n you probably don't want to use it).\n\nEvery of this components are optional, they exists if they are set in the\nconfiguration like below.\nComponent settings are written in json.\n\nCache\n=====\n\nThe application cache is a new attribute of the session. ``request.cache`` if\nthe settings ``kvs.cache`` exists.\nHere are an example of configuration\n\n::\n\n kvs.cache = {\"kvs\": \"redis\",\n \"codec\": \"pickle\",\n \"kvs_kwargs\": {},\n \"ttl\": 300,\n \"key_prefix\": \"cache::\"}\n\nEvery kvs, except the type are optional.\nThe example contains every key with their default values for a redis instance.\nThe ``kvs_kwargs`` key is passed to the driver to build the client connection.\n\nSession\n=======\n\nThe session is accessible via \"request.session\", it's in every pyramid\napplication.\nThis is just an implementation for Key Value Store users.\n\n::\n\n kvs.session = {\"kvs\": \"redis\",\n \"key_name\": \"session_id\",\n \"session_type\": \"cookie\",\n \"ttl\": 300,\n \"key_prefix\": \"session::\"}\n\n\nEvery kvs, except the type are optional.\nThe example contains every key with their default values for a redis instance.\n\nYou can also create a session for an http header like authentication token,\nit's help to create a cache per user in an API. API don't use cookies.\n\n::\n\n kvs.session = {\"kvs\": \"redis\",\n \"key_name\": \"X-Auth-Token\",\n \"session_type\": \"header\",\n \"ttl\": 300,\n \"key_prefix\": \"session::\"}\n\n\nRatelimit\n=========\n\nThe ratelimit works only if the kvs.session is used!\nRatelimit is per session hold and limit number of http queries in a defined\nperiod.\n\n::\n\n kvs.ratelimit = {\"window\": 1, \"limit\": 15}\n\nAll keys are optional.\nThe example contains every key with their default values for a redis instance.\n\n\nIf the ratelimit is enabled, every response will be decorated with the\nfollowing http headers:\n - ``X-RateLimit-Limit``: max queries in the period.\n - ``X-RateLimit-Remaining``: current remaining queries in that period.\n\n\nperlsess\n========\n\nThis permit to read a session from a perl that use `storable`_ session.\n\n_`storable`: http://search.cpan.org/~ams/Storable-2.45/Storable.pm\n\nHere is an example.\n\n::\n\n\n # declare the perlsess\n kvs.perlsess = {\"type\": \"memcached\"}\n\n\nUsage:\n\nDeclare the addons in the ``pyramid.includes`` in your config, then\ntweak the settings like above.\n\n::\n\n # development.ini\n [app:main]\n pyramid.includes =\n pyramid_kvs\n\n # declare the application cache\n # except type, every keys are optional\n # kvs_kwargs for redis is the parameters of the redis.Redis class\n # see: http://redis-py.readthedocs.org/en/latest/\n # for memcache, parameters of the memcache.Client class\n # https://github.com/linsomniac/python-memcached/blob/master/memcache.py#L160\n kvs.cache = {\"type\": \"redis\"}\n\n # declare the session\n kvs.session = {\"type\": \"redis\"}\n\n # Authorize a session holder to do 20 http queries max in 2 seconds.\n kvs.ratelimit = {\"window\": 2, \"limit\": 20}\n\n\ntests\n=====\n\npyramid_kvs have also a 'mock' implementation of a `kvs` used for testing\npurpose, register it using the pyramid plugins in your tests:::\n\npyramid.includes =\n pyramid_kvs.testing\n\n\nChangelog\n=========\n\n0.4.1 (2019-03-12)\n------------------\n\n * Switch default serializer to json\n WARNING: pickle serialize datetime by default, json don't, force the\n serializer to pickle for backward compatibility in case datetime\n are serialized\n\n0.4.0 (2019-02-18)\n------------------\n\n * Fix backward incompatibility of redis 3.x\n * Drop support of redix 2.x branch\n\n\n0.3.1 (2019-02-22)\n------------------\n\n * Switch default serializer to json\n WARNING: pickle serialize datetime by default, json don't, force the\n serializer to pickle for backward compatibility in case datetime\n are serialized\n\n0.3.0 (2018-03-15)\n------------------\n\n * Don't freeze pyramid version\n * Remove support of python 2.6\n\n\n0.2.3 (2015-09-14)\n------------------\n\n* Add get keys for Redis\n\n0.2.2 (2015-05-29)\n------------------\n\n* Bump version for PyPI upload problems\n A file named \"pyramid-kvs-0.2.1.tar.gz\" already exists for pyramid-kvs-0.2.1.\n To fix problems with that file you should create a new release.\n\n0.2.1\n-----\n\n* Improve testing\n\n\n0.2\n---\n\n* Add python 3 support\n\n\n0.1.1\n-----\n\n* Fix package, files are missing\n\n\n0.1\n---\n\n* Initial version\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Gandi/pyramid_kvs", "keywords": "web pyramid pylons", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyramid-kvs", "package_url": "https://pypi.org/project/pyramid-kvs/", "platform": "", "project_url": "https://pypi.org/project/pyramid-kvs/", "project_urls": { "Homepage": "https://github.com/Gandi/pyramid_kvs" }, "release_url": "https://pypi.org/project/pyramid-kvs/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Session and cache for Pyramid", "version": "0.4.1" }, "last_serial": 4929518, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "4620e4def7e35137e9d33368e12dd38e", "sha256": "6c9d9cd095deaf7fb32c5add7032a66de3f4efa7f6be0898087b3c8dbc1bde1f" }, "downloads": -1, "filename": "pyramid-kvs-0.2.2.tar.gz", "has_sig": false, "md5_digest": "4620e4def7e35137e9d33368e12dd38e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19767, "upload_time": "2015-05-29T08:45:04", "url": "https://files.pythonhosted.org/packages/79/8c/05fb5daffce67dc1501228bfc239c9ada8dc972bdaf7be32cd4a8cbcaece/pyramid-kvs-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "9d7be7283dc5befcdb1670b741a746be", "sha256": "834880a6cf2fbcd9ac39edf7048d5a38036aabc495cad618534f8d90b6e354b9" }, "downloads": -1, "filename": "pyramid-kvs-0.2.3.tar.gz", "has_sig": false, "md5_digest": "9d7be7283dc5befcdb1670b741a746be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20019, "upload_time": "2015-11-09T09:07:00", "url": "https://files.pythonhosted.org/packages/38/1b/ee1c256d60ea5cc68255080582ec24f7bb00a5c2e789498a83dbeb3a5013/pyramid-kvs-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6aecfa48e8ca2acedf4e63609d63141b", "sha256": "4044e782672dba87cce621827558cb8a69346d6485bbc19b7285215a4d4223a1" }, "downloads": -1, "filename": "pyramid-kvs-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6aecfa48e8ca2acedf4e63609d63141b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20131, "upload_time": "2018-03-15T13:43:04", "url": "https://files.pythonhosted.org/packages/61/82/1a9b34af74b8d7de818f8258fb49682dc1be567660cb30561310f064c9ad/pyramid-kvs-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "21112db4a2cfab3d71acf7e4a57d64b9", "sha256": "23bd25364724fed68c0ecb8d3d4e777f59bc1c2b1c7e9c787ce2d0b5075d019d" }, "downloads": -1, "filename": "pyramid-kvs-0.3.1.tar.gz", "has_sig": false, "md5_digest": "21112db4a2cfab3d71acf7e4a57d64b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20385, "upload_time": "2019-02-22T08:28:31", "url": "https://files.pythonhosted.org/packages/fb/45/cfc63d44ec866e8a54da0fec407e8b8921f55dea5f95ed963f0dd24e0ee1/pyramid-kvs-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "14ff43350acb3c24527d48a6b38e4f43", "sha256": "c95ce9bd2d184843c1f79ecd76e259f5bebee546c32b18203c9d61d08df3bc4a" }, "downloads": -1, "filename": "pyramid-kvs-0.4.0.tar.gz", "has_sig": false, "md5_digest": "14ff43350acb3c24527d48a6b38e4f43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20241, "upload_time": "2019-02-18T13:12:14", "url": "https://files.pythonhosted.org/packages/f1/40/391f730f86c98c612aca29c22e1f2dc881414c7dbbcdd54c67f05bd78a69/pyramid-kvs-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "1ba98243106f31eea40c6658971877f5", "sha256": "0e7e98fad54a394b12102d3482d556386156e5b5cd6023338ade054b18eca2f2" }, "downloads": -1, "filename": "pyramid-kvs-0.4.1.tar.gz", "has_sig": false, "md5_digest": "1ba98243106f31eea40c6658971877f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20516, "upload_time": "2019-03-12T10:48:28", "url": "https://files.pythonhosted.org/packages/18/33/dc20dd2ffc64b5f01ef61978d0f11187c1630893bcb0c8e77677cfac2b76/pyramid-kvs-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ba98243106f31eea40c6658971877f5", "sha256": "0e7e98fad54a394b12102d3482d556386156e5b5cd6023338ade054b18eca2f2" }, "downloads": -1, "filename": "pyramid-kvs-0.4.1.tar.gz", "has_sig": false, "md5_digest": "1ba98243106f31eea40c6658971877f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20516, "upload_time": "2019-03-12T10:48:28", "url": "https://files.pythonhosted.org/packages/18/33/dc20dd2ffc64b5f01ef61978d0f11187c1630893bcb0c8e77677cfac2b76/pyramid-kvs-0.4.1.tar.gz" } ] }