hltv-async-api 0.2.5__tar.gz → 0.2.7__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.
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.1
2
+ Name: hltv_async_api
3
+ Version: 0.2.7
4
+ Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
+ Home-page: https://github.com/akimerslys/aiohltv
6
+ Author: akimerslys
7
+ Author-email: Akim Slys <akimslys2003@gmail.com>
8
+ Project-URL: Homepage, https://github.com/akimerslys/aiohltv
9
+ Project-URL: Issues, https://github.com/akimerslys/aiohltv/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
+
19
+ # Features
20
+
21
+ * New and modern fully async library
22
+
23
+ * Supports proxy usage for rate-limiting and privacy
24
+
25
+ * Automatically changes proxy if access is denied
26
+
27
+
28
+ ---
29
+
30
+ # Installation
31
+
32
+ ```
33
+ pip install hltv-async-api
34
+ ```
35
+
36
+ ---
37
+
38
+
39
+ # Simple Usage
40
+
41
+ ```
42
+ from hltv_async_api import Hltv
43
+
44
+ hltv = Hltv()
45
+ live_matches = await hltv.get_live_matches()
46
+ ```
47
+
48
+ ---
49
+
50
+ # Proxy Usage
51
+
52
+ **Load Proxies from list**
53
+
54
+ ```
55
+ proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
56
+
57
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
58
+ ```
59
+
60
+ **Load Proxies from file**
61
+
62
+ ```
63
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
+ ```
65
+
66
+
67
+ **Remove bad proxy from file**
68
+
69
+ ```
70
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
71
+ ```
72
+
73
+ **Add proxy protocol**
74
+
75
+ ```
76
+ proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
77
+
78
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
79
+ ```
80
+
81
+ ---
82
+ # Methods
83
+ * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
84
+
85
+ -days (the number of days into the future to fetch matches for)
86
+
87
+ -min_star_rating (the minimum star rating for matches to include)
88
+
89
+ ```
90
+ await hltv.get_upcoming_matches(1, 5)
91
+
92
+ >>> ['date': '11/11/2024', 'matches': [team1: 'Natus Vincere' | 'TBD', team2: 'FaZe' | 'TBD', time: '14:15', maps: '3', stars: 5, 'PGL CS2 Major Copenhagen 2024' | None]]```
93
+
94
+ ```
95
+
96
+ * get_event_results(event_id: int | str)
97
+
98
+
99
+ ```
100
+ await get_event_results(7148)
101
+
102
+ >>> ['date': '31-3', 'team1': 'FaZe', 'team2': 'Natus Vincere', 'score1': '1', 'score2': '2']
103
+
104
+ ```
105
+
106
+ * get_event_matches(event_id: str | int):
107
+
108
+ ```
109
+ await hltv.get_event_matches(7148)
110
+
111
+ >>>['team1': 'Natus Vincere', 'team2': 'FaZe', 'date': '11-11' | 'LIVE']
112
+ ```
113
+
114
+ * get_event_info(event_id: str | int, event_title: str) -> (event_id, event_title, event_start, event_end, prize, team_num, location, groups)
115
+
116
+ ```
117
+ await hltv.get_event_info(7148, 'PGL CS2 Major Copenhagen2024')
118
+
119
+ (7148, 'PGL CS2 Major Copenhagen2024', '21-3', '31-3', '$1,250,000', '16', 'Copenhagen, Denmark', [])
120
+ ```
121
+
122
+
123
+ get_top_teams(max_teams=30) -> ['rank', 'title', 'points', 'change', 'id']
124
+
125
+ ```
126
+ await hltv.get_top_teams(2)
127
+
128
+ >>>[{'rank': '1', 'title': 'FaZe', 'points': '939', 'change': '-', 'id': '6667'}, {'rank': '2', 'title': 'Natus Vincere', 'points': '757', 'change': '+4', 'id': '4608'}]
129
+ ```
130
+
131
+ get_team_info(team_id: int | str, title: str) -> (team_id, team_title, rank, [players], coach, average_age, weeks_in_top_20, last_trophy, total_trophys)
132
+
133
+ ```
134
+ await hltv.get_team_info(6667, 'faze')
135
+
136
+ >>>(6667, 'faze', '1', ['karrigan', 'rain', 'frozen', 'ropz', 'broky'], 'NEO', '26.5', '256', 'CS Asia Championships 2023', 21)
137
+ ```
138
+
139
+ get_last_news(self, max_reg_news=2, only_today=True, only_featured=False) -> [date, [featured_id, featured_title, featured_desciption], [regular_id, reg_title, reg_time]]
140
+
141
+ ```
142
+ await hltv.get_last_news(only_today=True, max_reg_news=1)
143
+
144
+ >>>[{'date': '02-04', 'f_news': [{'f_id': '38682', 'f_title': 'NIP confirm r1nkle signing', 'f_desc': "Ninjas in Pyjamas only have an anchor player left to sign following the young Ukrainian AWPer's addition."}], 'news': [{'id': '38685', 'title': 'Rounds add sLowi, p3kko', 'posted': 'an hour ago'}, {'id': '38690', 'title': 'n1ssim returns to Sharks after paiN loan deal expires', 'posted': 'an hour ago'}]}]
145
+ ```
146
+ ---
147
+ # Examples
148
+
149
+ ****Simple Example****
150
+
151
+ ```
152
+ from hltv_async_api import Hltv
153
+
154
+
155
+ async def test():
156
+
157
+ hltv = Hltv()
158
+
159
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
160
+
161
+ if __name__ == "__main__":
162
+ asyncio.run(test())
163
+ ```
164
+
165
+ ****Proxy Parser****
166
+ ```
167
+ from hltv_async_api import Hltv
168
+
169
+
170
+ async def test():
171
+
172
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
173
+
174
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
175
+
176
+ if __name__ == "__main__":
177
+ asyncio.run(test())
178
+ ```
179
+
180
+
181
+ # Requirements:
182
+
183
+ Python 3.9+
184
+
185
+ License:
186
+ HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
@@ -0,0 +1,170 @@
1
+ # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
2
+
3
+ # Features
4
+
5
+ * New and modern fully async library
6
+
7
+ * Supports proxy usage for rate-limiting and privacy
8
+
9
+ * Automatically changes proxy if access is denied
10
+
11
+
12
+ ---
13
+
14
+ # Installation
15
+
16
+ ```
17
+ pip install hltv-async-api
18
+ ```
19
+
20
+ ---
21
+
22
+
23
+ # Simple Usage
24
+
25
+ ```
26
+ from hltv_async_api import Hltv
27
+
28
+ hltv = Hltv()
29
+ live_matches = await hltv.get_live_matches()
30
+ ```
31
+
32
+ ---
33
+
34
+ # Proxy Usage
35
+
36
+ **Load Proxies from list**
37
+
38
+ ```
39
+ proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
40
+
41
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
42
+ ```
43
+
44
+ **Load Proxies from file**
45
+
46
+ ```
47
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
48
+ ```
49
+
50
+
51
+ **Remove bad proxy from file**
52
+
53
+ ```
54
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
55
+ ```
56
+
57
+ **Add proxy protocol**
58
+
59
+ ```
60
+ proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
61
+
62
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
63
+ ```
64
+
65
+ ---
66
+ # Methods
67
+ * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
68
+
69
+ -days (the number of days into the future to fetch matches for)
70
+
71
+ -min_star_rating (the minimum star rating for matches to include)
72
+
73
+ ```
74
+ await hltv.get_upcoming_matches(1, 5)
75
+
76
+ >>> ['date': '11/11/2024', 'matches': [team1: 'Natus Vincere' | 'TBD', team2: 'FaZe' | 'TBD', time: '14:15', maps: '3', stars: 5, 'PGL CS2 Major Copenhagen 2024' | None]]```
77
+
78
+ ```
79
+
80
+ * get_event_results(event_id: int | str)
81
+
82
+
83
+ ```
84
+ await get_event_results(7148)
85
+
86
+ >>> ['date': '31-3', 'team1': 'FaZe', 'team2': 'Natus Vincere', 'score1': '1', 'score2': '2']
87
+
88
+ ```
89
+
90
+ * get_event_matches(event_id: str | int):
91
+
92
+ ```
93
+ await hltv.get_event_matches(7148)
94
+
95
+ >>>['team1': 'Natus Vincere', 'team2': 'FaZe', 'date': '11-11' | 'LIVE']
96
+ ```
97
+
98
+ * get_event_info(event_id: str | int, event_title: str) -> (event_id, event_title, event_start, event_end, prize, team_num, location, groups)
99
+
100
+ ```
101
+ await hltv.get_event_info(7148, 'PGL CS2 Major Copenhagen2024')
102
+
103
+ (7148, 'PGL CS2 Major Copenhagen2024', '21-3', '31-3', '$1,250,000', '16', 'Copenhagen, Denmark', [])
104
+ ```
105
+
106
+
107
+ get_top_teams(max_teams=30) -> ['rank', 'title', 'points', 'change', 'id']
108
+
109
+ ```
110
+ await hltv.get_top_teams(2)
111
+
112
+ >>>[{'rank': '1', 'title': 'FaZe', 'points': '939', 'change': '-', 'id': '6667'}, {'rank': '2', 'title': 'Natus Vincere', 'points': '757', 'change': '+4', 'id': '4608'}]
113
+ ```
114
+
115
+ get_team_info(team_id: int | str, title: str) -> (team_id, team_title, rank, [players], coach, average_age, weeks_in_top_20, last_trophy, total_trophys)
116
+
117
+ ```
118
+ await hltv.get_team_info(6667, 'faze')
119
+
120
+ >>>(6667, 'faze', '1', ['karrigan', 'rain', 'frozen', 'ropz', 'broky'], 'NEO', '26.5', '256', 'CS Asia Championships 2023', 21)
121
+ ```
122
+
123
+ get_last_news(self, max_reg_news=2, only_today=True, only_featured=False) -> [date, [featured_id, featured_title, featured_desciption], [regular_id, reg_title, reg_time]]
124
+
125
+ ```
126
+ await hltv.get_last_news(only_today=True, max_reg_news=1)
127
+
128
+ >>>[{'date': '02-04', 'f_news': [{'f_id': '38682', 'f_title': 'NIP confirm r1nkle signing', 'f_desc': "Ninjas in Pyjamas only have an anchor player left to sign following the young Ukrainian AWPer's addition."}], 'news': [{'id': '38685', 'title': 'Rounds add sLowi, p3kko', 'posted': 'an hour ago'}, {'id': '38690', 'title': 'n1ssim returns to Sharks after paiN loan deal expires', 'posted': 'an hour ago'}]}]
129
+ ```
130
+ ---
131
+ # Examples
132
+
133
+ ****Simple Example****
134
+
135
+ ```
136
+ from hltv_async_api import Hltv
137
+
138
+
139
+ async def test():
140
+
141
+ hltv = Hltv()
142
+
143
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
144
+
145
+ if __name__ == "__main__":
146
+ asyncio.run(test())
147
+ ```
148
+
149
+ ****Proxy Parser****
150
+ ```
151
+ from hltv_async_api import Hltv
152
+
153
+
154
+ async def test():
155
+
156
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
157
+
158
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
159
+
160
+ if __name__ == "__main__":
161
+ asyncio.run(test())
162
+ ```
163
+
164
+
165
+ # Requirements:
166
+
167
+ Python 3.9+
168
+
169
+ License:
170
+ HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
@@ -6,4 +6,4 @@
6
6
  from .aiohltv import Hltv
