{ "info": { "author": "Felipe A. Hernandez", "author_email": "ergoithz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Flask", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "cookieman\n=========\n\nBrowser-aware flask session manager.\n\nThis module allows you to store any amount of data on session cookies without\ncaring about browser-specific cookie limitations, by just registering session\ndata shrink functions.\n\nThis module probably won't play nicely with other cookies set on the same\ndomain: session-cookie could be evicted at any time because other cookies and\nvice versa.\n\nHow it works\n------------\n\nThis module includes a simple browser cookie limit database, which is matched\nagainst flask request's user agent and, on flask response, that information\nis used to serialize the session onto cookies.\n\nThis session implementation supports cookie signatures, multi-cookie session,\nand custom session shrinking logic which will be invoked when needed.\n\nThe session shrinking logic repeat this steps in order until session data fits\ninto cookies:\n\n1. Registered shrinking functions, until they're unable to reduce the cookie\n size.\n2. Unhandled keys are removed.\n3. Registered shrinking functions, now receiving ``True`` as parameter\n ``last``.\n4. Remaining keys are removed.\n\nUsage\n-----\n\nThis module works as a flask session interface, allowing to register session\nshrink functions which will be called once session does not fit on browser\ncookies.\n\n.. code:: python\n\n import flask\n import cookieman\n\n app = flask.Flask(__name__)\n app.session_interface = cookieman.CookieMan()\n app.secret_key = 'my_app_secret_key' # used for session cookie safety\n\n @app.session_interface.register('a')\n def shrink_a(data, last):\n '''\n Session property 'a' shrinking policy: remove last list item on key\n or just remove key.\n\n :param data: session data as dict\n :type data: Mapping[str, Any]\n :param last: wether is last iteration or not\n :type last: bool\n :returns: updated data (can be the same as received)\n :rtype: Mapping[str, Any]\n '''\n if len(data['a']) < 2:\n del data['a']\n else:\n data['a'].pop()\n return data\n\nLicense\n-------\nMIT (see LICENSE file).\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/ergoithz/cookieman", "keywords": "web,browser", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cookieman", "package_url": "https://pypi.org/project/cookieman/", "platform": "any", "project_url": "https://pypi.org/project/cookieman/", "project_urls": { "Homepage": "https://gitlab.com/ergoithz/cookieman" }, "release_url": "https://pypi.org/project/cookieman/0.0.2/", "requires_dist": [ "flask", "werkzeug", "msgpack", "itsdangerous", "importlib-resources", "six" ], "requires_python": "", "summary": "Browser-aware multi-cookie flask session", "version": "0.0.2" }, "last_serial": 5007878, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "251955d29747ad8cae3c66f70cfd8249", "sha256": "7f0b536a714d1fd806976843ea42b1f4b446b96295eba4a430b2fde7e2af9b4e" }, "downloads": -1, "filename": "cookieman-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "251955d29747ad8cae3c66f70cfd8249", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18863, "upload_time": "2019-03-30T18:38:52", "url": "https://files.pythonhosted.org/packages/35/df/e51764ed0990385b5dab9fe804e9646bcd76a97f6876251d5602fec3d4cb/cookieman-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dec5b9c4c452b329dfb95c404fdd8302", "sha256": "ba2c82fdfd9925a38faab230b4b3d489c2dd49332cbe67aa90492b1836c1d7e0" }, "downloads": -1, "filename": "cookieman-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dec5b9c4c452b329dfb95c404fdd8302", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15428, "upload_time": "2019-03-30T18:38:55", "url": "https://files.pythonhosted.org/packages/cd/80/48707c7a27f66e931313b3a58bfe6496a0ef72d1bcef64dbae4948f43e23/cookieman-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "6f9d37f851c5ec7cadaf4ab758a7521e", "sha256": "e5f01f572718ae16c406717757d5f1b8acca8a052c143aed073cfe9a02696437" }, "downloads": -1, "filename": "cookieman-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f9d37f851c5ec7cadaf4ab758a7521e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19063, "upload_time": "2019-03-30T20:39:47", "url": "https://files.pythonhosted.org/packages/37/df/2082899d1ead4a6e4d0148236f413dd02408e74940b240bf9ce0331ee7b8/cookieman-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41ff8580e42e0ca1c21a7e75f8feff33", "sha256": "3afb0eb77961b28644661706f9f642967f0e636333117bc18251e47f016af4a2" }, "downloads": -1, "filename": "cookieman-0.0.2.tar.gz", "has_sig": false, "md5_digest": "41ff8580e42e0ca1c21a7e75f8feff33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15385, "upload_time": "2019-03-30T20:39:48", "url": "https://files.pythonhosted.org/packages/79/3d/dc1766168db81515b68223abd12032a1a4537e1fabbfb2837a3e9302804f/cookieman-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f9d37f851c5ec7cadaf4ab758a7521e", "sha256": "e5f01f572718ae16c406717757d5f1b8acca8a052c143aed073cfe9a02696437" }, "downloads": -1, "filename": "cookieman-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f9d37f851c5ec7cadaf4ab758a7521e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19063, "upload_time": "2019-03-30T20:39:47", "url": "https://files.pythonhosted.org/packages/37/df/2082899d1ead4a6e4d0148236f413dd02408e74940b240bf9ce0331ee7b8/cookieman-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41ff8580e42e0ca1c21a7e75f8feff33", "sha256": "3afb0eb77961b28644661706f9f642967f0e636333117bc18251e47f016af4a2" }, "downloads": -1, "filename": "cookieman-0.0.2.tar.gz", "has_sig": false, "md5_digest": "41ff8580e42e0ca1c21a7e75f8feff33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15385, "upload_time": "2019-03-30T20:39:48", "url": "https://files.pythonhosted.org/packages/79/3d/dc1766168db81515b68223abd12032a1a4537e1fabbfb2837a3e9302804f/cookieman-0.0.2.tar.gz" } ] }