Metadata-Version: 2.1
Name: vinted_scraper
Version: 1.1.2
Summary: A very simple Python package that scrapes the Vinted website to retrieve information about its items.
Project-URL: Changelog, https://github.com/Giglium/vinted_scraper/releases
Project-URL: Documentation, https://github.com/Giglium/vinted_scraper
Project-URL: Homepage, https://github.com/Giglium/vinted_scraper
Project-URL: Issues, https://github.com/Giglium/vinted_scraper/issues
Project-URL: Source, https://github.com/Giglium/vinted_scraper
Author: Giglium
License: MIT License
        
        Copyright (c) 2023 Migliorin Francesco Antonio
        
        Permission 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:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE 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.
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: beautifulsoup4>=4.12.2
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# Vinted Scraper

[![Package Version](https://img.shields.io/pypi/v/vinted_scraper.svg)](https://pypi.org/project/vinted_scraper/)
[![Python Version](https://img.shields.io/pypi/pyversions/vinted_scraper.svg)](https://pypi.org/project/vinted_scraper/)
[![License](https://img.shields.io/pypi/l/vinted_scraper.svg)](https://github.com/Giglium/vinted_scraper/blob/main/LICENSE)

A very simple Python package that scrapes the Vinted site to retrieve information about its items.

## Installation

You can install Vinted Scraper using pip:

```shell
    pip install vinted_scraper
```

## Usage

The package offers two functions:

1. The `search` function gets all the items present on the listing page
2. The `get_item` function gets more information about an item, and its seller present on the item detail page.

> If you want to parse and manage the scraped data directly you can use the `raw` functions.

Here's the two-way of how to use the package:

### Structured Data

To obtain the scraped data as a `vinted_scraper.VintedItem`, so you can:

```python
import vinted_scraper


def main():
    params = {
        "search_text": "board games"
        # Add other query parameters like the pagination and so on
    }
    items = vinted_scraper.search("https://www.vinted.com/catalog", params)  # get all the items
    item = items[0]  # get the first Item of the list
    vinted_scraper.get_item(item.url)  # get more info about a particular product


if __name__ == "__main__":
    main()
```

> Structured Data are parsed and converted into a `vinted_scraper.VintedItem` object. If some attributes are `None` means
> that it wasn't found in the scrap. Also, I discard some attribute that I thought was useless.

### Raw Data

To obtain the scraped data as a `Dict`, so you can:

```python
import vinted_scraper


def main():
    params = {
        "search_text": "board games"
        # Add other query parameters like the pagination and so on
    }
    items = vinted_scraper.raw_search("https://www.vinted.com/catalog", params)  # get all the items
    item = items[0]  # get the first Item of the list
    vinted_scraper.get_raw_item(item["url"])  # get more info about the item


if __name__ == "__main__":
    main()
```

## License

This project is licensed under the MIT License - see
the [LICENSE](https://github.com/Giglium/vinted_scraper/blob/main/LICENSE) file for details.