7
7
 
8
8
  __author__ = 'akimerslys'
9
- __version__ = '0.2.5'
9
+ __version__ = '0.2.6'
@@ -1,5 +1,6 @@
1
1
  from typing import Any, List
2
2
  from datetime import date, datetime, timedelta
3
+ import pytz
3
4
 
4
5
  from bs4 import BeautifulSoup
5
6
  import asyncio
@@ -86,8 +87,8 @@ class Hltv:
86
87
  else:
87
88
  proxy = self.PROXY_LIST[0]
88
89
 
89
- if self.PROXY_PROTOCOL not in proxy and proxy != '':
90
- proxy = self.PROXY_PROTOCOL + '://' + proxy
90
+ if self.PROXY_PROTOCOL and proxy != '' and self.PROXY_PROTOCOL not in proxy:
91
+ proxy = self.PROXY_PROTOCOL + '://' + proxy
91
92
 
92
93
  return proxy
93
94
 
@@ -213,18 +214,60 @@ class Hltv:
213
214
  stars = [line.get('stars') for line in liveMatchContainer]
214
215
  return [{'teams': teams, 'maps': maps, 'stars': stars} for teams, maps, stars in zip(matches, maps, stars)]
215
216
 
216
- async def get_upcoming_matches(self):
217
+ async def get_upcoming_matches(self, days: int = 7, star_rating: int = 1):
217
218
  """returns a list of all upcoming matches on HLTV"""
