{ "info": { "author": "Gregor Kalisnik", "author_email": "gregor@kalisnik.si", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-phpBB3\n============\n\nConnector for Flask with phpBB3. Do note, this connector does not use any caches\nand is *read-only*.\n\nSupported drivers\n-----------------\n\n * Direct access\n\n + psycopg2 - direct access to PostgreSQL\n\nSupported phpBB3 versions\n-------------------------\n\n * 3.1.x\n\nConfiguration\n-------------\n\nTo configure this extension, you have to specify PHPBB3 and one of access modes\nconfigs. All of them are dicts.\n\nSettings\n++++++++++++++++\n\n * PHPBB3\n\n + **DRIVER** - Which driver to use (see `Supported drivers`_)\n + **VERSION** - Which version of phpBB3 (see `Supported phpBB3 versions`_)\n\n * PHPBB3_DATABASE - These settings are used when using direct access drivers\n\n + **HOST** - Database host, default is 127.0.0.1\n + **DATABASE** - Database name, default is phpbb3\n + **USER** - User for connecting to database, default is phpbb3\n + **PASSWORD** - Database user's password, default is empty\n + **TABLE_PREFIX** - Table prefix of phpBB3 tables, default is phpbb\\_\n + **CUSTOM_USER_FIELDS** - List of custom fields setup in phpBB3 forum\n + **CUSTOM_STATEMENTS** - Dictionary of prepared statements to add or\n override. **Careful** with raw queries, use\n `{TABLE_PREFIX}` to re-use configured prefix\n\n * PHPBB3_SESSION_BACKEND - Setting up session backend, it configures the werkzeug cache subsystem\n\n + **TYPE** - Type of the cache, *simple* or *memcached*\n + **SERVERS** - A list/tuple of Memcached servers ('host:pair', ...)\n + **KEY_PREFIX** - Key prefix used with all keys\n\n * **PHPBB3_COOKIE_NAME** - Sets prefix of session cookie names, default is\n phpbb3\\_\n\nExample\n+++++++\n\n.. code:: python\n\n PHPBB3 = {\n 'DRIVER': 'psycopg2',\n }\n PHPBB3_DATABASE = {\n 'DATABASE': 'mydb',\n 'USER': 'myuser',\n }\n\nAPI\n---\n\nUsage of this connector is simple, just create it as any extension\n::\n\n phpbb3 = PhpBB3(app)\n\nAnd in your views just call the apropriate API call:\n\n.. code:: python\n\n @app.route('/my/view')\n def view(...):\n # ...\n latest_posts = phpbb3.fetch_latest_posts()\n # ...\n\n**IMPORTANT:** Use only keyword paramaters!\n\nPredefined prefixes\n-------------------\n\nA prefix of a function can define it's behaviour if declared with SQL query.\n\nget\\_\n+++++\n\nIt will return only one value or None.\n\nfetch\\_\n+++++++\n\nReturns a list. If defining your own functions, do not use OFFSET and LIMIT, it will\nbe appended by the extension.\n\nhas\\_\n+++++\n\nReturns a bool, true or false. Query must return a single value!\n\nCommon keyword arguments\n------------------------\n\nWith all prepared queries, you may use cache (True/False) and cache_ttl arguments to control\nresult caching. TTL is specified in seconds.\n\nList of functions\n-----------------\n\nget_autologin(key)\n++++++++++++++++++\n\nGets autologin information. Used by session integration.\n\nget_session(session_id)\n+++++++++++++++++++++++\n\nGets user session. Usable for integrating with phpBB3 sessions.\n\nRemember to check user id and session id! Currenlty only database session storage is\nsupported.\n\nget_user(user_id)\n+++++++++++++++++\n\nGets user settings and profile.\n\nUse string named interpolation format (the psycopg one) to specify kwargs of a function.\nDo not forget to use {TABLE_PREFIX} variable, to add specific table prefix. (First, the\npython variables from config get evaluated, and then psycopg variables).\n\nhas_membership(user_id, group_id)\n+++++++++++++++++++++++++++++++++\n\nChecks if user belongs to a group.\n\nhas_membership_resolve(user_id, group_name)\n+++++++++++++++++++++++++++++++++++++++++++\n\nSame as has_membership, only it works with group name.\n\nfetch_acl_options()\n+++++++++++++++++++\n\nFetches ACL data. Used by session integration.\n\nget_unread_notifications_count(user_id)\n+++++++++++++++++++\n\nRetrieves user's unread notifications count. Used by session integration.\n\nSessions integration\n--------------------\n\nWhen using this extension, it will install it's own session interface. Also, all properties\nnot present in phpBB3 session, will be stored in session backend.\n\nAnd you can use session's **is_authenticated** property to test if user is authenticated.\n\n.. code:: python\n\n from flask import session\n\n # ...\n\n if session.is_authenticated:\n print 'User is authenticated!'\n\nAvailable is also the following API:\n * is_member(group) - group may be id of the group or name\n * has_privilege(option, forum_id=0) - tests if user has specified privilege\n * has_privileges(*options, forum_id=0) - same as has_privilege, but for multiple privileges\n * get_link_hash(link) - calculates hash\n * num_unread_notifications - number of unread notifications for session user\n\nCaching\n-------\n\nBy default, it configures werkzeug's cache using the configuration set in PHPBB3_SESSION_BACKEND.\nIf you are using Flask-cache extension, you may pass it along when instantiating this extension\nto use the common cache using the keyword parameter **cache**.\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/MasterMind2k/flask-phpbb3", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "Flask-phpBB3", "package_url": "https://pypi.org/project/Flask-phpBB3/", "platform": "", "project_url": "https://pypi.org/project/Flask-phpBB3/", "project_urls": { "Homepage": "https://github.com/MasterMind2k/flask-phpbb3" }, "release_url": "https://pypi.org/project/Flask-phpBB3/0.2.1/", "requires_dist": [ "psycopg2 (>=2.4.5)", "Flask (>=0.10)", "typing" ], "requires_python": "", "summary": "Connector for Flask with phpBB3 board", "version": "0.2.1" }, "last_serial": 5228635, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "5cef7f639ee74ee04c475e01b3989e61", "sha256": "a59d88ba5bcc842ee904baf12014c789e90ff08f466b6053110a9918d1bb01d5" }, "downloads": -1, "filename": "Flask_phpBB3-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5cef7f639ee74ee04c475e01b3989e61", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13364, "upload_time": "2019-05-05T14:46:16", "url": "https://files.pythonhosted.org/packages/ae/fd/9fa10da395bc98e583836b1257b1298688cfe1fe198ebef956f53f839712/Flask_phpBB3-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73d392e5351cc5ee88b2d72605a93b5f", "sha256": "a8351ad86d0fa48c86c03416f45c73e75b7b2dbbdfed35b0fe0cf84aa2596c45" }, "downloads": -1, "filename": "Flask-phpBB3-0.2.1.tar.gz", "has_sig": false, "md5_digest": "73d392e5351cc5ee88b2d72605a93b5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19436, "upload_time": "2019-05-05T14:46:18", "url": "https://files.pythonhosted.org/packages/37/d9/b9e9a39b39210cfc062ff6e40c4cbd9b664776963aaa7fc0a44c5dbfc3c7/Flask-phpBB3-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5cef7f639ee74ee04c475e01b3989e61", "sha256": "a59d88ba5bcc842ee904baf12014c789e90ff08f466b6053110a9918d1bb01d5" }, "downloads": -1, "filename": "Flask_phpBB3-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5cef7f639ee74ee04c475e01b3989e61", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13364, "upload_time": "2019-05-05T14:46:16", "url": "https://files.pythonhosted.org/packages/ae/fd/9fa10da395bc98e583836b1257b1298688cfe1fe198ebef956f53f839712/Flask_phpBB3-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73d392e5351cc5ee88b2d72605a93b5f", "sha256": "a8351ad86d0fa48c86c03416f45c73e75b7b2dbbdfed35b0fe0cf84aa2596c45" }, "downloads": -1, "filename": "Flask-phpBB3-0.2.1.tar.gz", "has_sig": false, "md5_digest": "73d392e5351cc5ee88b2d72605a93b5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19436, "upload_time": "2019-05-05T14:46:18", "url": "https://files.pythonhosted.org/packages/37/d9/b9e9a39b39210cfc062ff6e40c4cbd9b664776963aaa7fc0a44c5dbfc3c7/Flask-phpBB3-0.2.1.tar.gz" } ] }