proxar 0.1.2__tar.gz → 0.2.0__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.
- {proxar-0.1.2 → proxar-0.2.0}/CHANGELOG.md +6 -0
- {proxar-0.1.2 → proxar-0.2.0}/PKG-INFO +3 -1
- {proxar-0.1.2 → proxar-0.2.0}/pyproject.toml +5 -2
- proxar-0.2.0/src/proxar/__init__.py +26 -0
- proxar-0.2.0/src/proxar/handlers/storage.py +28 -0
- proxar-0.2.0/uv.lock +1405 -0
- proxar-0.1.2/src/proxar/__init__.py +0 -17
- proxar-0.1.2/uv.lock +0 -888
- {proxar-0.1.2 → proxar-0.2.0}/.github/workflows/release.yml +0 -0
- {proxar-0.1.2 → proxar-0.2.0}/.gitignore +0 -0
- {proxar-0.1.2 → proxar-0.2.0}/.pre-commit-config.yaml +0 -0
- {proxar-0.1.2 → proxar-0.2.0}/.python-version +0 -0
- {proxar-0.1.2 → proxar-0.2.0}/LICENSE +0 -0
- {proxar-0.1.2 → proxar-0.2.0}/README.md +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: proxar
|
3
|
-
Version: 0.
|
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
|
@@ -4,11 +4,14 @@ build-backend = "hatchling.build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "proxar"
|
7
|
-
version = "0.
|
7
|
+
version = "0.2.0"
|
8
8
|
description = "A Python client for fetching public proxies from multiple sources."
|
9
9
|
readme = "README.md"
|
10
10
|
requires-python = ">=3.10"
|
11
|
-
dependencies = [
|
11
|
+
dependencies = [
|
12
|
+
"aiohttp>=3.12.13",
|
13
|
+
"platformdirs>=4.3.8",
|
14
|
+
]
|
12
15
|
license = {file = "LICENSE"}
|
13
16
|
authors = [
|
14
17
|
{name = "Filming"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import logging
|
2
|
+
from pathlib import Path
|
3
|
+
|
4
|
+
from .handlers.storage import StorageHandler
|
5
|
+
|
6
|
+
logger = logging.getLogger(__name__)
|
7
|
+
logger.addHandler(logging.NullHandler())
|
8
|
+
|
9
|
+
|
10
|
+
class Proxar:
|
11
|
+
"""A Python client for fetching public proxies.
|
12
|
+
|
13
|
+
This library provides an asynchronous, easy-to-use interface to
|
14
|
+
retrieve fresh proxies, handling the complexities of web scraping
|
15
|
+
and source aggregation.
|
16
|
+
"""
|
17
|
+
|
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.")
|