218
219
  r = await self.fetch("https://www.hltv.org/matches")
219
- if not r:
220
- return
220
+ if not r:return
221
+
222
+ matches = []
221
223
  try:
222
- teams = [line.getText() for line in r.find("div",
223
- {'class', "upcomingMatchesContainer"}).find_all(
224
- class_=lambda v: v is not None and (v == "team text-ellipsis" or v == "matchTeamName text-ellipsis"))]
224
+
225
+
226
+ for i, date_div in enumerate(r.find_all('div', {'class': 'upcomingMatchesSection'}), start=1):
227
+ if i > days:
228
+ break
229
+ date_ = date_div.find('span', {'class': 'matchDayHeadline'}).text.split()[-1]
230
+ matches_today = []
231
+
232
+ for match in date_div.find_all('div', {'class': 'upcomingMatch'}):
233
+ time_ = match.find('div', {'class': 'matchTime'}).text
234
+ rating = int(match['stars'])
235
+ if rating >= star_rating:
236
+ maps = match.find('div', {'class': 'matchMeta'}).text[-1:]
237
+ try:
238
+ teams = match.find_all('div', {'class': 'matchTeamName text-ellipsis'})
239
+
240
+ team1 = teams[0].text
241
+ team2 = teams[1].text
242
+ except (IndexError, AttributeError):
243
+ team1 = 'TBD'
244
+ team2 = 'TBD'
245
+
246
+ try:
247
+ event = match.find('div', {'class', 'matchEventName gtSmartphone-only'}).text
248
+ except AttributeError:
249
+
250
+ try:
251
+ event = match.find('span', {'class': 'line-clamp-3'}).text
252
+ except AttributeError:
253
+ event = ''
254
+
255
+ matches_today.append({
256
+ 'team1': team1,
257
+ 'team2': team2,
258
+ 'time': time_,
259
+ 'maps': maps,
260
+ 'rating': rating,
261
+ 'event': event
262
+ })
263
+
264
+ matches.append({
265
+ 'date': date_,
266
+ 'matches': matches_today
267
+ })
225
268
  except AttributeError:
