proxyproviders 0.2.2__tar.gz → 0.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxyproviders
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A unified interface for different proxy providers
5
5
  License: MIT License
6
6
 
@@ -26,7 +26,7 @@ License: MIT License
26
26
  License-File: LICENSE
27
27
  Author: David Teather
28
28
  Author-email: contact.davidteather@gmail.com
29
- Requires-Python: >=3.9
29
+ Requires-Python: >=3.10
30
30
  Classifier: Development Status :: 3 - Alpha
31
31
  Classifier: Intended Audience :: Developers
32
32
  Classifier: License :: OSI Approved :: MIT License
@@ -46,7 +46,7 @@ Description-Content-Type: text/markdown
46
46
 
47
47
  The Unified Python Proxy API for managing proxies with support for BrightData, WebShare, and more.
48
48
 
49
- [![codecov](https://codecov.io/gh/davidteather/proxyproviders/graph/badge.svg?token=MZF0KP7YMA)](https://codecov.io/gh/davidteather/proxyproviders) [![Sponsor Me](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/davidteather) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/releases) [![GitHub](https://img.shields.io/github/license/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/blob/main/LICENSE) [![Downloads](https://pepy.tech/badge/proxyproviders)](https://pypi.org/project/proxyproviders/) ![](https://visitor-badge.laobi.icu/badge?page_id=davidteather.proxyproviders) [![Support Server](https://img.shields.io/discord/783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https://discord.gg/yyPhbfma6f) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https://www.linkedin.com/in/davidteather/)
49
+ [![codecov](https://codecov.io/gh/davidteather/proxyproviders/graph/badge.svg?token=MZF0KP7YMA)](https://codecov.io/gh/davidteather/proxyproviders) [![Sponsor Me](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://go.dteather.com/github-sponsors?src=proxyproviders&placement=badge) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/releases) [![GitHub](https://img.shields.io/github/license/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/blob/main/LICENSE) [![Downloads](https://pepy.tech/badge/proxyproviders)](https://pypi.org/project/proxyproviders/) ![](https://visitor-badge.laobi.icu/badge?page_id=davidteather.proxyproviders) [![Support Server](https://img.shields.io/discord/783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https://go.dteather.com/discord?src=proxyproviders&placement=badge) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https://www.linkedin.com/in/davidteather/)
50
50
 
51
51
  ## Table of Contents
52
52
 
@@ -61,12 +61,12 @@ The Unified Python Proxy API for managing proxies with support for BrightData, W
61
61
 
62
62
  You can find the full documentation [here](https://davidteather.github.io/proxyproviders)
63
63
 
64
- **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://github.com/davidteather/everything-web-scraping)
64
+ **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://go.dteather.com/everything-web-scraping?src=proxyproviders&placement=readme)
65
65
 
66
66
  ### How to Support The Project
67
67
 
68
68
  - Star the repo 😎
69
- - Consider [sponsoring](https://github.com/sponsors/davidteather) me on GitHub
69
+ - Consider [sponsoring](https://go.dteather.com/github-sponsors?src=proxyproviders&placement=readme) me on GitHub
70
70
  - Send me an email or a [LinkedIn](https://www.linkedin.com/in/davidteather/) message about what you're doing with it :D
71
71
  - Submit PRs for issues or any new providers/features :)
72
72
 
@@ -87,13 +87,15 @@ Here's a quick bit of code to get you started! There's also a few [examples in t
87
87
 
88
88
  **📺 Video Tutorial:** [Watch the quick start guide on YouTube](https://youtu.be/h-JouO_orYo) for a walkthrough of getting started with ProxyProviders.
89
89
 
90
- **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://github.com/davidteather/everything-web-scraping)
90
+ **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://go.dteather.com/everything-web-scraping?src=proxyproviders&placement=readme)
91
91
 
92
92
  ### Choose a Proxy Provider
93
93
 
94
94
  If you already haven't, choose which proxy provider to use. You can find a [list in the documentation](https://davidteather.github.io/proxyproviders/#proxyproviders-supported-providers). After choosing, look at the documentation around the specific provider you've choosen. Where needed, we've laid out steps to get api keys in the documentation. These steps will vary slightly by provider. For this example I'll be using the [Webshare Provider](https://davidteather.github.io/proxyproviders/#proxyproviders.providers.webshare.Webshare) because it's both easy to setup and they give you 10 free data center proxies to test out.
95
95
 
96
- You can create an account on webshare [here](https://www.webshare.io/?referral_code=3x5812idzzzp) (affiliate link), then head into the [API tab](https://dashboard.webshare.io/userapi/keys) on the side and generate a new token. Keep this API token safe and don't post it publically.
96
+ You can create an account on webshare [here](https://go.dteather.com/webshare?src=proxyproviders&placement=readme) (affiliate link), then head into the [API tab](https://dashboard.webshare.io/userapi/keys) on the side and generate a new token. Keep this API token safe and don't post it publically.
97
+
98
+ If you'd rather use BrightData, you can create an account [here](https://go.dteather.com/brightdata?src=proxyproviders&placement=readme) (affiliate link), then grab an API token from the [account settings](https://brightdata.com/cp/setting/users).
97
99
 
98
100
  ### Basic Example
99
101
 
@@ -153,7 +155,7 @@ ws.list_proxies() # calls API since it's more than 3s later
153
155
 
154
156
  ### Function Using Generic ProxyProvider
155
157
 
156
- Since all proxy providers implement the same interface, we can make a function that allows us to easily swap out and utilize different providers. This is the main appeal of having a unified interface. It allows other modules to be provider agnostic, like my [TikTokAPI](https://github.com/davidteather/TikTok-Api) package.
158
+ Since all proxy providers implement the same interface, we can make a function that allows us to easily swap out and utilize different providers. This is the main appeal of having a unified interface. It allows other modules to be provider agnostic, like my [TikTokAPI](https://go.dteather.com/tiktokapi?src=proxyproviders&placement=readme) package.
157
159
 
158
160
  ```py
159
161
  from proxyproviders import Webshare, BrightData, ProxyProvider, ProxyConfig
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Unified Python Proxy API for managing proxies with support for BrightData, WebShare, and more.
4
4
 
5
- [![codecov](https://codecov.io/gh/davidteather/proxyproviders/graph/badge.svg?token=MZF0KP7YMA)](https://codecov.io/gh/davidteather/proxyproviders) [![Sponsor Me](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/davidteather) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/releases) [![GitHub](https://img.shields.io/github/license/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/blob/main/LICENSE) [![Downloads](https://pepy.tech/badge/proxyproviders)](https://pypi.org/project/proxyproviders/) ![](https://visitor-badge.laobi.icu/badge?page_id=davidteather.proxyproviders) [![Support Server](https://img.shields.io/discord/783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https://discord.gg/yyPhbfma6f) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https://www.linkedin.com/in/davidteather/)
5
+ [![codecov](https://codecov.io/gh/davidteather/proxyproviders/graph/badge.svg?token=MZF0KP7YMA)](https://codecov.io/gh/davidteather/proxyproviders) [![Sponsor Me](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://go.dteather.com/github-sponsors?src=proxyproviders&placement=badge) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/releases) [![GitHub](https://img.shields.io/github/license/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/blob/main/LICENSE) [![Downloads](https://pepy.tech/badge/proxyproviders)](https://pypi.org/project/proxyproviders/) ![](https://visitor-badge.laobi.icu/badge?page_id=davidteather.proxyproviders) [![Support Server](https://img.shields.io/discord/783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https://go.dteather.com/discord?src=proxyproviders&placement=badge) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https://www.linkedin.com/in/davidteather/)
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -17,12 +17,12 @@ The Unified Python Proxy API for managing proxies with support for BrightData, W
17
17
 
18
18
  You can find the full documentation [here](https://davidteather.github.io/proxyproviders)
19
19
 
20
- **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://github.com/davidteather/everything-web-scraping)
20
+ **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://go.dteather.com/everything-web-scraping?src=proxyproviders&placement=readme)
21
21
 
22
22
  ### How to Support The Project
23
23
 
24
24
  - Star the repo 😎
25
- - Consider [sponsoring](https://github.com/sponsors/davidteather) me on GitHub
25
+ - Consider [sponsoring](https://go.dteather.com/github-sponsors?src=proxyproviders&placement=readme) me on GitHub
26
26
  - Send me an email or a [LinkedIn](https://www.linkedin.com/in/davidteather/) message about what you're doing with it :D
27
27
  - Submit PRs for issues or any new providers/features :)
28
28
 
@@ -43,13 +43,15 @@ Here's a quick bit of code to get you started! There's also a few [examples in t
43
43
 
44
44
  **📺 Video Tutorial:** [Watch the quick start guide on YouTube](https://youtu.be/h-JouO_orYo) for a walkthrough of getting started with ProxyProviders.
45
45
 
46
- **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://github.com/davidteather/everything-web-scraping)
46
+ **Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://go.dteather.com/everything-web-scraping?src=proxyproviders&placement=readme)
47
47
 
48
48
  ### Choose a Proxy Provider
49
49
 
50
50
  If you already haven't, choose which proxy provider to use. You can find a [list in the documentation](https://davidteather.github.io/proxyproviders/#proxyproviders-supported-providers). After choosing, look at the documentation around the specific provider you've choosen. Where needed, we've laid out steps to get api keys in the documentation. These steps will vary slightly by provider. For this example I'll be using the [Webshare Provider](https://davidteather.github.io/proxyproviders/#proxyproviders.providers.webshare.Webshare) because it's both easy to setup and they give you 10 free data center proxies to test out.
51
51
 
52
- You can create an account on webshare [here](https://www.webshare.io/?referral_code=3x5812idzzzp) (affiliate link), then head into the [API tab](https://dashboard.webshare.io/userapi/keys) on the side and generate a new token. Keep this API token safe and don't post it publically.
52
+ You can create an account on webshare [here](https://go.dteather.com/webshare?src=proxyproviders&placement=readme) (affiliate link), then head into the [API tab](https://dashboard.webshare.io/userapi/keys) on the side and generate a new token. Keep this API token safe and don't post it publically.
53
+
54
+ If you'd rather use BrightData, you can create an account [here](https://go.dteather.com/brightdata?src=proxyproviders&placement=readme) (affiliate link), then grab an API token from the [account settings](https://brightdata.com/cp/setting/users).
53
55
 
54
56
  ### Basic Example
55
57
 
@@ -109,7 +111,7 @@ ws.list_proxies() # calls API since it's more than 3s later
109
111
 
110
112
  ### Function Using Generic ProxyProvider
111
113
 
112
- Since all proxy providers implement the same interface, we can make a function that allows us to easily swap out and utilize different providers. This is the main appeal of having a unified interface. It allows other modules to be provider agnostic, like my [TikTokAPI](https://github.com/davidteather/TikTok-Api) package.
114
+ Since all proxy providers implement the same interface, we can make a function that allows us to easily swap out and utilize different providers. This is the main appeal of having a unified interface. It allows other modules to be provider agnostic, like my [TikTokAPI](https://go.dteather.com/tiktokapi?src=proxyproviders&placement=readme) package.
113
115
 
114
116
  ```py
115
117
  from proxyproviders import Webshare, BrightData, ProxyProvider, ProxyConfig
@@ -2,6 +2,7 @@ from dataclasses import dataclass
2
2
  from datetime import datetime
3
3
  from enum import Enum
4
4
  from typing import Dict, List, Optional, Union
5
+ from urllib.parse import quote
5
6
 
6
7
 
7
8
  class ProxyFormat(Enum):
@@ -61,7 +62,10 @@ class Proxy:
61
62
  """Convert proxy to URL format for use with HTTP clients.
62
63
 
63
64
  :param protocol: The protocol to use in the URL (default: 'http')
64
- :return: Proxy URL in format 'protocol://username:password@host:port'
65
+ :return: Proxy URL in format 'protocol://username:password@host:port'.
66
+ The username and password are percent-encoded, so characters such
67
+ as ``@``, ``:``, ``#`` or ``/`` in them do not change where the URL
68
+ points.
65
69
 
66
70
  Example:
67
71
  >>> proxy.to_url()
@@ -69,7 +73,9 @@ class Proxy:
69
73
  >>> proxy.to_url('https')
70
74
  'https://user:pass@192.168.1.1:8080'
71
75
  """
72
- return f"{protocol}://{self.username}:{self.password}@{self.proxy_address}:{self.port}"
76
+ username = quote(self.username, safe="")
77
+ password = quote(self.password, safe="")
78
+ return f"{protocol}://{username}:{password}@{self.proxy_address}:{self.port}"
73
79
 
74
80
  def format(
75
81
  self, format_type: Union[ProxyFormat, str] = ProxyFormat.URL, **kwargs
@@ -10,7 +10,7 @@ from ..proxy_provider import ProxyConfig, ProxyProvider
10
10
  class BrightData(ProxyProvider):
11
11
  """BrightData (formerly luminati) is a proxy provider that offers residential and datacenter proxies.
12
12
 
13
- Create an account `here <https://get.brightdata.com/davidteather>`_ (affiliate link).
13
+ Create an account `here <https://go.dteather.com/brightdata?src=proxyproviders&placement=docstring>`_ (affiliate link).
14
14
 
15
15
  You can find your API key in the account settings `here <https://brightdata.com/cp/setting/users>`_ then create "add token" with scope "limit" (`BrightData article <https://docs.brightdata.com/general/account/api-token>`_ for more info)
16
16
 
@@ -15,7 +15,7 @@ from ..proxy_provider import ProxyConfig, ProxyProvider
15
15
  class Webshare(ProxyProvider):
16
16
  """Webshare is a proxy provider that offers residential and datacenter proxies.
17
17
 
18
- Create an account for webshare `here <https://www.webshare.io/?referral_code=3x5812idzzzp>`_ (affiliate link) to get started with 10 free data center proxies.
18
+ Create an account for webshare `here <https://go.dteather.com/webshare?src=proxyproviders&placement=docstring>`_ (affiliate link) to get started with 10 free data center proxies.
19
19
 
20
20
  You can find your API key in the Webshare dashboard `here <https://dashboard.webshare.io/userapi/keys>`_
21
21
 
@@ -1,3 +1,3 @@
1
1
  """Version information for proxyproviders package."""
2
2
 
3
- __version__ = "0.2.2"
3
+ __version__ = "0.2.3"
@@ -4,22 +4,22 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "proxyproviders"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "A unified interface for different proxy providers"
9
9
  authors = ["David Teather <contact.davidteather@gmail.com>"]
10
10
 
11
11
  [tool.poetry.dependencies]
12
- python = ">=3.9"
12
+ python = ">=3.10"
13
13
 
14
14
  [project]
15
15
  name = "proxyproviders"
16
- version = "0.2.2"
16
+ version = "0.2.3"
17
17
  description = "A unified interface for different proxy providers"
18
18
  readme = "README.md"
19
19
  authors = [{ name = "David Teather", email = "contact.davidteather@gmail.com" }]
20
20
  license = { file = "LICENSE" }
21
21
  dependencies = ["requests"]
22
- requires-python = ">=3.9"
22
+ requires-python = ">=3.10"
23
23
  classifiers = [
24
24
  "Development Status :: 3 - Alpha",
25
25
  "Intended Audience :: Developers",
File without changes