{ "info": { "author": "Walter Huf", "author_email": "hufman@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask_rdf\n==========\n\nA Flask or Bottle or WSGI decorator to output RDF using content negotiation.\n\nApply the ``@flask_rdf`` or ``@bottle_rdf`` or ``@wsgi_rdf`` decorator to\na view function and return an rdflib Graph object. Flask_rdf will automatically\nformat it into an RDF output format, depending on what the request's Accept\nheader says. If the view function returns something besides an rdflib graph,\nit will be passed through without modification.\n\nCustom formats can be registered easily. After registering the new\nserializer with rdflib's plugin support, use the ``add_format``\nmethod to register a new mimetype request to use the new formatter.\n\nThe functionality of this module can still help other web frameworks, even\nif there isn't a specific decorator yet. The ``format.decide`` function will\nreturn information about with ``Content-Type`` header to send and what\nserialization format to use with rdflib. The ``format.wants_rdf`` function\ncan be used at a high level to determine whether the client even wants RDF.\n\nAPI\n---\n\n- ``add_format(mimetype, serialize_format)``, ``format.add_format(mimetype, serialize_format)``\n\n Registers a new format to be recognized for content negotiation. It\n accepts arguments ``mimetype``, ``serialize_format``, and is used to add any\n custom rdflib serializer plugins to be used for the content\n negotiation.\n A third argument, requires_context, will restrict this serializer to\n only be used by graphs that are ``context_aware``.\n\n- ``format.decide(accept, context_aware=False)``\n\n Given an Accept header, return a (``mimetype``, ``format``) tuple that would\n best satisfy the client's request.\n If the Accept header is blank, default to RDF+XML\n If the Accept header can't be satisfied, returns (None, None)\n A second argument, context_aware, may be used to allow formats\n that require a ``context_aware`` graph.\n\n- ``FormatSelector()``, ``format.FormatSelector()``\n\n Class to decide serialization formats. It supports using the module-level\n formats added with ``format.add_format``, but it has its own list of\n formats added with ``FormatSelector().add_format``.\n\n- ``wants_rdf(accept)``, ``format.wants_rdf(accept)``, ``FormatSelector.wants_rdf(accept)``\n\n Returns whether the client's Accept header indicates that the client\n is prepared to receive RDF data. This can be used in the view to\n return a pretty HTML page for browsers, for example.\n\n- ``@flask_rdf``, ``@flask.returns_rdf``\n\n Decorator for a Flask view function to use the Flask request's Accept\n header. It handles converting an rdflib Graph object to the proper\n Flask response, depending on the content negotiation. Other content\n is returned without modification.\n\n- ``flask.Decorator``\n\n Class to act as the decorator, in case some behavior needs to be overridden.\n The constructor accepts a FormatSelector object to do custom negotiation.\n The Decorator object itself can be used as the decorator, and it also\n supports the methods ``.output`` and ``.decorate``.\n\n- ``@bottle_rdf``, ``@bottle.returns_rdf``\n\n Decorator for a Bottle view function to use the Bottle request's Accept\n header. It handles converting an rdflib Graph object to the proper\n Bottle response, depending on the content negotiation. Other content\n is returned without modification.\n\n- ``bottle.Decorator``\n\n Class to act as the decorator, in case some behavior needs to be overridden.\n The constructor accepts a FormatSelector object to do custom negotiation.\n The Decorator object itself can be used as the decorator, and it also\n supports the methods ``.output`` and ``.decorate``.\n\n- ``@wsgi_rdf``, ``@wsgi.returns_rdf``\n\n Decorator for a WSGI app function to use the WSGI request's Accept\n header. It handles converting an rdflib Graph object to the proper\n Bottle response, depending on the content negotiation. Other content\n is returned without modification.\n Calls to WSGI's ``start_response`` will pass data through unchanged. Doing\n both a ``start_response`` and returning an RDF object will result in both\n outputs being returned, so don't do that.\n\n- ``wsgi.Decorator``\n\n Class to act as the decorator, in case some behavior needs to be overridden.\n The constructor accepts a FormatSelector object to do custom negotiation.\n The Decorator object itself can be used as the decorator, and it also\n supports the methods ``.output`` and ``.decorate``.\n\nExample\n-------\n\n.. code:: python\n\n #!/usr/bin/env python\n from rdflib import Graph, BNode, Literal, URIRef\n from rdflib.namespace import FOAF\n from flask import Flask\n from flask_rdf.flask import returns_rdf\n import random\n\n app = Flask(__name__)\n\n @app.route('/')\n @app.route('/')\n @returns_rdf\n def random_age(path=''):\n graph = Graph('IOMemory', BNode())\n graph.add((URIRef(path), FOAF.age, Literal(random.randint(20, 50))))\n return graph\n\n if __name__ == '__main__':\n app.run(host='0.0.0.0', debug=True)\n\n.. image:: https://travis-ci.org/hufman/flask_rdf.svg?branch=master\n :alt: Build Status\n :target: https://travis-ci.org/hufman/flask_rdf\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hufman/flask_rdf", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "flask_rdf", "package_url": "https://pypi.org/project/flask_rdf/", "platform": "Any", "project_url": "https://pypi.org/project/flask_rdf/", "project_urls": { "Homepage": "https://github.com/hufman/flask_rdf" }, "release_url": "https://pypi.org/project/flask_rdf/0.2.1/", "requires_dist": [ "six", "python-mimeparse (==0.1.4)" ], "requires_python": "", "summary": "Flask decorator to output RDF using content negotiation", "version": "0.2.1" }, "last_serial": 3378787, "releases": { "0.1.5": [ { "comment_text": "built for Linux-3.2.0-4-686-pae-i686-with-glibc2.7", "digests": { "md5": "81705322d52549bcf28bd61e9ca87767", "sha256": "8e026ba15b97fc83aff1d80f4309f85b9c9ce59de4ec76b8134ac41a74efaf06" }, "downloads": -1, "filename": "flask_rdf-0.1.5.linux-i686.tar.gz", "has_sig": false, "md5_digest": "81705322d52549bcf28bd61e9ca87767", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3939, "upload_time": "2014-06-24T04:25:48", "url": "https://files.pythonhosted.org/packages/12/c5/b4408bbf2f306f12f5ea539039f47b104ee383a69d7f350fe59ad695950f/flask_rdf-0.1.5.linux-i686.tar.gz" }, { "comment_text": "", "digests": { "md5": "616c7bd50a5d2d0e40fb88667411584f", "sha256": "8e43825d10a96d10395c95bc70409fcce30ed312857e3a47f223757850943cd5" }, "downloads": -1, "filename": "flask_rdf-0.1.5-py27-none-any.whl", "has_sig": false, "md5_digest": "616c7bd50a5d2d0e40fb88667411584f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5298, "upload_time": "2014-06-24T04:25:51", "url": "https://files.pythonhosted.org/packages/34/c2/a39458baf61f3faef446a53c9df4374211ba204d4eff223ed52fd27a8cdb/flask_rdf-0.1.5-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e8ea823528ff7c33a20eabc858672ab", "sha256": "e2dd875ae9577c858b2f2048318a609544b17f13f52b8ab8b59550c38fe32317" }, "downloads": -1, "filename": "flask_rdf-0.1.5.tar.gz", "has_sig": false, "md5_digest": "0e8ea823528ff7c33a20eabc858672ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2968, "upload_time": "2014-06-24T04:25:00", "url": "https://files.pythonhosted.org/packages/6c/ce/1d95b0d162fe9129c92c88dd939b3dce1b964bd98b574809377d68393900/flask_rdf-0.1.5.tar.gz" } ], "0.1.6": [], "0.1.7": [ { "comment_text": "built for Linux-3.16.0-0.bpo.4-amd64-x86_64-with-glibc2.7", "digests": { "md5": "4be15e8bce4e43d616535ab1a029f3b8", "sha256": "17492e206c569078e763b89063618db5a49e4c4cc2654d977c8d1c7be636ed2a" }, "downloads": -1, "filename": "flask_rdf-0.1.7.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "4be15e8bce4e43d616535ab1a029f3b8", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4373, "upload_time": "2015-10-26T18:15:41", "url": "https://files.pythonhosted.org/packages/b3/4c/8e32e6dbd44fcd186732bae52456c5727fa510018599de0b9777f9af26c6/flask_rdf-0.1.7.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "2d3d6cef86dc1d2fda63e294df947c6e", "sha256": "1788a0aa566ad0d892bc4b5418e8cced440c2b4d24c4a5bc6f9fdde4a6d43a49" }, "downloads": -1, "filename": "flask_rdf-0.1.7-py2-none-any.whl", "has_sig": false, "md5_digest": "2d3d6cef86dc1d2fda63e294df947c6e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5751, "upload_time": "2015-10-26T18:15:46", "url": "https://files.pythonhosted.org/packages/04/61/36f0a87b1a9ac1df54c1699fe7ae680225b253c9e3a98d57bce03e0a78bc/flask_rdf-0.1.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dfe0a9748141f41398361ca72300e9b4", "sha256": "04bc169ce75b32e470cc82ef0887afb08dc90f31e274ffee215da9286f423a94" }, "downloads": -1, "filename": "flask_rdf-0.1.7.tar.gz", "has_sig": false, "md5_digest": "dfe0a9748141f41398361ca72300e9b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3415, "upload_time": "2015-10-26T18:15:36", "url": "https://files.pythonhosted.org/packages/5e/7d/41a70dfc8f96c9263f3a821d84703266cf967067612a4eb8d56a3849f7cc/flask_rdf-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "7dc129e5e93b19d5a2656c9483c70f4b", "sha256": "fb326d2c20eacc0b819c1fcdedd29d7f8d3455e84f1244d0e4ba68d31d05398b" }, "downloads": -1, "filename": "flask_rdf-0.1.8-py2-none-any.whl", "has_sig": false, "md5_digest": "7dc129e5e93b19d5a2656c9483c70f4b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6268, "upload_time": "2016-01-12T01:33:50", "url": "https://files.pythonhosted.org/packages/8f/6d/b8290cebfa3142e9194f2ed12d9831bdab47db07fbdb2a62bd3bb379bdb4/flask_rdf-0.1.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "702bed1a183d0baac4fd342cfa8f8c26", "sha256": "08d61778142f41d7b9579d8fd61b8c20898269aa3d2c69d419fa7fd594b49c39" }, "downloads": -1, "filename": "flask_rdf-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "702bed1a183d0baac4fd342cfa8f8c26", "packagetype": "bdist_wheel", "python_version": "3.2", "requires_python": null, "size": 6267, "upload_time": "2016-01-12T01:35:39", "url": "https://files.pythonhosted.org/packages/92/0f/7abb9bc7c69cd8e35f517185791444704963596bf1125463cee23592611a/flask_rdf-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f3fda918153dca21800bae9babc8972", "sha256": "ad99fc2bfa40a32f1aade06b95bc104f473fde84026757c521c33d89392d38af" }, "downloads": -1, "filename": "flask_rdf-0.1.8.tar.gz", "has_sig": false, "md5_digest": "8f3fda918153dca21800bae9babc8972", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3851, "upload_time": "2016-01-12T01:33:45", "url": "https://files.pythonhosted.org/packages/2b/4e/adc024ebeea857f2b4b8163088722465fd4e5af6637954a17629ceca0dda/flask_rdf-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1220126d0fdaee10732af9a64ac5c79d", "sha256": "251204b5c833ea8cf0a1aafc86103c665ed211db21ff9b8a3c87897f3c1dc3f3" }, "downloads": -1, "filename": "flask_rdf-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "1220126d0fdaee10732af9a64ac5c79d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11307, "upload_time": "2016-02-29T02:04:41", "url": "https://files.pythonhosted.org/packages/7a/f9/b0c45d27b550c2da90e09f88694a1bc320cd19675823a7807b2bb317deeb/flask_rdf-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6ce549acdf39301f20b2ec0515a63d5", "sha256": "5200324c05652629b282b7148206eaffda954679ec25daf3f85f22a2b73a4cdc" }, "downloads": -1, "filename": "flask_rdf-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b6ce549acdf39301f20b2ec0515a63d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11307, "upload_time": "2016-02-29T02:04:49", "url": "https://files.pythonhosted.org/packages/8b/72/b49e0a0d44fffbffee99792a44179f71d26766f0fe2ae1bfe6aae5e1f058/flask_rdf-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8970bd0ba3da3ac5356c46fc432b8f06", "sha256": "45d8525aeea0cc521721a53ce8a33de955e40374bce1ab6986668e505377c121" }, "downloads": -1, "filename": "flask_rdf-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8970bd0ba3da3ac5356c46fc432b8f06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7598, "upload_time": "2016-02-29T02:04:54", "url": "https://files.pythonhosted.org/packages/35/61/7c68db7ef5094ab477f70acb4edb20a3ac24bb872c325a4c7eb0f33b391d/flask_rdf-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "35fc9aa3e6ac9183e074f93ce446e44d", "sha256": "b71c4f403639bf6b5c082971e96caf4e05ddd0b93be55ad9a21850b83b256769" }, "downloads": -1, "filename": "flask_rdf-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "35fc9aa3e6ac9183e074f93ce446e44d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11492, "upload_time": "2017-11-30T23:02:53", "url": "https://files.pythonhosted.org/packages/1f/63/a1332b215069d8f6b9f847be7c9aebe19c783954b3da94cdaab94317a631/flask_rdf-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05b265dd758bce26ed660f9c5d3cd455", "sha256": "90038a13bf848a76469d95876deb81763789de49c3b20f694dd84832ef399133" }, "downloads": -1, "filename": "flask_rdf-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "05b265dd758bce26ed660f9c5d3cd455", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11487, "upload_time": "2017-11-30T23:02:55", "url": "https://files.pythonhosted.org/packages/fc/06/20229336a39506ef1804644572bbc7bcb2d1b8cc7f1e4cdbe7a1e11ee893/flask_rdf-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4d512037023c9cbec3635cf3898d080", "sha256": "6848d4e53fa83117555803cb7d52cdea1a2fafd793898f59d19bfc64cf27db8b" }, "downloads": -1, "filename": "flask_rdf-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a4d512037023c9cbec3635cf3898d080", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6923, "upload_time": "2017-11-30T23:02:56", "url": "https://files.pythonhosted.org/packages/fe/61/54f8df08295a50b4d464f90e864b823a513061ad48f945266948bffdddcb/flask_rdf-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35fc9aa3e6ac9183e074f93ce446e44d", "sha256": "b71c4f403639bf6b5c082971e96caf4e05ddd0b93be55ad9a21850b83b256769" }, "downloads": -1, "filename": "flask_rdf-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "35fc9aa3e6ac9183e074f93ce446e44d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11492, "upload_time": "2017-11-30T23:02:53", "url": "https://files.pythonhosted.org/packages/1f/63/a1332b215069d8f6b9f847be7c9aebe19c783954b3da94cdaab94317a631/flask_rdf-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05b265dd758bce26ed660f9c5d3cd455", "sha256": "90038a13bf848a76469d95876deb81763789de49c3b20f694dd84832ef399133" }, "downloads": -1, "filename": "flask_rdf-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "05b265dd758bce26ed660f9c5d3cd455", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11487, "upload_time": "2017-11-30T23:02:55", "url": "https://files.pythonhosted.org/packages/fc/06/20229336a39506ef1804644572bbc7bcb2d1b8cc7f1e4cdbe7a1e11ee893/flask_rdf-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4d512037023c9cbec3635cf3898d080", "sha256": "6848d4e53fa83117555803cb7d52cdea1a2fafd793898f59d19bfc64cf27db8b" }, "downloads": -1, "filename": "flask_rdf-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a4d512037023c9cbec3635cf3898d080", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6923, "upload_time": "2017-11-30T23:02:56", "url": "https://files.pythonhosted.org/packages/fe/61/54f8df08295a50b4d464f90e864b823a513061ad48f945266948bffdddcb/flask_rdf-0.2.1.tar.gz" } ] }