hltv-async-api 0.3.0__tar.gz → 0.3.1__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.1
2
2
  Name: hltv_async_api
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
5
  Home-page: https://github.com/akimerslys/aiohltv
6
6
  Author: akimerslys
@@ -16,6 +16,10 @@ License-File: LICENSE
16
16
 
17
17
  # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
18
 
19
+
20
+ **This page not completed, not all methods and configs are written**
21
+
22
+
19
23
  # Features
20
24
 
21
25
  * New and modern fully async library
@@ -64,13 +68,13 @@ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
68
  ```
65
69
 
66
70
 
67
- **Remove bad proxy from file**
71
+ **One-time proxy**
68
72
 
69
73
  ```
70
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
74
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', proxy_one_time=True)
71
75
  ```
72
76
 
73
- **Add proxy protocol**
77
+ **Protocol usage**
74
78
 
75
79
  ```
76
80
  proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
@@ -80,6 +84,7 @@ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
80
84
 
81
85
  ---
82
86
  # Methods
87
+
83
88
  * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
84
89
 
85
90
  -days (the number of days into the future to fetch matches for)
@@ -169,7 +174,7 @@ from hltv_async_api import Hltv
169
174
 
170
175
  async def test():
171
176
 
172
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
177
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, proxy_one_time=True, proxy_protocol='http')
173
178
 
174
179
  print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
175
180
 
@@ -1,5 +1,9 @@
1
1
  # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
2
2
 
3
+
4
+ **This page not completed, not all methods and configs are written**
5
+
6
+
3
7
  # Features
4
8
 
5
9
  * New and modern fully async library
@@ -48,13 +52,13 @@ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
48
52
  ```
49
53
 
50
54
 
51
- **Remove bad proxy from file**
55
+ **One-time proxy**
52
56
 
53
57
  ```
54
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
58
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', proxy_one_time=True)
55
59
  ```
56
60
 
57
- **Add proxy protocol**
61
+ **Protocol usage**
58
62
 
59
63
  ```
60
64
  proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
@@ -64,6 +68,7 @@ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
64
68
 
65
69
  ---
66
70
  # Methods
71
+
67
72
  * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
68
73
 
69
74
  -days (the number of days into the future to fetch matches for)
@@ -153,7 +158,7 @@ from hltv_async_api import Hltv
153
158
 
154
159
  async def test():
155
160
 
156
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
161
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, proxy_one_time=True, proxy_protocol='http')
157
162
 
158
163
  print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
159
164
 
@@ -1,7 +1,7 @@
1
1
  from typing import Any, List
2
2
  from datetime import date, datetime, timedelta
3
3
  import pytz
4
- import aiofiles
4
+
5
5
  from bs4 import BeautifulSoup
6
6
  import asyncio
7
7
  from asyncio import get_running_loop
@@ -23,7 +23,7 @@ class Hltv:
23
23
  debug: bool = False,
24
24
  max_retries: int = 0,
25
25
  proxy_protocol: str | None = None,
26
- remove_proxy: bool = False
26
+ proxy_one_time: bool = False
27
27
  ):
28
28
  self.headers = {
29
29
  "referer": "https://www.hltv.org/stats",
@@ -37,7 +37,7 @@ class Hltv:
37
37
  self.PROXY_PATH = proxy_path
38
38
  self.PROXY_LIST = proxy_list
39
39
  self.PROXY_PROTOCOL = proxy_protocol
40
- self.REMOVE_PROXY = remove_proxy
40
+ self.PROXY_ONCE = proxy_one_time
41
41
  self.DEBUG = debug
42
42
  self._configure_logging()
43
43
  self.logger = logging.getLogger(__name__)
@@ -58,7 +58,7 @@ class Hltv:
58
58
  debug: bool | None = None,
59
59
  max_retries: int | None = None,
60
60
  proxy_protocol: str | None = None,
61
- remove_proxy: bool | None = None,
61
+ proxy_one_time: bool | None = None,
62
62
  ):
63
63
  if max_delay:
64
64
  self.MAX_DELAY = max_delay
@@ -72,8 +72,8 @@ class Hltv:
72
72
  self.max_retries = max_retries
73
73
  if proxy_protocol:
74
74
  self.PROXY_PROTOCOL = proxy_protocol
75
- if remove_proxy:
76
- self.REMOVE_PROXY = remove_proxy
75
+ if proxy_one_time:
76
+ self.PROXY_ONCE = proxy_one_time
77
77
  if debug:
78
78
  self.DEBUG = debug
79
79
  self._configure_logging()
@@ -90,7 +90,7 @@ class Hltv:
90
90
  return proxy
91
91
 
92
92
  async def switch_proxy(self):
93
- if self.REMOVE_PROXY:
93
+ if self.PROXY_ONCE:
94
94
  self.logger.debug(f'Removing proxy {self.PROXY_LIST[0]}')
95
95
  self.PROXY_LIST = self.PROXY_LIST[1:]
96
96
  else:
@@ -678,9 +678,9 @@ class Hltv:
678
678
 
679
679
 
680
680
  async def test():
681
- hltv = Hltv(use_proxy=True, proxy_path='proxies.txt', debug=True, remove_proxy=True, proxy_protocol='http')
682
- print(await hltv.get_last_news(only_today=True, max_reg_news=1))
681
+ hltv = Hltv(use_proxy=True, proxy_path='proxies.txt', debug=True, one_time_proxy=True, proxy_protocol='http')
683
682
 
683
+ print(await hltv.get_last_news(only_today=True, max_reg_news=1))
684
684
 
685
685
  if __name__ == "__main__":
686
686
  asyncio.run(test())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hltv_async_api
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
5
  Home-page: https://github.com/akimerslys/aiohltv
6
6
  Author: akimerslys
@@ -16,6 +16,10 @@ License-File: LICENSE
16
16
 
17
17
  # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
18
 
19
+
20
+ **This page not completed, not all methods and configs are written**
21
+
22
+
19
23
  # Features
20
24
 
21
25
  * New and modern fully async library
@@ -64,13 +68,13 @@ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
68
  ```
65
69
 
66
70
 
67
- **Remove bad proxy from file**
71
+ **One-time proxy**
68
72
 
69
73
  ```
70
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
74
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', proxy_one_time=True)
71
75
  ```
72
76
 
73
- **Add proxy protocol**
77
+ **Protocol usage**
74
78
 
75
79
  ```
76
80
  proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
@@ -80,6 +84,7 @@ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
80
84
 
81
85
  ---
82
86
  # Methods
87
+
83
88
  * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
84
89
 
85
90
  -days (the number of days into the future to fetch matches for)
@@ -169,7 +174,7 @@ from hltv_async_api import Hltv
169
174
 
170
175
  async def test():
171
176
 
172
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
177
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, proxy_one_time=True, proxy_protocol='http')
173
178
 
174
179
  print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
175
180
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hltv_async_api"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  authors = [
5
5
  { name="Akim Slys", email="akimslys2003@gmail.com" },
6
6
  ]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='hltv_async_api',
5
- version='0.3.0',
5
+ version='0.3.1',
6
6
  author='akimerslys',
7
7
  author_email='akimslys2003@gmail.com',
8
8
  description='Hltv-aio: An unofficial asynchronous HLTV API Wrapper for Python',
@@ -14,7 +14,6 @@ setup(
14
14
  install_requires=[
15
15
  'aiohttp==3.9.3',
16
16
  'aiosignal==1.3.1',
17
- 'aiofiles==23.2.1',
18
17
  'attrs==23.2.0',
19
18
  'beautifulsoup4==4.12.3',
20
19
  'frozenlist==1.4.1',
File without changes
File without changes