226
269
  return None
227
- return [(team1, team2) for team1, team2 in tuple(zip(teams, teams[1:]))[::2]]
270
+ return matches
228
271
 
229
272
  async def get_important_upcoming_matches(self, star_rating=1):
230
273
  """returns a list of all upcoming matches on HLTV with the star rating argument (should be between 0 and 5)"""
@@ -536,7 +579,7 @@ class Hltv:
536
579
  except AttributeError:
537
580
  pass
538
581
 
539
- return (team_id, title, rank, players, coach, age, weeks, last_trophy, total_trophys)
582
+ return team_id, title, rank, players, coach, age, weeks, last_trophy, total_trophys
540
583
  except AttributeError:
541
584
  raise AttributeError("Parsing error, probably page not fully loaded")
542
585
 
@@ -586,18 +629,69 @@ class Hltv:
586
629
  if rank > top:
587
630
  break
588
631
  except AttributeError:
589
- raise AttributeError("Parsing error, probably page not fully loaded")
632
+ raise AttributeError("Top players parsing error, probably page not fully loaded")
590
633
 
591
634
  return players
592
635
 
593
636
  # TODO WRITE
594
- async def get_last_news(self):
595
- return []
637
+ async def get_last_news(self, max_reg_news=2, only_today=True, only_featured=False):
638
+ r = await self.fetch('https://www.hltv.org/')
639
+
640
+ today = datetime.now(tz=pytz.timezone('Europe/Copenhagen'))
641
+ article_days = {
642
+ 1: today.strftime('%d-%m'),
643
+ 2: (today - timedelta(days=1)).strftime('%d-%m'),
644
+ 3: 'old'
645
+ }
646
+
647
+ news = []
648
+ reg_news_num = 0
649
+ for i, news_date_div in enumerate(r.find_all('div', {'class', 'standard-box standard-list'}), start=1):
650
+ date_ = article_days[i]
651
+ f_news = []
652
+ reg_news = []
653
+ for featured_news_div in news_date_div.find_all('a', {'class': 'newsline article featured breaking-featured'}):
654
+ featured_id = featured_news_div['href'].split('/')[2]
655
+ featured_title = featured_news_div.find('div', {'class': 'featured-newstext'}).text
656
+ featured_description = featured_news_div.find('div', {'class': 'featured-small-newstext'}).text
657
+ f_news.append({
658
+ 'f_id': featured_id,
659
+ 'f_title': featured_title,
660
+ 'f_desc': featured_description,
661
+ })
662
+
663
+ if not only_featured and reg_news_num < max_reg_news:
664
+ for news_div in news_date_div.find_all('a',
665
+ {'class': 'newsline article'}):
666
+ if reg_news_num > max_reg_news:
667
+ break
668
+ if news_div['class'] != 'newsline article featured breaking-featured':
669
+ news_id = news_div['href'].split('/')[2]
670
+ news_title = news_div.find('div', {'class': 'newstext'}).text
671
+ news_posted = news_div.find('div', {'class': 'newsrecent'}).text
672
+
673
+ reg_news.append({
674
+ 'id': news_id,
675
+ 'title': news_title,
676
+ 'posted': news_posted,
677
+ })
678
+ reg_news_num += 1
679
+
680
+ news.append({
681
+ 'date': date_,
682
+ 'f_news': f_news,
683
+ 'news': reg_news,
684
+ })
685
+
686
+ if only_today:
687
+ break
688
+
689
+ return news
596
690
 
