# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['shopscraper']

package_data = \
{'': ['*']}

install_requires = \
['pydantic>=1.9.0,<2.0.0', 'requests>=2.27.1,<3.0.0']

setup_kwargs = {
    'name': 'shopscraper',
    'version': '0.0.3',
    'description': 'ShopScraper is a thin python wrapper for Shopify webshop product APIs used to scrape information from online stores.',
    'long_description': '# ShopScraper\n![Python Versions][python-versions-badge]\n\nShopScraper is a thin python wrapper for Shopify webshop product APIs used to scrape information from online stores. Every Shopify webshop has a "hidden" api with access to all of the store\'s products. This python package uses the requests library to grab the product information and return objects representing each product. There are also convenience functions for saving to and reading from a JSON file.\n\n```python\n>>> import shopscraper\n>>>\n>>> products = shopscraper.scrape("bjjfanatics.com", include_html=False, items_per_page=2, max_pages=1)\n>>> type(products)\n<class \'generator\'>\n>>> for product in products:\n>>>    print(product)\nid=6706690981986, \ntitle=\'New Wave Jiu Jitsu: Side Attacks - Building a Devastating Side Control System by John Danaher\'\nhandle=\'new-wave-jiu-jitsu-side-attacks-building-a-devastating-side-control-system-by-john-danaher\',\nbody_html=\'\',\npublished_at=datetime.datetime(2022, 5, 18, 8, 2, 9, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \ncreated_at=datetime.datetime(2022, 5, 4, 23, 14, 55, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \nupdated_at=datetime.datetime(2022, 5, 18, 11, 55, 59, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \nvendor=\'John Danaher\', \nproduct_type=\'COMBO\', \ntags=[\'Facebook\', \'Fighter_John Danaher\', \'MC_Side_Control_Attacks\', \'New\', \'new_and_popular\', \'Show_More_App\'], \nvariants=[\n    Variant(\n        id=39769726582882, \n        title=\'Default Title\', \n        option1=\'Default Title\', \n        option2=None, \n        option3=None, \n        sku=\'JDNWJJSA-01\', \n        requires_shipping=False, \n        taxable=True, \n        featured_image=None, \n        available=True, \n        price=19700, \n        grams=0, \n        compare_at_price=None, \n        position=1, \n        product_id=6706690981986, \n        created_at=datetime.datetime(2022, 5, 4, 23, 14, 55, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \n        updated_at=datetime.datetime(2022, 5, 18, 11, 55, 15, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000)))\n    )\n]\nimages=[\n    Image(\n        id=28542700257378, \n        created_at=datetime.datetime(2022, 5, 4, 23, 14, 55, \n        tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \n        position=1, \n        updated_at=datetime.datetime(2022, 5, 4, 23, 14, 57, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000))), \n        product_id=6706690981986, \n        variant_ids=[], \n        src=\'https://cdn.shopify.com/s/files/1/1800/2299/products/JohnDanaher_NewWaveJiu-Jitsu-SideAttacks_CoverFRONT.jpg?v=1651720497\', \n        width=1631, \n        height=2194\n    ),\n]\noptions=[\n    Options(\n        name=\'Title\', \n        position=1, \n        values=[\'Default Title\']\n    )\n]\n\n\n```\n\n[python-versions-badge]: https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue\n\n## Installation\n\nShopScraper is available on PyPI:\n\n```console\n$ python -m pip install shopscraper\n```\n\nShopScraper officially supports Python 3.7+.\n\n\n# Usage\n\nThe \'scrape\' and \'read_json\' functions yield product objects with lists of Variant, Image, and Options objects.\n\n```python\n\nclass Image:\n    """\n    Attributes:\n        id (int): image id\n        created_at (datetime.datetime): datetime object of when image was created\n        position (int): position of image in product\n        updated_at (datetime.datetime): datetime object of when image was last updated\n        product_id (int): product id associated with the image\n        variant_ids (list[int]): list of variant ids associated with the image\n        src (str): url to image\n        width (int): width of image in pixels\n        height (int): height of image in pixels\n    """\n\nclass Options:\n    """\n    Attributes:\n        name (str): name of option\n        position (int): position of option in product\n        values (list[Any]): list of values for option\n    """\n\n\nclass Variant:\n    """\n    Attributes:\n        id (int): variant id\n        title (str): title of variant\n        option1 (str): first option of variant\n        option2 (str): second option of variant\n        option3 (str): third option of variant\n        sku (Optional[str]): sku of variant\n        requires_shipping (bool): whether variant requires shipping\n        taxable (bool): whether variant is taxable\n        featured_image (Image): featured image of variant\n        price (float): price of variant\n        grams (int): weight of variant in grams\n        compare_at_price (Optional(float)): compare at price of variant\n        position (int): position of variant in product\n        product_id (int): product id associated with the variant\n        created_at (datetime.datetime): datetime object of when variant was created\n        updated_at (datetime.datetime): datetime object of when variant was last updated\n    """\n\n\nclass Product:\n    """\n    Attributes:\n        id (int): product id\n        title (str): name of product\n        handle (str): url safe name of product\n        body_html (str): description of product (html)\n        published_at (datetime.datetime): date product was published\n        created_at (datetime.datetime): date product was created\n        updated_at (datetime.datetime): date product was last updated\n        vendor (str): name of product vendor\n        product_type (str): type of product\n        tags (list[str]): tags associated with product\n        variants (list[Variants]): list of variants for product\n        images (list[Image]): list of images for product\n        options (list[Options]): list of options for product\n    """\n```\n\nThe \'scrape\' function yields product objects:\n```python\n>>> import shopscraper\n>>>\n>>> products = shopscraper.scrape("bjjfanatics.com")\n>>> type(products)\n<class \'generator\'>\n```\n\nThe \'scrape_to_json\' function saves the scraped data to the specified file path:\n```python\n>>> import shopscraper\n>>>\n>>> save_path = shopscraper.scrape_to_json("bjjfanatics.com", "C:\\\\scraped_data.json")\n>>> type(save_path)\n<class \'pathlib.Path\'>\n```\n\nThe \'read_json\' function reads the saved json file and yields Product objects:\n```python\n>>> import shopscraper\n>>>\n>>> products = shopscraper.read_json("C:\\\\scraped_data.json")\n>>> type(products)\n<class \'generator\'>\n```\n\nNote that both functions that provide product objects are generators, which are more memory efficient than lists but can only be iterated over one time. If you want to use the product objects in more than one operation, accumulate them into a list:\n```python\n>>> import shopscraper\n>>>\n>>> products = shopscraper.read_json("C:\\\\scraped_data.json")\n>>> product_list = list(products)\n>>> len(product_list)\n200\n>>> combo_products = [i for i in product_list if i.product_type == "COMBO"]\n>>> len(combo_products)\n10\n```\n\n',
    'author': 'Philistino',
    'author_email': 'fphilistino@protonmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/philistino/shopscraper',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.8,<3.11',
}


setup(**setup_kwargs)
