fraudcrawler 0.3.9__tar.gz → 0.3.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fraudcrawler might be problematic. Click here for more details.

Files changed (19) hide show
  1. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/PKG-INFO +1 -1
  2. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/base.py +9 -2
  3. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/pyproject.toml +1 -1
  4. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/LICENSE +0 -0
  5. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/README.md +0 -0
  6. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/__init__.py +0 -0
  7. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/__init__.py +0 -0
  8. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/client.py +0 -0
  9. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/google-languages.json +0 -0
  10. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/google-locations.json +0 -0
  11. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/base/orchestrator.py +0 -0
  12. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/launch_demo_pipeline.py +0 -0
  13. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/processing/__init__.py +0 -0
  14. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/processing/processor.py +0 -0
  15. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/scraping/__init__.py +0 -0
  16. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/scraping/enrich.py +0 -0
  17. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/scraping/serp.py +0 -0
  18. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/scraping/zyte.py +0 -0
  19. {fraudcrawler-0.3.9 → fraudcrawler-0.3.10}/fraudcrawler/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fraudcrawler
3
- Version: 0.3.9
3
+ Version: 0.3.10
4
4
  Summary: Intelligent Market Monitoring
5
5
  Home-page: https://github.com/open-veanu/fraudcrawler
6
6
  License: MIT
@@ -6,6 +6,7 @@ from pydantic import (
6
6
  model_validator,
7
7
  )
8
8
  from pydantic_settings import BaseSettings
9
+ import re
9
10
  from typing import List
10
11
 
11
12
  import aiohttp
@@ -48,11 +49,17 @@ class Host(BaseModel):
48
49
  name: str
49
50
  domains: str | List[str]
50
51
 
52
+ @staticmethod
53
+ def _normalize_domain(domain: str) -> str:
54
+ """Make it lowercase and strip 'www.' and 'https?://' prefixes from the domain."""
55
+ domain = domain.strip().lower()
56
+ return re.sub(r"^(https?://)?(www\.)?", "", domain)
57
+
51
58
  @field_validator("domains", mode="before")
52
- def split_domains_if_str(cls, val):
59
+ def normalize_domains(cls, val):
53
60
  if isinstance(val, str):
54
61
  val = val.split(",")
55
- return [dom.strip().lower() for dom in val]
62
+ return [cls._normalize_domain(dom.strip()) for dom in val]
56
63
 
57
64
 
58
65
  class Location(BaseModel):
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "fraudcrawler"
7
- version = "0.3.9"
7
+ version = "0.3.10"
8
8
  description = "Intelligent Market Monitoring"
9
9
  authors = [
10
10
  "Domingo Bertus <hello@veanu.ch>",
File without changes
File without changes