{"id":16223700,"url":"https://github.com/lykmapipo/producthunt-python-scrapy-scraper","last_synced_at":"2025-04-08T01:45:40.026Z","repository":{"id":204454987,"uuid":"709269465","full_name":"lykmapipo/ProductHunt-Python-Scrapy-Scraper","owner":"lykmapipo","description":"Python Scrapy spiders that scrapes data from producthunt.com","archived":false,"fork":false,"pushed_at":"2023-11-05T07:45:55.000Z","size":83,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T17:53:18.612Z","etag":null,"topics":["crawler","featured","launch","lykmapipo","product","producthunt","python","scraper","scrapy","spider","webscraper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lykmapipo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-24T11:30:42.000Z","updated_at":"2025-01-20T20:47:37.000Z","dependencies_parsed_at":"2024-11-04T00:23:26.042Z","dependency_job_id":"50354ea1-8762-4d54-a3c6-b1a28fd5fa6f","html_url":"https://github.com/lykmapipo/ProductHunt-Python-Scrapy-Scraper","commit_stats":null,"previous_names":["lykmapipo/producthunt-python-scrapy-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lykmapipo%2FProductHunt-Python-Scrapy-Scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lykmapipo%2FProductHunt-Python-Scrapy-Scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lykmapipo%2FProductHunt-Python-Scrapy-Scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lykmapipo%2FProductHunt-Python-Scrapy-Scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lykmapipo","download_url":"https://codeload.github.com/lykmapipo/ProductHunt-Python-Scrapy-Scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761030,"owners_count":20991533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawler","featured","launch","lykmapipo","product","producthunt","python","scraper","scrapy","spider","webscraper"],"created_at":"2024-10-10T12:19:47.859Z","updated_at":"2025-04-08T01:45:40.002Z","avatar_url":"https://github.com/lykmapipo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProductHunt-Python-Scrapy-Scraper\n\nPython [Scrapy](https://github.com/scrapy/scrapy) spiders that scrapes [products](#product) and [launches](#launch) data from [producthunt.com](https://www.producthunt.com).\n\n## Features\n- Item [schema](https://github.com/lykmapipo/ProductHunt-Python-Scrapy-Scraper/blob/main/producthunt_scraper/items.py) for `trending products` and `featured product launches` defined using `dataclass`\n- Item [pipelines](https://github.com/lykmapipo/ProductHunt-Python-Scrapy-Scraper/blob/main/producthunt_scraper/pipelines.py) to `normalize`, `validate` and `drop` duplicate items.\n- [Download middlewares](https://github.com/lykmapipo/ProductHunt-Python-Scrapy-Scraper/blob/main/producthunt_scraper/middlewares.py) to random user agents.\n\n## Requirements\n\n- [Python 3.8+](https://www.python.org/)\n- [pip 23.3+](https://github.com/pypa/pip)\n- [Scrapy 2.11+](https://github.com/scrapy/scrapy)\n\n## Usage\n\n- Clone this repository\n\n- Install all dependencies\n\n```sh\npip install -e .\n```\n\n- To scrape `featured product launches`, run:\n\n```sh\nscrapy crawl featured-product-launches\n```\n\n- To scrape `trending products`, run:\n\n```sh\nscrapy crawl trending-products\n```\n\n## Data Exploration\nThe scraped data is saved in [`jsonline`](https://jsonlines.org/) format and may be found at `./data/\u003cspider-name\u003e/date=\u003cscraped-date\u003e`. Where `spider-name` is a name of the spider e.g `featured-product-launches` and `scraped-date` is the date when the spider was runned.\n\nExample, for `featured-product-launches` spider runned on `2023-10-24`, then the data may be found at `./data/featured-product-launches/date=2023-10-24`.\n\n- Explore part of the data using `pandas`, use:\n```python\nimport pandas as pd\n\n# replace the date part with your scraping date\n# file = \"./data/trending-products/date=2023-10-24/part-1.jsonl\"\nfile = \"./data/featured-product-launches/date=2023-10-24/part-1.jsonl\"\ndf = pd.read_json(file, lines=True)\n\ndf.info()\n```\n\n- To explore all the data using `pandas`, use:\n```python\nimport glob\nimport pandas as pd\n\n# replace the date part with your scraping date\n# files = glob.glob(\"./data/trending-products/date=2023-10-24/*.jsonl\")\nfiles = glob.glob(\"./data/featured-product-launches/date=2023-10-24/*.jsonl\")\ndfs = [pd.read_json(file, lines=True) for file in files]\ndf = pd.concat(dfs, ignore_index=True)\n\ndf.info()\n```\n\n## Contribute\n\nIt will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.\n\n## Questions/Contacts\n\nlallyelias87@gmail.com, or open a GitHub issue\n\n\n## Schema\n\n### Launch\n\nThe `featured-product-launches` spider extract the following ``launch`` fields from featured product launches pages:\n\n```python\n@dataclass\nclass ProductLaunchItem:\n    launch_id: Optional[str] = field(default=None)\n    launch_slug: Optional[str] = field(default=None)\n    launch_name: Optional[str] = field(default=None)\n    launch_tagline: Optional[str] = field(default=None)\n    launch_description: Optional[str] = field(default=None)\n    launch_url: Optional[str] = field(default=None)\n    launch_votes_count: Optional[int] = field(default=None)\n    launch_comments_count: Optional[int] = field(default=None)\n    launch_daily_rank: Optional[int] = field(default=None)\n    launch_weekly_rank: Optional[int] = field(default=None)\n    launch_created_at: Optional[str] = field(default=None)\n    launch_featured_at: Optional[str] = field(default=None)\n    launch_updated_at: Optional[str] = field(default=None)\n    launch_topics: Optional[List[str]] = field(default=None)\n    product_id: Optional[str] = field(default=None)\n    product_name: Optional[str] = field(default=None)\n    product_url: Optional[str] = field(default=None)\n```\n\n### Product\n\nThe `trending-products` spider extract the following ``product`` fields from trending product pages:\n\n```python\n@dataclass\nclass ProductItem:\n    product_id: Optional[str] = field(default=None)\n    product_slug: Optional[str] = field(default=None)\n    product_name: Optional[str] = field(default=None)\n    product_tagline: Optional[str] = field(default=None)\n    product_description: Optional[str] = field(default=None)\n    product_url: Optional[str] = field(default=None)\n    product_website_url: Optional[str] = field(default=None)\n    product_rating: Optional[float] = field(default=None)\n    product_followers_count: Optional[int] = field(default=None)\n    product_total_votes_count: Optional[int] = field(default=None)\n    product_reviewers_count: Optional[int] = field(default=None)\n    product_reviews_count: Optional[int] = field(default=None)\n    product_posts_count: Optional[int] = field(default=None)\n    product_stacks_count: Optional[int] = field(default=None)\n    product_alternatives_count: Optional[int] = field(default=None)\n    product_tips_count: Optional[int] = field(default=None)\n    product_addons_count: Optional[int] = field(default=None)\n    product_platforms: Optional[List[str]] = field(default=None)\n    product_categories: Optional[List[str]] = field(default=None)\n    product_topics: Optional[List[str]] = field(default=None)\n```\n\n## Licence\n\nThe MIT License (MIT)\n\nCopyright (c) lykmapipo \u0026 Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flykmapipo%2Fproducthunt-python-scrapy-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flykmapipo%2Fproducthunt-python-scrapy-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flykmapipo%2Fproducthunt-python-scrapy-scraper/lists"}