597
691
 
598
692
  async def test():
599
693
  hltv = Hltv()
600
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
694
+ print(await hltv.get_last_news(only_today=True, max_reg_news=1))
601
695
 
602
696
 
603
697
  if __name__ == "__main__":
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.1
2
+ Name: hltv_async_api
3
+ Version: 0.2.7
4
+ Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
+ Home-page: https://github.com/akimerslys/aiohltv
6
+ Author: akimerslys
7
+ Author-email: Akim Slys <akimslys2003@gmail.com>
8
+ Project-URL: Homepage, https://github.com/akimerslys/aiohltv
9
+ Project-URL: Issues, https://github.com/akimerslys/aiohltv/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
+
19
+ # Features
20
+
21
+ * New and modern fully async library
22
+
23
+ * Supports proxy usage for rate-limiting and privacy
24
+
25
+ * Automatically changes proxy if access is denied
26
+
27
+
28
+ ---
29
+
30
+ # Installation
31
+
32
+ ```
33
+ pip install hltv-async-api
34
+ ```
35
+
36
+ ---
37
+
38
+
39
+ # Simple Usage
40
+
41
+ ```
42
+ from hltv_async_api import Hltv
43
+
44
+ hltv = Hltv()
45
+ live_matches = await hltv.get_live_matches()
46
+ ```
47
+
48
+ ---
49
+
50
+ # Proxy Usage
51
+
52
+ **Load Proxies from list**
53
+
54
+ ```
55
+ proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
56
+
57
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
58
+ ```
59
+
60
+ **Load Proxies from file**
61
+
62
+ ```
63
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
+ ```
65
+
66
+
67
+ **Remove bad proxy from file**
68
+
69
+ ```
70
+ hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
71
+ ```
72
+
73
+ **Add proxy protocol**
74
+
75
+ ```
76
+ proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
77
+
78
+ hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
79
+ ```
80
+
81
+ ---
82
+ # Methods
83
+ * get_upcoming_matches(days: int = 7, min_star_rating: int = 1)
84
+
85
+ -days (the number of days into the future to fetch matches for)
86
+
87
+ -min_star_rating (the minimum star rating for matches to include)
88
+
89
+ ```
90
+ await hltv.get_upcoming_matches(1, 5)
91
+
92
+ >>> ['date': '11/11/2024', 'matches': [team1: 'Natus Vincere' | 'TBD', team2: 'FaZe' | 'TBD', time: '14:15', maps: '3', stars: 5, 'PGL CS2 Major Copenhagen 2024' | None]]```
93
+
94
+ ```
95
+
96
+ * get_event_results(event_id: int | str)
97
+
98
+
99
+ ```
100
+ await get_event_results(7148)
101
+
102
+ >>> ['date': '31-3', 'team1': 'FaZe', 'team2': 'Natus Vincere', 'score1': '1', 'score2': '2']
103
+
104
+ ```
105
+
106
+ * get_event_matches(event_id: str | int):
107
+
108
+ ```
109
+ await hltv.get_event_matches(7148)
110
+
111
+ >>>['team1': 'Natus Vincere', 'team2': 'FaZe', 'date': '11-11' | 'LIVE']
112
+ ```
113
+
114
+ * get_event_info(event_id: str | int, event_title: str) -> (event_id, event_title, event_start, event_end, prize, team_num, location, groups)
115
+
116
+ ```
117
+ await hltv.get_event_info(7148, 'PGL CS2 Major Copenhagen2024')
118
+
119
+ (7148, 'PGL CS2 Major Copenhagen2024', '21-3', '31-3', '$1,250,000', '16', 'Copenhagen, Denmark', [])
120
+ ```
121
+
122
+
123
+ get_top_teams(max_teams=30) -> ['rank', 'title', 'points', 'change', 'id']
124
+
125
+ ```
126
+ await hltv.get_top_teams(2)
127
+
128
+ >>>[{'rank': '1', 'title': 'FaZe', 'points': '939', 'change': '-', 'id': '6667'}, {'rank': '2', 'title': 'Natus Vincere', 'points': '757', 'change': '+4', 'id': '4608'}]
129
+ ```
130
+
131
+ get_team_info(team_id: int | str, title: str) -> (team_id, team_title, rank, [players], coach, average_age, weeks_in_top_20, last_trophy, total_trophys)
132
+
133
+ ```
134
+ await hltv.get_team_info(6667, 'faze')
135
+
136
+ >>>(6667, 'faze', '1', ['karrigan', 'rain', 'frozen', 'ropz', 'broky'], 'NEO', '26.5', '256', 'CS Asia Championships 2023', 21)
137
+ ```
138
+
139
+ get_last_news(self, max_reg_news=2, only_today=True, only_featured=False) -> [date, [featured_id, featured_title, featured_desciption], [regular_id, reg_title, reg_time]]
140
+
141
+ ```
142
+ await hltv.get_last_news(only_today=True, max_reg_news=1)
143
+
144
+ >>>[{'date': '02-04', 'f_news': [{'f_id': '38682', 'f_title': 'NIP confirm r1nkle signing', 'f_desc': "Ninjas in Pyjamas only have an anchor player left to sign following the young Ukrainian AWPer's addition."}], 'news': [{'id': '38685', 'title': 'Rounds add sLowi, p3kko', 'posted': 'an hour ago'}, {'id': '38690', 'title': 'n1ssim returns to Sharks after paiN loan deal expires', 'posted': 'an hour ago'}]}]
145
+ ```
146
+ ---
147
+ # Examples
148
+
149
+ ****Simple Example****
150
+
151
+ ```
152
+ from hltv_async_api import Hltv
153
+
154
+
155
+ async def test():
156
+
157
+ hltv = Hltv()
158
+
159
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
160
+
161
+ if __name__ == "__main__":
162
+ asyncio.run(test())
163
+ ```
164
+
165
+ ****Proxy Parser****
166
+ ```
167
+ from hltv_async_api import Hltv
168
+
169
+
170
+ async def test():
171
+
172
+ hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
173
+
174
+ print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
175
+
176
+ if __name__ == "__main__":
177
+ asyncio.run(test())
178
+ ```
179
+
180
+
181
+ # Requirements:
182
+
183
+ Python 3.9+
184
+
185
+ License:
186
+ HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hltv_async_api"
3
- version = "0.2.5"
3
+ version = "0.2.7"
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.2.5',
5
+ version='0.2.7',
6
6
  author='akimerslys',
7
7
  author_email='akimslys2003@gmail.com',
8
8
  description='Hltv-aio: An unofficial asynchronous HLTV API Wrapper for Python',
@@ -1,121 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: hltv_async_api
3
- Version: 0.2.5
4
- Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
- Home-page: https://github.com/akimerslys/aiohltv
6
- Author: akimerslys
7
- Author-email: Akim Slys <akimslys2003@gmail.com>
8
- Project-URL: Homepage, https://github.com/akimerslys/aiohltv
9
- Project-URL: Issues, https://github.com/akimerslys/aiohltv/issues
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.9
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
-
17
- # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
-
19
- # Features
20
-
21
- * New and modern fully async library
22
-
23
- * Supports proxy usage for rate-limiting and privacy
24
-
25
- * Automatically changes proxy if access is denied
26
-
27
-
28
- ---
29
-
30
- # Installation
31
-
32
- ```
33
- pip install hltv_async_api
34
- ```
35
-
36
- ---
37
-
38
-
39
- # Simple Usage
40
-
41
- ```
42
- from hltv_async_api import Hltv
43
-
44
- hltv = Hltv()
45
- live_matches = await hltv.get_live_matches()
46
- ```
47
-
48
- ---
49
-
50
- # Proxy Usage
51
-
52
- **Load Proxies from list**
53
-
54
- ```
55
- proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
56
-
57
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
58
- ```
59
-
60
- **Load Proxies from file**
61
-
62
- ```
63
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
- ```
65
-
66
-
67
- **Remove bad proxy from file**
68
-
69
- ```
70
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
71
- ```
72
-
73
- **Add proxy protocol**
74
-
75
- ```
76
- proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
77
-
78
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
79
- ```
80
- ---
81
- # Examples
82
-
83
- ****Simple Example****
84
-
85
- ```
86
- from hltv_async_api import Hltv
87
-
88
-
89
- async def test():
90
-
91
- hltv = Hltv()
92
-
93
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
94
-
95
- if __name__ == "__main__":
96
- asyncio.run(test())
97
- ```
98
-
99
-
100
- ****Proxy Parser****
101
- ```
102
- from hltv_async_api import Hltv
103
-
104
-
105
- async def test():
106
-
107
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
108
-
109
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
110
-
111
- if __name__ == "__main__":
112
- asyncio.run(test())
113
- ```
114
-
115
-
116
- # Requirements:
117
-
118
- Python 3.9+
119
-
120
- License:
121
- HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
@@ -1,105 +0,0 @@
1
- # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
2
-
3
- # Features
4
-
5
- * New and modern fully async library
6
-
7
- * Supports proxy usage for rate-limiting and privacy
8
-
9
- * Automatically changes proxy if access is denied
10
-
11
-
12
- ---
13
-
14
- # Installation
15
-
16
- ```
17
- pip install hltv_async_api
18
- ```
19
-
20
- ---
21
-
22
-
23
- # Simple Usage
24
-
25
- ```
26
- from hltv_async_api import Hltv
27
-
28
- hltv = Hltv()
29
- live_matches = await hltv.get_live_matches()
30
- ```
31
-
32
- ---
33
-
34
- # Proxy Usage
35
-
36
- **Load Proxies from list**
37
-
38
- ```
39
- proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
40
-
41
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
42
- ```
43
-
44
- **Load Proxies from file**
45
-
46
- ```
47
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
48
- ```
49
-
50
-
51
- **Remove bad proxy from file**
52
-
53
- ```
54
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
55
- ```
56
-
57
- **Add proxy protocol**
58
-
59
- ```
60
- proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
61
-
62
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
63
- ```
64
- ---
65
- # Examples
66
-
67
- ****Simple Example****
68
-
69
- ```
70
- from hltv_async_api import Hltv
71
-
72
-
73
- async def test():
74
-
75
- hltv = Hltv()
76
-
77
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
78
-
79
- if __name__ == "__main__":
80
- asyncio.run(test())
81
- ```
82
-
83
-
84
- ****Proxy Parser****
85
- ```
86
- from hltv_async_api import Hltv
87
-
88
-
89
- async def test():
90
-
91
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
92
-
93
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
94
-
95
- if __name__ == "__main__":
96
- asyncio.run(test())
97
- ```
98
-
99
-
100
- # Requirements:
101
-
102
- Python 3.9+
103
-
104
- License:
105
- HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
@@ -1,121 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: hltv_async_api
3
- Version: 0.2.5
4
- Summary: Hltv-aio An unofficial asynchronous HLTV API Wrapper for Python
5
- Home-page: https://github.com/akimerslys/aiohltv
6
- Author: akimerslys
7
- Author-email: Akim Slys <akimslys2003@gmail.com>
8
- Project-URL: Homepage, https://github.com/akimerslys/aiohltv
9
- Project-URL: Issues, https://github.com/akimerslys/aiohltv/issues
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.9
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
-
17
- # hltv-async-api an unofficial asynchronous HLTV API Wrapper for Python
18
-
19
- # Features
20
-
21
- * New and modern fully async library
22
-
23
- * Supports proxy usage for rate-limiting and privacy
24
-
25
- * Automatically changes proxy if access is denied
26
-
27
-
28
- ---
29
-
30
- # Installation
31
-
32
- ```
33
- pip install hltv_async_api
34
- ```
35
-
36
- ---
37
-
38
-
39
- # Simple Usage
40
-
41
- ```
42
- from hltv_async_api import Hltv
43
-
44
- hltv = Hltv()
45
- live_matches = await hltv.get_live_matches()
46
- ```
47
-
48
- ---
49
-
50
- # Proxy Usage
51
-
52
- **Load Proxies from list**
53
-
54
- ```
55
- proxy_list = ['http://120.234.203.171:9002', 'http://110.38.68.38:80']
56
-
57
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list)
58
- ```
59
-
60
- **Load Proxies from file**
61
-
62
- ```
63
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT')
64
- ```
65
-
66
-
67
- **Remove bad proxy from file**
68
-
69
- ```
70
- hltv = Hltv(use_proxy=True, proxy_path='PATH_TO_PROXY.TXT', remove_proxy=True)
71
- ```
72
-
73
- **Add proxy protocol**
74
-
75
- ```
76
- proxy_list = ['120.234.203.171:9002', '110.38.68.38:80']
77
-
78
- hltv = Hltv(use_proxy=True, proxy_list=proxy_list, proxy_protocol='http')
79
- ```
80
- ---
81
- # Examples
82
-
83
- ****Simple Example****
84
-
85
- ```
86
- from hltv_async_api import Hltv
87
-
88
-
89
- async def test():
90
-
91
- hltv = Hltv()
92
-
93
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
94
-
95
- if __name__ == "__main__":
96
- asyncio.run(test())
97
- ```
98
-
99
-
100
- ****Proxy Parser****
101
- ```
102
- from hltv_async_api import Hltv
103
-
104
-
105
- async def test():
106
-
107
- hltv = Hltv(debug=True, use_proxy=True, proxy_path='proxy_test.txt', timeout=1, remove_proxy=True, proxy_protocol='http')
108
-
109
- print(await hltv.get_event_info(7148, 'pgl-cs2-major-copenhagen-2024'))
110
-
111
- if __name__ == "__main__":
112
- asyncio.run(test())
113
- ```
114
-
115
-
116
- # Requirements:
117
-
118
- Python 3.9+
119
-
120
- License:
121
- HLTV Async is licensed under the MIT License, allowing for personal and commercial use with minimal restrictions.
File without changes
File without changes