{ "info": { "author": "Scrapinghub", "author_email": "info@scrapinghub.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "====================\nscrapy-splitvariants\n====================\n\n.. image:: https://travis-ci.org/scrapy-plugins/scrapy-splitvariants.svg?branch=master\n :target: https://travis-ci.org/scrapy-plugins/scrapy-splitvariants\n\n.. image:: https://codecov.io/gh/scrapy-plugins/scrapy-splitvariants/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/scrapy-plugins/scrapy-splitvariants\n\n\n``SplitVariantsMiddleware`` is a Scrapy spider middleware used to split\nsingle items into multiple items when they have a \"variants\" key with multiple values.\n\n\nExample usage\n=============\n\nLet's assume your spider outputs an item with different size options\n(from an ecommerce website for example)::\n\n item = {\"id\": 12,\n \"name\": \"Big chair\",\n \"variants\": [{\"size\": \"XL\", \"price\": 200, \"currency\": \"USD\"},\n {\"size\": \"L\", \"price\": 100, \"currency\": \"USD\"}]}\n\nWhen you enable ``SplitVariantsMiddleware``, this single item will become\n2 items with the different variants values into a different item::\n\n {\"id\": 12, \"name\": \"Big chair\", \"size\": \"XL\", \"price\": 200, \"currency\": \"USD\"}\n {\"id\": 12, \"name\": \"Big chair\", \"size\": \"L\", \"price\": 100, \"currency\": \"USD\"}\n\n\nInstallation\n============\n\nInstall scrapy-splitvariants using ``pip``::\n\n $ pip install scrapy-splitvariants\n\n\nConfiguration\n=============\n\n1. Add ``SplitVariantsMiddleware`` by including it in ``SPIDER_MIDDLEWARES``\n in your ``settings.py`` file::\n\n SPIDER_MIDDLEWARES = {\n 'scrapy_splitvariants.SplitVariantsMiddleware': 100,\n }\n\n Here, priority ``100`` is just an example.\n Set its value depending on other middlewares you may have enabled already.\n\n2. Enable the middleware using ``SPLITVARIANTS_ENABLED`` set to ``True``\n in your ``setting.py``.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/scrapy-plugins/scrapy-splitvariants", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "scrapy-splitvariants", "package_url": "https://pypi.org/project/scrapy-splitvariants/", "platform": "Any", "project_url": "https://pypi.org/project/scrapy-splitvariants/", "project_urls": { "Homepage": "http://github.com/scrapy-plugins/scrapy-splitvariants" }, "release_url": "https://pypi.org/project/scrapy-splitvariants/1.1.0/", "requires_dist": [ "scrapy (>=1.0)" ], "requires_python": "", "summary": "Scrapy spider middleware to split an item into multiple items on a multi-valued key", "version": "1.1.0" }, "last_serial": 2228810, "releases": { "0.1.0": [], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ff938535643a4f0f3485952f6cd919d3", "sha256": "28e12fca8e526a59a8a9d84df2c2f5066590a3313106905e3e95185504f8274b" }, "downloads": -1, "filename": "scrapy_splitvariants-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ff938535643a4f0f3485952f6cd919d3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3066, "upload_time": "2016-07-18T16:37:58", "url": "https://files.pythonhosted.org/packages/7e/79/be3e50779d85c3bae05418428cad7dda0f7f4dd54754e14462e856f2efe4/scrapy_splitvariants-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9ff0c1d9c29cf805a381b2258ef437f", "sha256": "d86c2a0373d97f9bc40062624a661326ee65621f2ad015cfbf75bf01452b7564" }, "downloads": -1, "filename": "scrapy-splitvariants-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d9ff0c1d9c29cf805a381b2258ef437f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2062, "upload_time": "2016-07-18T16:38:00", "url": "https://files.pythonhosted.org/packages/f2/fe/1f4402a8a929b5392f8fd3dbbefbb89a174e8d05afe272d44dae3f66eb3b/scrapy-splitvariants-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "f0ea6737148ae0e8b3834d648f6c96fe", "sha256": "da425cdaa03101406f076bd9600429d997ed395288e47bd4032e0a0b23d9f478" }, "downloads": -1, "filename": "scrapy_splitvariants-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f0ea6737148ae0e8b3834d648f6c96fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3093, "upload_time": "2016-07-18T17:40:17", "url": "https://files.pythonhosted.org/packages/33/fd/b5a0d2d0c8a4ba9636c09f6d47cc5d1ef56561a076c5f9aae89b6e5b68f2/scrapy_splitvariants-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "82879a91f37d2b0d4590668b9846d207", "sha256": "43f393f0380e59e0f8a80771102054f6a9660c5e8cb0f716c517c07b6e2bfdcd" }, "downloads": -1, "filename": "scrapy-splitvariants-1.1.0.tar.gz", "has_sig": false, "md5_digest": "82879a91f37d2b0d4590668b9846d207", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2082, "upload_time": "2016-07-18T17:40:20", "url": "https://files.pythonhosted.org/packages/ec/8c/457f1f79de762e2afa8f8cfd163744edd3b586c17b7556eaef9586ffed5d/scrapy-splitvariants-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0ea6737148ae0e8b3834d648f6c96fe", "sha256": "da425cdaa03101406f076bd9600429d997ed395288e47bd4032e0a0b23d9f478" }, "downloads": -1, "filename": "scrapy_splitvariants-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f0ea6737148ae0e8b3834d648f6c96fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3093, "upload_time": "2016-07-18T17:40:17", "url": "https://files.pythonhosted.org/packages/33/fd/b5a0d2d0c8a4ba9636c09f6d47cc5d1ef56561a076c5f9aae89b6e5b68f2/scrapy_splitvariants-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "82879a91f37d2b0d4590668b9846d207", "sha256": "43f393f0380e59e0f8a80771102054f6a9660c5e8cb0f716c517c07b6e2bfdcd" }, "downloads": -1, "filename": "scrapy-splitvariants-1.1.0.tar.gz", "has_sig": false, "md5_digest": "82879a91f37d2b0d4590668b9846d207", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2082, "upload_time": "2016-07-18T17:40:20", "url": "https://files.pythonhosted.org/packages/ec/8c/457f1f79de762e2afa8f8cfd163744edd3b586c17b7556eaef9586ffed5d/scrapy-splitvariants-1.1.0.tar.gz" } ] }