{ "info": { "author": "Coalesco Digital Systems Inc. - Mark Shane Hayden", "author_email": "mhayden@coalesco.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 3", "Topic :: Communications", "Topic :: Software Development :: Libraries" ], "description": "activipy_pgsql\n==============\n\nAn activipy environment to use PostgreSQL as the data store for ActivityStream\nobjects.\n\n----\n\nThe `activipy module `_ enables the\nuse of `ActivityStreams `_ in\nyour applications and includes the support of different \"environments\" to\nextend functionality.\n\nThis package provides a \"pgsql\" environment that maps storage methods to\nPostgreSQL queries using psycopg2. Object data is stored using the jsonb\ndata type to simplify the schema and provide maximum performance.\n\nExample Code\n------------\n\nOpen a database::\n\n >>> from activipy import core, vocab\n >>> from activipy.pgsql import pgsql\n >>> db = pgsql.JsonPgSQL.open(\n ... host=\"\", dbname=\"\",\n ... user=\"\", password=\"\")\n >>> env = pgsql.PgSQLNormalizedEnv\n\nCreate a new record and save to database::\n\n >>> post_this = core.ASObj({\n ... \"@type\": \"Create\",\n ... \"@id\": \"http://tsyesika.co.uk/act/foo-id-here/\",\n ... \"actor\": {\n ... \"@type\": \"Person\",\n ... \"@id\": \"https://tsyesika.co.uk/\",\n ... \"displayName\": \"Jessica Tallon\"},\n ... \"to\": [\"acct:cwebber@identi.ca\",\n ... \"acct:justaguy@rhiaro.co.uk\",\n ... \"acct:ladyaeva@hedgehog.example\"],\n ... \"object\": {\n ... \"@type\": \"Note\",\n ... \"@id\": \"https://tsyesika.co.uk/chat/sup-yo/\",\n ... \"content\": \"Up for some root beer floats?\"}},\n ... pgsql.PgSQLNormalizedEnv)\n >>> post_this.m.save(db)\n {'@type': 'Create',\n '@id': 'http://tsyesika.co.uk/act/foo-id-here/',\n 'actor': 'https://tsyesika.co.uk/',\n 'to': ['acct:cwebber@identi.ca',\n 'acct:justaguy@rhiaro.co.uk',\n 'acct:ladyaeva@hedgehog.example'],\n 'object': 'https://tsyesika.co.uk/chat/sup-yo/'}\n\nNote how in this example the record has been normalized. In this environment\nthe actor and object are created in separate records and made into references\nin the parent record. To retrieve the original denormalized form::\n\n >>> normalized_post = pgsql.pgsql_fetch(\n ... \"http://tsyesika.co.uk/act/foo-id-here/\", db, env)\n >>> normalized_post.m.denormalize(db)\n \n >>> normalized_post.m.denormalize(db).json()\n {'to': ['acct:cwebber@identi.ca',\n 'acct:justaguy@rhiaro.co.uk',\n 'acct:ladyaeva@hedgehog.example'],\n '@id': 'http://tsyesika.co.uk/act/foo-id-here/',\n '@type': 'Create',\n 'actor': {'@id': 'https://tsyesika.co.uk/',\n '@type': 'Person',\n 'displayName': 'Jessica Tallon'},\n 'object': {'@id':\n 'https://tsyesika.co.uk/chat/sup-yo/',\n '@type': 'Note',\n 'content': 'Up for some root beer floats?}}\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://src.coalesco.ca/w3c-social/activipy_pgsql", "keywords": "activitystream postgresql environment", "license": "Apache Software License 2.0, GPLv3+", "maintainer": "", "maintainer_email": "", "name": "activipy-pgsql", "package_url": "https://pypi.org/project/activipy-pgsql/", "platform": "", "project_url": "https://pypi.org/project/activipy-pgsql/", "project_urls": { "Homepage": "https://src.coalesco.ca/w3c-social/activipy_pgsql" }, "release_url": "https://pypi.org/project/activipy-pgsql/0.1.0/", "requires_dist": [ "activipy", "psycopg2", "check-manifest; extra == 'dev'", "coverage; extra == 'test'" ], "requires_python": "", "summary": "A PostgreSQL Environment for Activipy", "version": "0.1.0" }, "last_serial": 3419034, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "dcab6617278fa59a946b29fc7e4382ea", "sha256": "fa9bd4f214fb69a36c310fc87ed503ffdc7db2a31406ffc6a4024fc5314741ce" }, "downloads": -1, "filename": "activipy_pgsql-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcab6617278fa59a946b29fc7e4382ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7857, "upload_time": "2017-12-15T07:01:45", "url": "https://files.pythonhosted.org/packages/4d/32/3c0e354087ce60ab671a173e1980e25304a4fb63989f6ada48c7ac0e9cc9/activipy_pgsql-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9e3543395df7f9d06f3794de3a5ceda", "sha256": "66ae6a68cb40aa07a7903291481de8c8a7fac37e88b3f9c8f072857ba0d8d9c5" }, "downloads": -1, "filename": "activipy-pgsql-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c9e3543395df7f9d06f3794de3a5ceda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22381, "upload_time": "2017-12-15T07:01:47", "url": "https://files.pythonhosted.org/packages/74/64/b20b983aff690556c0e87d6f06c2faa2eb1ea5de234110a7412f13775eb3/activipy-pgsql-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcab6617278fa59a946b29fc7e4382ea", "sha256": "fa9bd4f214fb69a36c310fc87ed503ffdc7db2a31406ffc6a4024fc5314741ce" }, "downloads": -1, "filename": "activipy_pgsql-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcab6617278fa59a946b29fc7e4382ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7857, "upload_time": "2017-12-15T07:01:45", "url": "https://files.pythonhosted.org/packages/4d/32/3c0e354087ce60ab671a173e1980e25304a4fb63989f6ada48c7ac0e9cc9/activipy_pgsql-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9e3543395df7f9d06f3794de3a5ceda", "sha256": "66ae6a68cb40aa07a7903291481de8c8a7fac37e88b3f9c8f072857ba0d8d9c5" }, "downloads": -1, "filename": "activipy-pgsql-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c9e3543395df7f9d06f3794de3a5ceda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22381, "upload_time": "2017-12-15T07:01:47", "url": "https://files.pythonhosted.org/packages/74/64/b20b983aff690556c0e87d6f06c2faa2eb1ea5de234110a7412f13775eb3/activipy-pgsql-0.1.0.tar.gz" } ] }