{ "info": { "author": "Wil Cooley", "author_email": "wcooley@nakedape.cc", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=============\npy2neo_compat\n=============\n\n\n.. image:: https://img.shields.io/pypi/v/py2neo_compat.svg\n :target: https://pypi.python.org/pypi/py2neo_compat\n\n..\n .. image:: https://img.shields.io/travis/wcooley/py2neo_compat.svg\n :target: https://travis-ci.org/wcooley/py2neo_compat\n\n..\n .. image:: https://readthedocs.org/projects/py2neo-compat/badge/?version=latest\n :target: https://py2neo-compat.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n..\n .. image:: https://pyup.io/repos/github/wcooley/py2neo_compat/shield.svg\n :target: https://pyup.io/repos/github/wcooley/py2neo_compat/\n :alt: Updates\n\n\nDescription\n-----------\nA (probably vain) attempt to create a cross-version compatibility layer for\npy2neo_.\n\n\nPurpose\n-------\nEvery major release of py2neo has radically (and gratuitously, it seems)\nchanged the API: package/module organization, name of the database connection\nclass, facilities for working with nodes & relationships -- not to mention\nmore complicated features like interacting with schema.\n\nWhat is implemented here is a hodgepodge of monkey-patches and other hacks\nto make things work between v1.6 and v2.\n\n\nBackground\n----------\nAt work I inherited a codebase developed around py2neo v1.6, and data access\nwas intricately tied with business logic.\nTests were scarce and what tests existed were system tests that did not\naddress errors, boundary conditions, etc., so updating every use of py2neo\nfor a new version would be very risky.\n(Not to mention that I was just learning py2neo & Neo4j.)\n\nMy initial plan was to upgrade to py2neo v2 (current at the time)\nincrementally by monkey-patching & renaming to make v1.6 able to be used as\nif it were v2 and when the code had all been changed to use v2, upgrade to\npy2neo v2.\nAlong the way I had the opportunity to develop a new, stand-alone\napplication, so I started out creating a new dist for the application and\ndeveloping some libraries that could be shared with legacy system, so I\ncreated a separate dist for the shared libraries.\nI did not want to develop the new application with the old v1.6, so my shared\nlibrary would need to support both v1.6 and v2.\nI also started a separate project called gryaml_, to load sample data from\nYAML files, which also needed to support multiple versions in order to be\nrun as test fixtures.\n\n\nFeatures\n--------\n\n* Implementation-independent names, optionally monkey-patched into the\n ``py2neo`` namespace and classes upon call to\n ``py2neo_compat.monkey_patch_py2neo``:\n\n * ``Graph``\n\n * ``Graph.create_unique`` (only single path)\n * ``Graph.cypher.stream``\n * ``Graph.cypher.execute``\n * ``Graph.delete_all``\n * ``Graph.find_one``\n * ``Graph.legacy.delete_index``\n * ``Graph.legacy.get_*index*``\n * ``Graph.resource``\n * ``Graph.uri``\n\n * ``Node``\n\n * ``Node.labels`` property (get-only)\n * ``Node.pull`` method (aliased to ``refresh`` in v1)\n * ``Node.push`` method (aliased to ``refresh`` in v1)\n\n * ``Relationship``\n\n * ``Relationship.push`` method (aliased to ``refresh`` in v1)\n * ``Relationship.pull`` method (aliased to ``refresh`` in v1)\n\n * ``Record``\n * ``node``\n * ``rel``\n * ``ServerError``\n * ``ClientError``\n * ``URI``\n * ``Resource``\n\n * ``py2neo.legacy.LegacyWriteBatch``\n * ``py2neo.legacy.Index``\n * ``py2neo.batch.WriteBatch``\n\n* Custom wrapper functions, which are not monkey-patched:\n\n * ``py2neo_compat``\n\n * ``graph_metadata``\n * ``create_node``\n * ``py2neo_entity_to_dict`` aka ``to_dict``: Dump the properties of a\n node or relationship as a ``dict``.\n\n * ``schema``:\n\n * ``schema_constraints`` - Yields tuples of schema constraints for\n *all* constraints (not just ones in use).\n * ``schema_indexes`` - Yields tuples of schema indexes for *all*\n indexes (not just ones in use).\n * ``drop_schema``\n * ``drop_constraints``\n * ``drop_indexes``\n * ``create_schema``\n\n\n* Known limitations:\n\n * py2neo v1.6 will not create labels with an abstract ``Node``.\n * There is no common way to modify labels after node creation; v1 uses\n special methods to manipulate the labels, whereas v2 uses a a subclass\n of ``set``. The easy way would be to add the v1 methods to v2, but I\n am trying to avoid propagating the v1 API; the harder way would be to\n implement a set-like class for v1, but considerably more work. Another\n alternative is a compatibility function, which ends up being another\n API. I have not really needed to manipulate labels after creation.\n\n* Free software: Apache Software License 2.0\n\n.. * Documentation: https://py2neo-compat.readthedocs.io.\n TBD\n\n\nFuture\n------\n\nFor future development, I am considering several options:\n\n* Attempt to do just enough to support v3 and ignore v4.\n* Ignore v3 and reimplement the features I need on v4.\n* Ignore v3 and v4 altogether and build what I need on v2 and the\n `Bolt-only Python driver`_.\n\nApproaches other than monkey-patching:\n\n* Instead of monkey-patching, subclass or wrap the appropriate classes\n and re-implement the differing bits. Clients would import directly from the\n ``py2neo_compat`` package, rather than importing, calling the monkey-patch\n function and then importing from ``py2neo``.\n* Adopt a function-based approach, where the receiver is an explicit parameter\n instead of having methods. This can get redundant, since the type of the\n primary receiver ends up being embedded in the name.\n\nThis would might work better for Nodes and Relationships and the basic\nGraph features than the schema, batch and legacy index support.\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _py2neo: http://py2neo.org\n.. _gryaml: https://github.com/wcooley/python-gryaml\n.. _`Bolt-only Python driver`: https://neo4j.com/docs/api/python-driver/current/\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n1.0.1 (2018-08-02)\n------------------\n\n* Restrict to only supported py2neo versions with environment-based override for\n testing with later versions.\n\n1.0.0 (2018-08-01)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wcooley/py2neo_compat", "keywords": "py2neo_compat py2neo compat neo4j", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "py2neo-compat", "package_url": "https://pypi.org/project/py2neo-compat/", "platform": "", "project_url": "https://pypi.org/project/py2neo-compat/", "project_urls": { "Homepage": "https://github.com/wcooley/py2neo_compat" }, "release_url": "https://pypi.org/project/py2neo-compat/1.0.1/", "requires_dist": [ "boltons", "py2neo (<=2.999,>=1.6)", "six", "typing", "coverage; extra == 'test'", "pytest (>=3.3.0); extra == 'test'", "pytest-cov; extra == 'test'", "pytest-forked; extra == 'test'", "pytest-mock; extra == 'test'" ], "requires_python": "", "summary": "Compatibility layer for py2neo", "version": "1.0.1" }, "last_serial": 4126849, "releases": { "1.0.0": [ { "comment_text": "Initial release", "digests": { "md5": "70c4145b241d0f83dea683b78abf5f94", "sha256": "e0e40b6c7b9399f2b746672b00a3d1defcb15ce7d7affb27d725826c0e0b4721" }, "downloads": -1, "filename": "py2neo_compat-1.0.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "70c4145b241d0f83dea683b78abf5f94", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11883, "upload_time": "2018-08-01T23:41:41", "url": "https://files.pythonhosted.org/packages/0d/97/8321f37c3e31ff655c75ea14e46866c510eede66f652aede134cab8d30bd/py2neo_compat-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "Initial release", "digests": { "md5": "27920a843ca7d996cb3b0c29742789f0", "sha256": "4d9ba6d312be2f6dc6f48b85278da457b94b1a5fb0593061043af080720fc542" }, "downloads": -1, "filename": "py2neo_compat-1.0.0.tar.gz", "has_sig": true, "md5_digest": "27920a843ca7d996cb3b0c29742789f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33142, "upload_time": "2018-08-01T23:42:04", "url": "https://files.pythonhosted.org/packages/a5/84/cc47ed7f0b6ebdcc1eea39b15656ab8f2405d237173ce30f3eedd49b8e76/py2neo_compat-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "3f10fa49101ecbce2af961cce682ef11", "sha256": "34c6725d86f2ea456ec360ed9942a76ba39b65e95673e9cf66603d5b16cc84ab" }, "downloads": -1, "filename": "py2neo_compat-1.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3f10fa49101ecbce2af961cce682ef11", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11955, "upload_time": "2018-08-02T00:25:32", "url": "https://files.pythonhosted.org/packages/f3/18/702f11cb4475d1bafc3e577763057a63de3ef6035290aa5a6650f37b21e2/py2neo_compat-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fe24ad480989329a25ac6d8379fdc75", "sha256": "6c6f25a8fe4edd0e0df0da38d89a846a894033c395208007d70c1a3ccae92270" }, "downloads": -1, "filename": "py2neo_compat-1.0.1.tar.gz", "has_sig": true, "md5_digest": "0fe24ad480989329a25ac6d8379fdc75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33387, "upload_time": "2018-08-02T00:25:34", "url": "https://files.pythonhosted.org/packages/92/25/46a321091e74b275400b089f5e8e1a15633a6445ef363c442ebbc1812d6b/py2neo_compat-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f10fa49101ecbce2af961cce682ef11", "sha256": "34c6725d86f2ea456ec360ed9942a76ba39b65e95673e9cf66603d5b16cc84ab" }, "downloads": -1, "filename": "py2neo_compat-1.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3f10fa49101ecbce2af961cce682ef11", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11955, "upload_time": "2018-08-02T00:25:32", "url": "https://files.pythonhosted.org/packages/f3/18/702f11cb4475d1bafc3e577763057a63de3ef6035290aa5a6650f37b21e2/py2neo_compat-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fe24ad480989329a25ac6d8379fdc75", "sha256": "6c6f25a8fe4edd0e0df0da38d89a846a894033c395208007d70c1a3ccae92270" }, "downloads": -1, "filename": "py2neo_compat-1.0.1.tar.gz", "has_sig": true, "md5_digest": "0fe24ad480989329a25ac6d8379fdc75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33387, "upload_time": "2018-08-02T00:25:34", "url": "https://files.pythonhosted.org/packages/92/25/46a321091e74b275400b089f5e8e1a15633a6445ef363c442ebbc1812d6b/py2neo_compat-1.0.1.tar.gz" } ] }