proxar 0.1.2__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.
proxar/__init__.py CHANGED
@@ -1,4 +1,7 @@
1
1
  import logging
2
+ from pathlib import Path
3
+
4
+ from .handlers.storage import StorageHandler
2
5
 
3
6
  logger = logging.getLogger(__name__)
4
7
  logger.addHandler(logging.NullHandler())
@@ -12,6 +15,12 @@ class Proxar:
12
15
  and source aggregation.
13
16
  """
14
17
 
15
- def __init__(self) -> None:
16
- """Initialize the Proxar instance."""
17
- logger.info("Proxar instance has been initialized.")
18
+ def __init__(self, storage_dir: str | Path | None = None):
19
+ """Initialize the Proxar instance.
20
+
21
+ Args:
22
+ storage_dir (str | Path | None): The path to store proxy
23
+ files. Defaults to None.
24
+ """
25
+ self.storage_manager = StorageHandler(storage_dir)
26
+ logger.info("Proxar has been initialized.")
@@ -0,0 +1,28 @@
1
+ import logging
2
+ from pathlib import Path
3
+
4
+ import platformdirs
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+
9
+ class StorageHandler:
10
+ """Handle storage operations."""
11
+
12
+ def __init__(self, storage_dir: str | Path | None):
13
+ """Initialize the storage handler instance.
14
+
15
+ Args:
16
+ storage_dir (str | Path | None): The path to store proxy
17
+ files. If None, a default directory is used based on
18
+ the operating system.
19
+ """
20
+ # Set storage path and ensure its existence
21
+ if storage_dir is None:
22
+ self.storage_path = Path(platformdirs.user_data_dir("proxar"))
23
+ else:
24
+ self.storage_path = Path(storage_dir)
25
+
26
+ self.storage_path.mkdir(parents=True, exist_ok=True)
27
+
28
+ logger.debug("Storage handler has been initialized.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxar
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: A Python client for fetching public proxies from multiple sources.
5
5
  Project-URL: Homepage, https://github.com/filming/proxar
6
6
  Project-URL: Repository, https://github.com/filming/proxar
@@ -39,6 +39,8 @@ Classifier: Programming Language :: Python :: 3.11
39
39
  Classifier: Programming Language :: Python :: 3.12
40
40
  Classifier: Programming Language :: Python :: 3.13
41
41
  Requires-Python: >=3.10
42
+ Requires-Dist: aiohttp>=3.12.13
43
+ Requires-Dist: platformdirs>=4.3.8
42
44
  Description-Content-Type: text/markdown
43
45
 
44
46
  # Proxar
@@ -0,0 +1,6 @@
1
+ proxar/__init__.py,sha256=BxyuJnseUztc5dk0buGds94lr1mx1zqoiVvJsUkHQHQ,763
2
+ proxar/handlers/storage.py,sha256=_ciKoS3-YfPLaRP_8vf95zT268PZ_ucLrCb9Ucs6wHs,820
3
+ proxar-0.2.0.dist-info/METADATA,sha256=ee9LiA7VJ9exwKoiS3vL0e00LM82dl_mDX4B4aCZI2Q,5019
4
+ proxar-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ proxar-0.2.0.dist-info/licenses/LICENSE,sha256=nADWCkou8O88YlL98Q9yVUXMJmusPE4LlQRrTv7S0Ts,1064
6
+ proxar-0.2.0.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- proxar/__init__.py,sha256=X2ttuG_9U20-B_lQl4utBikcLmTgeSLo3jRuu06EOAs,477
2
- proxar-0.1.2.dist-info/METADATA,sha256=LA_Ril7pb2efXIrdbRqECBNIRBBfGgg6Mi5pjCDJKaw,4952
3
- proxar-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- proxar-0.1.2.dist-info/licenses/LICENSE,sha256=nADWCkou8O88YlL98Q9yVUXMJmusPE4LlQRrTv7S0Ts,1064
5
- proxar-0.1.2.dist-info/RECORD,,
File without changes