Metadata-Version: 2.1
Name: fakepilot
Version: 0.0.1
Summary: Scrapping tool for Trustpilot
License: MIT License
        
        Copyright (c) 2024 Carlos Romero Cruz
        
        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.
        
Project-URL: repository, https://github.com/phoenixsite/fakepilot
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4
Requires-Dist: lxml

# Fakepilot
[Trustpilot](https://www.trustpilot.com/) scrapping Python package.
Extract online business reviews and integrate it on your code.
It is based on [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/).

## Setup

1. Clone the repository or download the zip package

```
git clone https://github.com/phoenixsite/fakepilot.git
```

2. Install the package with `pip`. This will also install its dependencies.

``` sh
cd fakepilot
pip install .
```

## Usage
The function `search` can be used to mimic the search bar functionality
of Trustpilot. It limits the number of results and you can
indicate whether some reviews should be extracted for each company result.
For example, the following code search for two companies that match
the expression 'starbucks' and two of its reviews.

``` python
import fakepilot as fp
fp.search("starbucks", 2, with_reviews=True, nreviews=2)
```

All the Trustpilot country-specific sites can be used to make the queries.
For instance, the Norwegian Trustpilot site can be used:

``` python
fp.search("starbucks", 1, "norge")
```

If it is required that all the results include a specific parameter, e.g.
the phone number of the company, you can specify
in the `search` function:

```python
fp.search("starbucks", 1, "norge",
		       with_reviews=False, nreviews=1, required_attrs="phone")
```

Also, the reviews of a Trustpilot company page can be directly extracted
using `extract_reviews``from a given URL or a local file.
The following block extracts ten reviews from the
specified page:

```python
get_reviews("https://www.trustpilot.com/review/www.starbucks.com", 10)
```

## Documentation
For a detail description of all the options, you can build yourself the documentation
in ``docs`` with [Sphinx](https://www.sphinx-doc.org/en/master/) or visit the
[faekpilot documentation page](https://fakepilot.readthedocs.io).

## Warning
I strongly recomment using this scrapper with moderation and carefully.
Searching for multiple expressions in a short period of time can generate
a lot of requests and connections to the Trustpilot servers and may affect the
operation of the website. **Be careful, respectful and responsible with
scrappers online**.
