Intelligent Market Monitoring
Project description
vianu-fraudcrawler
Intelligent Market Monitoring
The pipeline for monitoring the market has the folling main steps:
- search for a given term using SerpAPI
- get product information using ZyteAPI
- assess relevance of the found products using an OpenAI API
Installation
python3.11 -m venv .venv
source .venv/bin/activate
pip install vianu-fraudcrawler
Usage
.env file
Make sure to create an .env file with the necessary API keys and credentials (c.f. .env.example file).
Run demo pipeline
python -m fraudcrawler.launch_demo_pipeline
Customize the pipeline
Start by initializing the client
from fraudcrawler import FraudCrawlerClient
# Initialize the client
client = FraudCrawlerClient()
For setting up the search we need 5 main objects
search_term: The search term for the query.location: The SerpAPI location used for the query.deepness: Defines the search depth.context: The context prompt to use for detecting relevant products
from fraudcrawler import Location, Deepness
# Setup the search
search_term = "sildenafil"
location = Location(name="Switzerland")
deepness = Deepness(num_results=50)
context = "This organization is interested in medical products and drugs."
(Optional) Add search term enrichement. This will find related search terms (in a given language) and search for these as well.
from fraudcrawler import Enrichment
deepness.enrichement = Enrichment(
language=Language(name="German")
additional_terms=5,
additional_urls_per_term=5
)
(Optional) Add marketplaces where we explicitely want to look for (this will focus your search as the :site parameter for a google search)
from fraudcrawler import Host,
marketplaces = [
Host(name="Ricardo", domains="ricardo.ch"),
Host(name="Galaxus", domains="digitec.ch, galaxus.ch")
]
(Optional) Exclude urls (where you don't want to find products)
excluded_urls = [
Host(name="Altibbi", domains="altibbi.com")
]
And finally run the search
# Run the search
client.run(
search_term=search_term,
location=location,
deepness=deepness,
context=context,
# marketplaces=marketplaces, # Uncomment this for using marketplaces
# excluded_urls=excluded_urls # Uncomment this for using excluded_urls
)
This creates a file with name pattern <datetime[%Y%m%d%H%M%S]>.csv inside the folder data/products.
Contributing
see CONTRIBUTING.md
Async Setup
The following image provides a schematic representation of the package's async setup.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vianu_fraudcrawler-0.2.2.tar.gz.
File metadata
- Download URL: vianu_fraudcrawler-0.2.2.tar.gz
- Upload date:
- Size: 972.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.10.12 Linux/6.9.3-76060903-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f222344327605bba7434d671f7f521eb9b7756b1d5963904219f69bdc8093cd
|
|
| MD5 |
6a4484d5df070769176a950fc20ad374
|
|
| BLAKE2b-256 |
4c1ba0517a66529ea820d1d48406813eeb35dd9e4b26564b676b7e568986ba23
|
File details
Details for the file vianu_fraudcrawler-0.2.2-py3-none-any.whl.
File metadata
- Download URL: vianu_fraudcrawler-0.2.2-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.10.12 Linux/6.9.3-76060903-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78334666303a342becf0bb3b2b0a357b3c461855baa1fd0e5eea08936ebc8c98
|
|
| MD5 |
fd3eecba64089aadc4a6a03b573205cd
|
|
| BLAKE2b-256 |
517ec13ee63327414718d588817fe193b23905baadbf90b88f8decbe13773a8b
|