{ "info": { "author": "Branko Vukelic", "author_email": "branko@brankovukelic.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License" ], "description": "===========\nFlaskWarts\n===========\n\nFlaskWarts are a set of utility classes and functions for making it easier to\novercome some of the warts that one always seem to encounter when developing\nFlask applications. It's called 'warts' because 'utils' was taken. The main\npackage is still called ``utils``, because that's what it was called in a few\napps author was using the code in, and was too lazy to refactor them all.\n\nOverview\n========\n\nThe library is not too generic. In fact, it's quite opinionated. It's made\navailable as is if you care to use it, but it's mainly there for the author's\nuse cases.\n\nWhile not an immediate goal, it is author's intention to make this a\nfully-comliant Flask extension at some point, and far more flexible. It may be\nbrokend down into multiple separate libraries as well. Currently, it is a\nmulti-purpose library that expects you to organize your site as a single\napplication and uses ``flask.current_app`` extensively. While this is not a\ngood pattern in general, it's a pattern that works (for the time being).\n\nIt also expects that you place your configuration in ``app.config``.\n\nNote that not all code is fully developed and tested. Some of the code even\nmisses unit tests, and documentation doesn't exist. So this is pretty much\npre-alpha software. Also, don't expect anything in the way of API stability in\nany form.\n\nFeatures\n========\n\nThe utils have following features:\n\n+ Class-based route handlers (``utils.routes``)\n+ Form-handling with Formencode (``utils.forms``)\n+ CSRF middleware (``utils.middlewares``)\n+ Basic timezone manipulation support (``utils.timezone``)\n+ One decorator for denying non-XHR requests (``utils.decorators``)\n\nInstallation\n============\n\nEither::\n\n easy_install FlaskWarts\n\nOr::\n\n pip install FlaskWarts\n\n\nClass-based route handling\n==========================\n\nPlease see the sources for now. More detailed docs are planned for future\nreleases. It's similar to Django's CBVs but not quite the same.\n\nSimple example::\n\n from flask import render_template\n from utils.routes import Route\n\n class MyRoute(Route):\n path = '/my'\n\n def GET(self):\n return render_template('foo.html')\n\nMethod names correspond to HTTP methods, and any positional or keyword\narguments in the paths are passed as positional and keyword arguments to the\nmethod. In addition, the positional and keyword arguments are accessible as\n``self.args`` and ``self.kwargs``, a list and dict respectively.\n\nMethods are expected to return a response just like normal flask route handler\nfunctions.\n\nBy default, HTTP method overrides are supported via the ``_method`` request \nparameter for all POST requests, and the ``Route`` class intelligently maps\nthem to the correct instance method. This is handled transparently behind the\nscenes so you don't have to worry about it. You can disable this behavior, by\nsetting the ``allow_overrides`` property to ``False`` in your subclass.\n\nThere are many subclasses of the ``Route`` class which implement different\ninterfaces for common tasks like form processing and template rendering. Some\nof them implement multiple HTTP methods. For now you will have to look at the\nsources to find out more.\n\nRoutes are reigstered by calling the ``register()`` class method, and passing\nit an application object::\n\n MyRoute.register(app)\n\nThe route name can be explicitly specified using the ``name`` property.\nOtherwise, it is derived from the class name by decamelizing it. For instance,\n``MyRoute`` has a name of ``my_route``. ``Foo`` has a name of ``foo``, and so\non.\n\nIf you organize routes into modules (e.g., have multiple route classes in a\nsingle module), you can register them in batches. ::\n\n from utils.routes import register_module\n register_module(app, 'myapp.routes')\n\nThe ``register_module()`` function will register any object that has\n``register()`` and ``get_route_name()`` attributes, and whose path attribute is\nnot ``None``. This is generally a good enough set of rules to catch all routes,\nbut if you have objects that accidentally fulfill the conditions, the function\nwill try to register it, so be careful.\n\nIf you want to explicitly exlude routes, you can use the ``exclude`` argument.\nThis argument should be an iterable containing names of classes or route names.\n\nFor instance::\n \n register_module(app, 'myapp.routes', exclude=['Test', 'mickey_mouse'])\n\nThe above excludes classes ``Test`` and ``MickeyMouse``.\n\nForm-handling with Formencode\n=============================\n\nAllows basic form validation using Formencode's ``htmlfill_schemabuilder``.\nDocs on the way, so stay tuned.\n\nCSRF middleware\n===============\n\nA bit rough at the moment, but works. Uses ``os.urandom`` for random number\ngeneration, you've been warned. It also makes Jinja2 a requirement.\n\nBasic usage is simply::\n\n from utils.middlewares import csrf\n csrf(app)\n\nIn template::\n\n
\n {{ csrf_tag }}\n ...\n
\n\nDocs? Who said anything about docs? :D\n\nTimezone manipulation\n=====================\n\nRequires pytz_. Again, no docs yet, so please look at the module.\n\nDecorators\n==========\n\nTo prevent non-XHR requests to your endpoint, just do this::\n\n from utils.decorators import xhr_only\n\n @app.route('/')\n @xhr_only\n def my_view():\n pass\n\nIt will abort a non-XHR request with HTTP 400 status.\n\n\n.. _pytz: http://pytz.sourceforge.net/", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/brankovukelic/flaskwarts/downloads", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/brankovukelic/flaskwarts/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "FlaskWarts", "package_url": "https://pypi.org/project/FlaskWarts/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/FlaskWarts/", "project_urls": { "Download": "https://bitbucket.org/brankovukelic/flaskwarts/downloads", "Homepage": "https://bitbucket.org/brankovukelic/flaskwarts/" }, "release_url": "https://pypi.org/project/FlaskWarts/0.1a8/", "requires_dist": null, "requires_python": null, "summary": "Assortment of various utilities for Flask applications", "version": "0.1a8" }, "last_serial": 1056118, "releases": { "0.1a": [ { "comment_text": "", "digests": { "md5": "1eb346d443ec0befc3d9e11e4b37be09", "sha256": "34e62f241ef76a5a9b766ed612ae43f45dcc7a1a7c4fd6b7efc5455137cc2806" }, "downloads": -1, "filename": "FlaskWarts-0.1a.tar.gz", "has_sig": false, "md5_digest": "1eb346d443ec0befc3d9e11e4b37be09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8754, "upload_time": "2014-02-27T14:45:59", "url": "https://files.pythonhosted.org/packages/ab/93/fdbc5fdd06014b148bc4235f5457963eb09f320bde21ee68375d9eefbcec/FlaskWarts-0.1a.tar.gz" }, { "comment_text": "", "digests": { "md5": "cac1ee6e529c2294273164dcff18c9de", "sha256": "e5643494f46da88120d14fdb4673ada15b5dd27ca381a055c7788bcd83346819" }, "downloads": -1, "filename": "FlaskWarts-0.1a.zip", "has_sig": false, "md5_digest": "cac1ee6e529c2294273164dcff18c9de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12538, "upload_time": "2014-02-27T14:45:57", "url": "https://files.pythonhosted.org/packages/94/59/73833b7c7ff941997af2d10c0913af6234a0f26da9e2f8a5e2bdcc53429c/FlaskWarts-0.1a.zip" } ], "0.1a2": [ { "comment_text": "", "digests": { "md5": "d715bcd8e0c358a110fde938b5870a8c", "sha256": "f35e45646dc86755e447124d05420b99ed6d612f1f421f9a0af6e8bbf7510d34" }, "downloads": -1, "filename": "FlaskWarts-0.1a2.tar.gz", "has_sig": false, "md5_digest": "d715bcd8e0c358a110fde938b5870a8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8744, "upload_time": "2014-02-27T16:31:24", "url": "https://files.pythonhosted.org/packages/1a/06/9c5669ea12b6454535f96a66be8e20852fef79e931e6e2db1e11ef3ced83/FlaskWarts-0.1a2.tar.gz" }, { "comment_text": "", "digests": { "md5": "c551dd76611b8f9c4af07893ca1ba0fd", "sha256": "df010af097f6dfa782f109d8f56605047a67c4f70064d19332525f3119cc7040" }, "downloads": -1, "filename": "FlaskWarts-0.1a2.zip", "has_sig": false, "md5_digest": "c551dd76611b8f9c4af07893ca1ba0fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12548, "upload_time": "2014-02-27T16:31:20", "url": "https://files.pythonhosted.org/packages/2a/42/4313f18922315ccef7309fd474c4355e0c5fe26ff36de80d6276234323b6/FlaskWarts-0.1a2.zip" } ], "0.1a3": [ { "comment_text": "", "digests": { "md5": "91b62a822332ff693f7209e3f82dba94", "sha256": "0ee9963fbc382ba4ee9d5220980aeeba16ac9b01cf1c4eea2dddb64851db1b77" }, "downloads": -1, "filename": "FlaskWarts-0.1a3.tar.gz", "has_sig": false, "md5_digest": "91b62a822332ff693f7209e3f82dba94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8749, "upload_time": "2014-02-27T16:45:42", "url": "https://files.pythonhosted.org/packages/74/aa/d0d37275892c9639d297fe1bf217b86d9473f7adb9fce7f6e6658bd917d0/FlaskWarts-0.1a3.tar.gz" }, { "comment_text": "", "digests": { "md5": "fb9ba1747bc16888e402f51bd443b01a", "sha256": "b057e7a2e38989b4a3fca075397d6a6f4580a6318e3f0e7dbc8fca4540b1b279" }, "downloads": -1, "filename": "FlaskWarts-0.1a3.zip", "has_sig": false, "md5_digest": "fb9ba1747bc16888e402f51bd443b01a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12547, "upload_time": "2014-02-27T16:45:39", "url": "https://files.pythonhosted.org/packages/56/cb/4ee9cec0fba9e564644ff84aab1e94a8fb6195073e64873d82020d956d8c/FlaskWarts-0.1a3.zip" } ], "0.1a4": [ { "comment_text": "", "digests": { "md5": "70eb3d8a96d18a4fe079ee32e611fb0a", "sha256": "2a288858afe0d1e8feedd897e8fd95d35757234e6a8e4449353c19440530c937" }, "downloads": -1, "filename": "FlaskWarts-0.1a4.tar.gz", "has_sig": false, "md5_digest": "70eb3d8a96d18a4fe079ee32e611fb0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8745, "upload_time": "2014-03-04T14:31:09", "url": "https://files.pythonhosted.org/packages/42/2e/384bce0c66632da6e945eeebaf33a5dfb8c8f8b70fbc97c656d4d8b790b7/FlaskWarts-0.1a4.tar.gz" }, { "comment_text": "", "digests": { "md5": "c47581dbf87c27e9b5fa39c8ec84ba0a", "sha256": "b03f87d6215ee7f03e4dfeca2a6937ae4387a947cd71a36dfde2a8e9e9cc0051" }, "downloads": -1, "filename": "FlaskWarts-0.1a4.zip", "has_sig": false, "md5_digest": "c47581dbf87c27e9b5fa39c8ec84ba0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12545, "upload_time": "2014-03-04T14:31:07", "url": "https://files.pythonhosted.org/packages/f2/85/a929934e6d196528c3708cb9cd2207f0f8f857f9f149a600a766e59a2fba/FlaskWarts-0.1a4.zip" } ], "0.1a5": [ { "comment_text": "", "digests": { "md5": "25262ea301a80b67e9a796aa7ee47456", "sha256": "d4688c359e465e50968b9137513a72539d4ece1f44fa7c87ecc6edf28d075375" }, "downloads": -1, "filename": "FlaskWarts-0.1a5.tar.gz", "has_sig": false, "md5_digest": "25262ea301a80b67e9a796aa7ee47456", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10078, "upload_time": "2014-03-05T15:27:37", "url": "https://files.pythonhosted.org/packages/31/b4/f72a882aefcd0fba7826f57dc0a9888c637c03bc94bb55dcd890b32de58b/FlaskWarts-0.1a5.tar.gz" }, { "comment_text": "", "digests": { "md5": "cba411d96295f005eb53139f9be240c8", "sha256": "7be5e0ad481b3e87eb5b9396f9d36fee6de0d185dab9759b6d0ad4a02e1e67c8" }, "downloads": -1, "filename": "FlaskWarts-0.1a5.zip", "has_sig": false, "md5_digest": "cba411d96295f005eb53139f9be240c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14802, "upload_time": "2014-03-05T15:27:13", "url": "https://files.pythonhosted.org/packages/00/b2/b44524d8f5ca76613394f622cc93ede60cdf8a94a51e1212427bb08d9af1/FlaskWarts-0.1a5.zip" } ], "0.1a6": [ { "comment_text": "", "digests": { "md5": "670c78b91f70aa7ea782d21231156f91", "sha256": "2591998c17100ea30738b6d203372d20a4f241bb7bc31ecd04e2f0170a7eddaa" }, "downloads": -1, "filename": "FlaskWarts-0.1a6.tar.gz", "has_sig": false, "md5_digest": "670c78b91f70aa7ea782d21231156f91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10030, "upload_time": "2014-03-05T18:49:54", "url": "https://files.pythonhosted.org/packages/3f/14/087a9b57fa86199546d6259fc205df1994b01ab1c8c652a7ebd293756b0d/FlaskWarts-0.1a6.tar.gz" }, { "comment_text": "", "digests": { "md5": "9c5d421b4e9758585e5183ce917faa83", "sha256": "8b2e8493aa853508d5233b7104fb74f75dc84bf95c6f5f07fb71986ff798c333" }, "downloads": -1, "filename": "FlaskWarts-0.1a6.zip", "has_sig": false, "md5_digest": "9c5d421b4e9758585e5183ce917faa83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14765, "upload_time": "2014-03-05T18:49:50", "url": "https://files.pythonhosted.org/packages/a6/a8/818a4997fe14a4c9e28669bfef02e10532992e7715353337b63540532c9a/FlaskWarts-0.1a6.zip" } ], "0.1a7": [ { "comment_text": "", "digests": { "md5": "e9961ceec1fe99cb665818c40c4bc704", "sha256": "fbb16d67fc046b0fb5a97c686c04828eab7b17078dd450e7cd8bd7fe60b7cff7" }, "downloads": -1, "filename": "FlaskWarts-0.1a7.tar.gz", "has_sig": false, "md5_digest": "e9961ceec1fe99cb665818c40c4bc704", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10204, "upload_time": "2014-03-05T18:54:01", "url": "https://files.pythonhosted.org/packages/bb/a9/7416c73cb8e3eb75b2aa4eee111f723fba6884ab4285809a121fe6767d51/FlaskWarts-0.1a7.tar.gz" }, { "comment_text": "", "digests": { "md5": "1e9f4ddcdcf8a2841d65fcb1d0ddafbb", "sha256": "a22e03821b731ef03e31f47ccd3c2de4ef49610b8005127320a588395cef3538" }, "downloads": -1, "filename": "FlaskWarts-0.1a7.zip", "has_sig": false, "md5_digest": "1e9f4ddcdcf8a2841d65fcb1d0ddafbb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14962, "upload_time": "2014-03-05T18:53:59", "url": "https://files.pythonhosted.org/packages/b1/1a/fca99b87b0806053087fc95b1b63b9f3071df6f58c87bd8098e01b6588e8/FlaskWarts-0.1a7.zip" } ], "0.1a8": [ { "comment_text": "", "digests": { "md5": "4b9fa3e90115e529d1cd5a64f394b838", "sha256": "469b67519e0a596ff872cd38fc5a49c2ae19fe4a6a7fefdb0394ea5a23c85a37" }, "downloads": -1, "filename": "FlaskWarts-0.1a8.tar.gz", "has_sig": false, "md5_digest": "4b9fa3e90115e529d1cd5a64f394b838", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10310, "upload_time": "2014-04-09T17:08:00", "url": "https://files.pythonhosted.org/packages/0a/8e/2159aec2c7befc61d37a072e71650c446c3daf68bdc9ea8a9b4820736f3a/FlaskWarts-0.1a8.tar.gz" }, { "comment_text": "", "digests": { "md5": "97f819ea76031e1a499c4fe2caba984f", "sha256": "e8eb4a96ef5ddffc68c45e7ec019f97c4ac5e1fe098c65b074ce0e58ca410350" }, "downloads": -1, "filename": "FlaskWarts-0.1a8.zip", "has_sig": false, "md5_digest": "97f819ea76031e1a499c4fe2caba984f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15071, "upload_time": "2014-04-09T17:07:57", "url": "https://files.pythonhosted.org/packages/6c/93/237e7a8ab13b2bb092fc0765ba6551a2c79190aafecc6fad739dd6e6a584/FlaskWarts-0.1a8.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4b9fa3e90115e529d1cd5a64f394b838", "sha256": "469b67519e0a596ff872cd38fc5a49c2ae19fe4a6a7fefdb0394ea5a23c85a37" }, "downloads": -1, "filename": "FlaskWarts-0.1a8.tar.gz", "has_sig": false, "md5_digest": "4b9fa3e90115e529d1cd5a64f394b838", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10310, "upload_time": "2014-04-09T17:08:00", "url": "https://files.pythonhosted.org/packages/0a/8e/2159aec2c7befc61d37a072e71650c446c3daf68bdc9ea8a9b4820736f3a/FlaskWarts-0.1a8.tar.gz" }, { "comment_text": "", "digests": { "md5": "97f819ea76031e1a499c4fe2caba984f", "sha256": "e8eb4a96ef5ddffc68c45e7ec019f97c4ac5e1fe098c65b074ce0e58ca410350" }, "downloads": -1, "filename": "FlaskWarts-0.1a8.zip", "has_sig": false, "md5_digest": "97f819ea76031e1a499c4fe2caba984f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15071, "upload_time": "2014-04-09T17:07:57", "url": "https://files.pythonhosted.org/packages/6c/93/237e7a8ab13b2bb092fc0765ba6551a2c79190aafecc6fad739dd6e6a584/FlaskWarts-0.1a8.zip" } ] }