{ "info": { "author": "Raphael Cohen", "author_email": "raphael.cohen.utt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "falcon-pagination-hook\n======================\n\n.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n :target: LICENSE\n.. image:: https://travis-ci.org/Darkheir/falcon-pagination-hook.svg?branch=master\n :target: https://travis-ci.org/Darkheir/falcon-pagination-hook\n.. image:: https://codecov.io/gh/Darkheir/falcon-pagination-hook/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Darkheir/falcon-pagination-hook\n.. image:: https://api.codacy.com/project/badge/Grade/5617fd2a2b724aaea2c0b5f440da7d3f\n :alt: Codacy Badge\n :target: https://app.codacy.com/app/Darkheir/falcon-pagination-hook?utm_source=github.com&utm_medium=referral&utm_content=Darkheir/falcon-pagination-hook&utm_campaign=Badge_Grade_Dashboard\n.. image:: https://pyup.io/repos/github/Darkheir/falcon-pagination-hook/shield.svg\n :target: https://pyup.io/repos/github/Darkheir/falcon-pagination-hook/\n :alt: Updates\n\nA small falcon hook to parse pagination elements from the request.\n\nFor now it parses an Offset based pagination.\n\nUsage\n-----\n\nThe easiest way to use this hook is the following:\n\n.. code:: python\n\n @falcon.before(PaginationFromRequestHook())\n def on_get(self, req, resp, user):\n # Here req['context']['pagination'] is set\n # with 2 keys: 'offset' and 'limit'\n\nThe Hook will look in the query parameters for 2 keys:\n\n* offset: The pagination offset\n* limit: The pagination limit\n\nIt will create a pagination dict into the request context accessible at :code:`req.context['pagination']`.\nThis pagination dict will contain 2 values:\n\n* offset: The offset from the request or 0 if it doesn't exists\n* limit: The limit to apply. If no limit is found the default one is applied (20). If the value is bigger than the max value (100) then the default limit is also applied.\n\nConfiguration options\n---------------------\n\nA few parameters can be passed to the hook:\n\n* default_limit : The limit to apply if none is found in the request query or if the limit is out of bound. Default to 20\n* max_limit: Maximum allowed limit. Default to 100\n* offset_key: Name of the request parameter holding the offset value. Default to 'offset'\n* limit_key: Name of the request parameter holding the limit value. Default to 'limit'\n\nHere's an example setting a default limit to 10, a maximum limit to 500 the offset key to 'page_offset' and the limit key to 'result_limit':\n\n.. code:: python\n\n @falcon.before(PaginationFromRequestHook(\n default_limit=10,\n max_limit=500, \n offset_key='page_offset', \n limit_key='result_limit'\n ))\n def on_get(self, req, resp, user):\n # Get request\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/darkheir/falcon-pagination-hook", "keywords": "falcon pagination api", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "falcon-pagination", "package_url": "https://pypi.org/project/falcon-pagination/", "platform": "", "project_url": "https://pypi.org/project/falcon-pagination/", "project_urls": { "Homepage": "https://github.com/darkheir/falcon-pagination-hook" }, "release_url": "https://pypi.org/project/falcon-pagination/0.0.1/", "requires_dist": [ "falcon (>=0.3)" ], "requires_python": "", "summary": "Falcon pagination helper", "version": "0.0.1" }, "last_serial": 4670414, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "624c214ff27dc6f8a003fd9f8ece9db2", "sha256": "29b3e58e4f43af02f909d6ec8b0efa78d028c2749b515ddf8980fb4b9de0c4de" }, "downloads": -1, "filename": "falcon_pagination-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "624c214ff27dc6f8a003fd9f8ece9db2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5539, "upload_time": "2019-01-07T21:49:03", "url": "https://files.pythonhosted.org/packages/fc/e8/2ca2604ac773b09938c3f04a63eea9ddb9b68433c3dcd7f267855982d5d3/falcon_pagination-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "90214439f977842c6a53e88c4c6f57e7", "sha256": "e20f63306edb6947886fcfbc8afd15958783d6e0a206013283eabf8a2103a528" }, "downloads": -1, "filename": "falcon_pagination-0.0.1.tar.gz", "has_sig": false, "md5_digest": "90214439f977842c6a53e88c4c6f57e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3341, "upload_time": "2019-01-07T21:49:05", "url": "https://files.pythonhosted.org/packages/8b/f3/5a5b1f23ff43ade0c59b83bc19fc8f59e5cdadbb32a86d2f6800717740a9/falcon_pagination-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "624c214ff27dc6f8a003fd9f8ece9db2", "sha256": "29b3e58e4f43af02f909d6ec8b0efa78d028c2749b515ddf8980fb4b9de0c4de" }, "downloads": -1, "filename": "falcon_pagination-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "624c214ff27dc6f8a003fd9f8ece9db2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5539, "upload_time": "2019-01-07T21:49:03", "url": "https://files.pythonhosted.org/packages/fc/e8/2ca2604ac773b09938c3f04a63eea9ddb9b68433c3dcd7f267855982d5d3/falcon_pagination-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "90214439f977842c6a53e88c4c6f57e7", "sha256": "e20f63306edb6947886fcfbc8afd15958783d6e0a206013283eabf8a2103a528" }, "downloads": -1, "filename": "falcon_pagination-0.0.1.tar.gz", "has_sig": false, "md5_digest": "90214439f977842c6a53e88c4c6f57e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3341, "upload_time": "2019-01-07T21:49:05", "url": "https://files.pythonhosted.org/packages/8b/f3/5a5b1f23ff43ade0c59b83bc19fc8f59e5cdadbb32a86d2f6800717740a9/falcon_pagination-0.0.1.tar.gz" } ] }