datamarket 0.8.1__tar.gz → 0.8.2__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 datamarket might be problematic. Click here for more details.

Files changed (23) hide show
  1. {datamarket-0.8.1 → datamarket-0.8.2}/PKG-INFO +1 -1
  2. {datamarket-0.8.1 → datamarket-0.8.2}/pyproject.toml +1 -1
  3. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/proxy.py +4 -6
  4. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/main.py +1 -1
  5. {datamarket-0.8.1 → datamarket-0.8.2}/LICENSE +0 -0
  6. {datamarket-0.8.1 → datamarket-0.8.2}/README.md +0 -0
  7. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/__init__.py +0 -0
  8. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/__init__.py +0 -0
  9. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/alchemy.py +0 -0
  10. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/aws.py +0 -0
  11. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/drive.py +0 -0
  12. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/ftp.py +0 -0
  13. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/nominatim.py +0 -0
  14. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/peerdb.py +0 -0
  15. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/interfaces/tinybird.py +0 -0
  16. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/params/__init__.py +0 -0
  17. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/params/nominatim.py +0 -0
  18. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/__init__.py +0 -0
  19. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/airflow.py +0 -0
  20. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/alchemy.py +0 -0
  21. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/selenium.py +0 -0
  22. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/soda.py +0 -0
  23. {datamarket-0.8.1 → datamarket-0.8.2}/src/datamarket/utils/typer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: datamarket
3
- Version: 0.8.1
3
+ Version: 0.8.2
4
4
  Summary: Utilities that integrate advanced scraping knowledge into just one library.
5
5
  License: GPL-3.0-or-later
6
6
  Author: DataMarket
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "datamarket"
3
- version = "0.8.1"
3
+ version = "0.8.2"
4
4
  description = "Utilities that integrate advanced scraping knowledge into just one library."
5
5
  authors = ["DataMarket <techsupport@datamarket.es>"]
6
6
  license = "GPL-3.0-or-later"
@@ -2,8 +2,8 @@
2
2
  # IMPORTS
3
3
 
4
4
  import logging
5
- import time
6
5
  import random
6
+ import time
7
7
 
8
8
  import requests
9
9
  from stem import Signal
@@ -45,7 +45,7 @@ class ProxyInterface:
45
45
  proxy_url = self.get_proxy_url("127.0.0.1", 9050)
46
46
  else:
47
47
  current_host, current_port = self.get_random_host_port() if randomize else self.get_current_host_port()
48
-
48
+
49
49
  user = self.config.get("user")
50
50
  password = self.config.get("password")
51
51
  use_socks = self.config.get("socks", "false").lower() == "true"
@@ -67,14 +67,12 @@ class ProxyInterface:
67
67
  def get_random_host_port(self):
68
68
  hosts = self.config["hosts"].split(",") if isinstance(self.config["hosts"], str) else self.config["hosts"]
69
69
  host_port_pairs = [hp.split(":") for hp in hosts]
70
- self.current_index = random.randint(0, len(host_port_pairs) - 1)
70
+ self.current_index = random.randint(0, len(host_port_pairs) - 1) # noqa: S311
71
71
  return host_port_pairs[self.current_index]
72
72
 
73
73
  def check_current_ip(self):
74
74
  try:
75
- return requests.get(self.CHECK_IP_URL, proxies=self.proxies).json()[
76
- "YourFuckingIPAddress"
77
- ]
75
+ return requests.get(self.CHECK_IP_URL, proxies=self.proxies, timeout=30).json()["YourFuckingIPAddress",]
78
76
  except Exception as ex:
79
77
  logger.error(ex)
80
78
 
@@ -63,7 +63,7 @@ def read_converter(path_str: str):
63
63
 
64
64
 
65
65
  def get_config(config_file: Path, tz: str = "Europe/Madrid"):
66
- if Path(config_file).suffix == "ini":
66
+ if Path(config_file).suffix == ".ini":
67
67
  logger.warning("Using legacy INI config reader. Please migrate to TOML")
68
68
  cfg = configparser.RawConfigParser()
69
69
  return cfg.read(config_file)
File without changes
File without changes