{ "info": { "author": "Stuart Owen", "author_email": "stuart.owen@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "====\nJOIN\n====\nSQL-style joins for Python iterables. \n\n.. image:: https://travis-ci.org/StuartAxelOwen/join.svg?branch=master\n :target: https://travis-ci.org/StuartAxelOwen/join\n\n.. code-block:: python\n\n >>> from join import join, merge, tuple_join\n >>> dogs = [\n ... Dog('gatsby', 'Rruff!', 16),\n ... Dog('ein', 'wruf!', 9),\n ... ]\n >>> cats = [\n ... Cat('pleo', 'mreeeoww', 16),\n ... Cat('xena', 'mreow', 12),\n ... Cat('gatsby', 'rowr', 15),\n ... ]\n >>> catdogs = merge(cats, dogs, key='name')\n >>> catdogs\n [CatDog({'right': Dog(name='gatsby', woof='Rruff!', weight=16), 'name': 'gatsby', 'weight': 15, 'meow': 'rowr', 'woof': 'Rruff!', 'left': Cat(name='gatsby', meow='rowr', weight=15)})]\n >>> catdogs[0].meow\n 'rowr'\n >>> catdogs[0].woof\n 'Rruff!'\n\nInstallation\n------------\nInstall using pip:\n\n``pip install join``\n\nUse\n---\n\n``join`` does the work of associating iterable items together, but gives you all the power for customization, letting you supply your own join function, separate keys for left and right iterables, and even letting you use functions instead of attribute names.\n\n``merge`` used above, for example, is ``join`` using an object union to join matched objects. You can use a tuple join, which is default for ``join``:\n\n.. code-block:: python\n\n >>> join(cats, dogs, key='name', join_fn=tuple_join)\n [(Cat(name='gatsby', meow='rowr', weight=15), Dog(name='gatsby', woof='Rruff!', weight=16))]\n\nSupplying your own join function is easy:\n\n.. code-block:: python\n\n >>> def weight_sum(left, right):\n ... return left.weight + right.weight\n ...\n >>> join(cats, dogs, key='name', join_fn=weight_sum)\n [31]\n\nUsing separate key functions is easy too:\n\n.. code-block:: python\n\n >>> def cat_key(cat):\n ... return cat.weight % 3 == 0 # weight divisible by 3\n ... \n >>> def dog_key(dog):\n ... return dog.weight % 4 == 0 # weight divisible by 4\n ... \n >>> def name_join(left, right):\n ... return left.name + '-' + right.name\n ... \n >>> join(cats, dogs, left_key=cat_key, right_key=dog_key, join_fn=name_join)\n ['pleo-ein', 'xena-gatsby', 'gatsby-gatsby']\n\nContributing\n------------\n\nPull requests and issues welcome! Run tests from project root with ``sh run_tests.sh``.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/StuartAxelOwen/join/archive/0.1.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/StuartAxelOwen/join", "keywords": "join,joins,merge,merges,list join,iterable join", "license": "Copyright (c) 2015 Stuart Owen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "join", "package_url": "https://pypi.org/project/join/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/join/", "project_urls": { "Download": "https://github.com/StuartAxelOwen/join/archive/0.1.zip", "Homepage": "https://github.com/StuartAxelOwen/join" }, "release_url": "https://pypi.org/project/join/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "SQL-style joins for iterables.", "version": "0.1.1" }, "last_serial": 1555426, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c6ed42fc388c9a723f8f1a5befd834d0", "sha256": "dc8ac5208e772839b85dd70c8efce0035e913e2c5f2da87d7060d6d63d282b36" }, "downloads": -1, "filename": "join-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c6ed42fc388c9a723f8f1a5befd834d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2609, "upload_time": "2015-04-28T06:12:39", "url": "https://files.pythonhosted.org/packages/15/74/4e83e70b7199f0718c295854c89ad1e6207431e180328e5d1ca768c9df86/join-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "48a8182da0c1f2944f6f4ef9698b427f", "sha256": "fc2d62e427e9b41edf9948d5b744dce69a526bee5a29e170775ba5a93803fdc2" }, "downloads": -1, "filename": "join-0.0.2.tar.gz", "has_sig": false, "md5_digest": "48a8182da0c1f2944f6f4ef9698b427f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4075, "upload_time": "2015-05-03T00:44:28", "url": "https://files.pythonhosted.org/packages/c7/bf/b60ac1e21c942c1544a52e1a4d8efdaa81fcb3b1f8104fb956c07d3dcb8c/join-0.0.2.tar.gz" } ], "0.1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0647c6021246f646c83afdeff670c6c7", "sha256": "7fea9c9ef2832f7f1cef9d72bbb2806f895fd4e877b714347a1700cb8ed7d06e" }, "downloads": -1, "filename": "join-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0647c6021246f646c83afdeff670c6c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4967, "upload_time": "2015-05-08T06:21:07", "url": "https://files.pythonhosted.org/packages/41/27/7f7d87594c516fe823bf05e545b661b20be448ae60e08e4a01d1f5fb5144/join-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1216b6dc20b2c32f9d11bfc9749633ad", "sha256": "eb5889f72a0e74c0b12325fd14f6daff3f619a7544fc67e2aa14ce2cbc6aa07d" }, "downloads": -1, "filename": "join-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1216b6dc20b2c32f9d11bfc9749633ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5370, "upload_time": "2015-05-20T19:16:55", "url": "https://files.pythonhosted.org/packages/43/91/a4e490adad247d275b5b1e18e2628805dbd8fae868d021a7bd3bc0833022/join-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1216b6dc20b2c32f9d11bfc9749633ad", "sha256": "eb5889f72a0e74c0b12325fd14f6daff3f619a7544fc67e2aa14ce2cbc6aa07d" }, "downloads": -1, "filename": "join-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1216b6dc20b2c32f9d11bfc9749633ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5370, "upload_time": "2015-05-20T19:16:55", "url": "https://files.pythonhosted.org/packages/43/91/a4e490adad247d275b5b1e18e2628805dbd8fae868d021a7bd3bc0833022/join-0.1.1.tar.gz" } ] }