vlrdevapi 1.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vansh Bordia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,413 @@
1
+ Metadata-Version: 2.4
2
+ Name: vlrdevapi
3
+ Version: 1.0.0
4
+ Summary: The comprehensive Python library for VLR.gg Valorant esports data scraping - tournaments, matches, players, and statistics
5
+ Author: Vansh
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Vansh Bordia
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/vanshbordia/vlrdevapi
29
+ Project-URL: Documentation, https://vlrdevapi.readthedocs.io
30
+ Project-URL: Source, https://github.com/vanshbordia/vlrdevapi
31
+ Project-URL: Issues, https://github.com/vanshbordia/vlrdevapi/issues
32
+ Keywords: valorant,esports,vlr,vlr.gg,scraper,api,gaming,competitive,tournament,statistics,data,vct,web-scraping
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Programming Language :: Python :: 3.13
41
+ Classifier: Programming Language :: Python :: 3.14
42
+ Classifier: Topic :: Internet :: WWW/HTTP
43
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
44
+ Requires-Python: >=3.11
45
+ Description-Content-Type: text/markdown
46
+ License-File: LICENSE
47
+ Requires-Dist: beautifulsoup4>=4.12
48
+ Requires-Dist: lxml>=5.0
49
+ Requires-Dist: pydantic>=2.0
50
+ Provides-Extra: test
51
+ Requires-Dist: pytest>=8.0.0; extra == "test"
52
+ Provides-Extra: dev
53
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
54
+ Requires-Dist: ruff>=0.6.0; extra == "dev"
55
+ Dynamic: license-file
56
+
57
+ # vlrdevapi
58
+
59
+ **The Python library for VLR.gg Valorant esports data scraping and API access.**
60
+
61
+ vlrdevapi is a comprehensive, type-safe Python client library designed specifically for scraping and accessing Valorant esports data from VLR.gg. As there is no official VLR.gg API, this library provides a standardized, reliable, and efficient way to programmatically access tournament information, match data, player statistics, and more.
62
+
63
+ ## Why vlrdevapi?
64
+
65
+ vlrdevapi is the fastest and most complete solution for Valorant esports data extraction:
66
+
67
+ - **Comprehensive Coverage**: Events, matches, players, series, teams, and statistics
68
+ - **Type-Safe**: Full Pydantic models with automatic validation
69
+ - **Production-Ready**: Built-in retry logic, error handling, and rate limit protection
70
+ - **Developer-Friendly**: Intuitive API design with extensive documentation
71
+ - **Well-Maintained**: Active development with regular updates
72
+ - **Open Source**: MIT licensed, community-driven development
73
+
74
+ ## Key Features
75
+
76
+ ### Data Access
77
+
78
+ | Feature | Description |
79
+ |---------|-------------|
80
+ | **Events API** | List, filter, and access tournament/event data including schedules, prize pools, and standings |
81
+ | **Matches API** | Get upcoming, live, and completed match information with real-time scores |
82
+ | **Players API** | Access player profiles, statistics, match history, and agent performance data |
83
+ | **Series API** | Detailed match analytics including map picks/bans, player stats, and round results |
84
+
85
+ ### Technical Features
86
+
87
+ - **Type Safety**: Complete Pydantic model coverage with automatic validation
88
+ - **Error Handling**: Built-in retry logic with exponential backoff
89
+ - **Rate Limiting**: Automatic rate limit detection and handling
90
+ - **Caching**: Intelligent response caching to reduce API calls
91
+ - **Fast Parsing**: lxml-based HTML parsing for optimal performance
92
+ - **Connection Pooling**: Persistent HTTP connections for reduced latency
93
+
94
+ ## Installation
95
+
96
+ Requires Python 3.11 or higher.
97
+
98
+ ```bash
99
+ pip install vlrdevapi
100
+ ```
101
+
102
+ ### Development Installation
103
+
104
+ ```bash
105
+ git clone https://github.com/vanshbordia/vlrdevapi.git
106
+ cd vlrdevapi
107
+ pip install -e .[dev]
108
+ ```
109
+
110
+ ## Quick Start
111
+
112
+ ```python
113
+ import vlrdevapi as vlr
114
+
115
+ # List VCT events
116
+ events = vlr.events.list_events(tier="vct", status="ongoing")
117
+ for event in events:
118
+ print(f"{event.name} - {event.status}")
119
+
120
+ # Get upcoming matches
121
+ matches = vlr.matches.upcoming(limit=5)
122
+ for match in matches:
123
+ print(f"{match.teams[0]} vs {match.teams[1]} - {match.event}")
124
+
125
+ # Player profile and stats
126
+ profile = vlr.players.profile(player_id=4164)
127
+ print(f"{profile.handle} ({profile.real_name}) - {profile.country}")
128
+
129
+ agent_stats = vlr.players.agent_stats(player_id=4164, timespan="60d")
130
+ for stat in agent_stats:
131
+ print(f"{stat.agent}: {stat.rating} rating, {stat.acs} ACS")
132
+
133
+ # Series information
134
+ info = vlr.series.info(match_id=530935)
135
+ print(f"{info.teams[0].name} vs {info.teams[1].name}")
136
+ print(f"Score: {info.score[0]}-{info.score[1]}")
137
+ ```
138
+
139
+ ## Complete API Reference
140
+
141
+ ### Events Module - Tournament and Competition Data
142
+
143
+ ```python
144
+ import vlrdevapi as vlr
145
+
146
+ # List events with filters
147
+ events = vlr.events.list_events(
148
+ tier="vct", # "all", "vct", "vcl", "t3", "gc", "cg", "offseason"
149
+ region="na", # Optional region filter
150
+ status="ongoing", # "all", "upcoming", "ongoing", "completed"
151
+ page=1
152
+ )
153
+
154
+ # Get event details
155
+ info = vlr.events.info(event_id=2498)
156
+
157
+ # Get event matches
158
+ matches = vlr.events.matches(event_id=2498)
159
+
160
+ # Get event standings
161
+ standings = vlr.events.standings(event_id=2498)
162
+ ```
163
+
164
+ ### Matches Module - Match Schedules and Results
165
+
166
+ ```python
167
+ import vlrdevapi as vlr
168
+
169
+ # Upcoming matches
170
+ upcoming = vlr.matches.upcoming(limit=10)
171
+
172
+ # Live matches
173
+ live = vlr.matches.live()
174
+
175
+ # Completed matches
176
+ completed = vlr.matches.completed(limit=10, page=1)
177
+ ```
178
+
179
+ ### Players Module - Player Information and Statistics
180
+
181
+ ```python
182
+ import vlrdevapi as vlr
183
+
184
+ # Player profile
185
+ profile = vlr.players.profile(player_id=4164)
186
+
187
+ # Player match history
188
+ matches = vlr.players.matches(player_id=4164, limit=20)
189
+
190
+ # Agent statistics
191
+ stats = vlr.players.agent_stats(
192
+ player_id=4164,
193
+ timespan="60d" # "30d", "60d", "90d", "all"
194
+ )
195
+ ```
196
+
197
+ ### Series Module - Detailed Match Analytics
198
+
199
+ ```python
200
+ import vlrdevapi as vlr
201
+
202
+ # Series/match information
203
+ info = vlr.series.info(match_id=530935)
204
+
205
+ # Detailed map statistics
206
+ maps = vlr.series.matches(series_id=530935)
207
+ for map_data in maps:
208
+ print(f"Map: {map_data.map_name}")
209
+ for player in map_data.players:
210
+ print(f" {player.name}: {player.k}/{player.d}/{player.a}")
211
+ ```
212
+
213
+ ## Data Models and Type Safety
214
+
215
+ All API responses are returned as immutable Pydantic models with complete type hints:
216
+
217
+ | Model | Purpose | Key Fields |
218
+ |-------|---------|------------|
219
+ | `ListEvent` | Event list entries | id, name, status, dates, prize |
220
+ | `Info` | Detailed event data | name, prize, location, regions |
221
+ | `Match` | Match information | teams, score, event, status |
222
+ | `Profile` | Player profiles | handle, real_name, country, teams |
223
+ | `AgentStats` | Agent performance | agent, rating, acs, kd, kast |
224
+ | `MapPlayers` | Map statistics | map_name, players, teams, rounds |
225
+
226
+ ### Model Features
227
+
228
+ - **Immutable**: All models are frozen after creation
229
+ - **Validated**: Automatic data validation using Pydantic
230
+ - **Serializable**: Easy conversion to dict/JSON
231
+ - **Type-Hinted**: Full IDE autocomplete support
232
+
233
+ ```python
234
+ # Access model fields
235
+ profile = vlr.players.profile(player_id=4164)
236
+ print(profile.handle) # IDE autocomplete works
237
+
238
+ # Convert to dictionary
239
+ data = profile.model_dump()
240
+
241
+ # Serialize to JSON
242
+ json_str = profile.model_dump_json()
243
+ ```
244
+
245
+ ## Use Cases
246
+
247
+ vlrdevapi is perfect for:
248
+
249
+ - **Data Analysis**: Build analytics dashboards and statistics trackers
250
+ - **Betting Tools**: Create prediction models and odds calculators
251
+ - **Tournament Tracking**: Monitor ongoing events and match results
252
+ - **Player Scouting**: Analyze player performance across agents and maps
253
+ - **Content Creation**: Generate automated match reports and summaries
254
+ - **Discord Bots**: Real-time match notifications and statistics
255
+ - **Research**: Academic studies on esports performance and trends
256
+
257
+ ## Advanced Usage
258
+
259
+ ### Pagination
260
+
261
+ Many functions support pagination for large datasets:
262
+
263
+ ```python
264
+ import vlrdevapi as vlr
265
+
266
+ # Get specific page
267
+ events = vlr.events.list_events(tier="vct", page=2)
268
+
269
+ # Limit results
270
+ matches = vlr.matches.upcoming(limit=20)
271
+
272
+ # Combine pagination with limits
273
+ results = vlr.matches.completed(limit=50, page=1)
274
+ ```
275
+
276
+ ### Filtering
277
+
278
+ Filter data by multiple criteria:
279
+
280
+ ```python
281
+ # Filter events by tier and status
282
+ vct_events = vlr.events.list_events(
283
+ tier="vct",
284
+ region="na",
285
+ status="ongoing"
286
+ )
287
+
288
+ # Filter player stats by timespan
289
+ recent_stats = vlr.players.agent_stats(
290
+ player_id=4164,
291
+ timespan="30d" # Options: "30d", "60d", "90d", "all"
292
+ )
293
+ ```
294
+
295
+ ### Cache Management
296
+
297
+ ```python
298
+ import vlrdevapi as vlr
299
+
300
+ # Clear cache for fresh data
301
+ vlr.fetcher.clear_cache()
302
+
303
+ # Close connections on shutdown
304
+ vlr.fetcher.close_connections()
305
+ ```
306
+
307
+ ## Error Handling
308
+
309
+ The library raises specific exceptions for different error cases:
310
+
311
+ ```python
312
+ from vlrdevapi.exceptions import NetworkError, RateLimitError
313
+
314
+ try:
315
+ events = vlr.events.list_events()
316
+ except RateLimitError:
317
+ print("Rate limited by VLR.gg")
318
+ except NetworkError as e:
319
+ print(f"Network error: {e}")
320
+ ```
321
+
322
+ ## Testing
323
+
324
+ The library includes comprehensive tests with real HTML fixtures:
325
+
326
+ ```bash
327
+ # Run all tests
328
+ pytest tests/lib/
329
+
330
+ # Run with coverage
331
+ pytest tests/lib/ --cov=vlrdevapi
332
+
333
+ # Run specific test module
334
+ pytest tests/lib/test_events.py -v
335
+ ```
336
+
337
+ ## Documentation and Resources
338
+
339
+ ### Official Documentation
340
+
341
+ - **[Complete API Reference](https://vlrdevapi.readthedocs.io/)** - Full function and model documentation
342
+ - **[Usage Examples](https://vlrdevapi.readthedocs.io/en/latest/examples.html)** - Practical code examples
343
+ - **[Data Models](https://vlrdevapi.readthedocs.io/en/latest/models.html)** - Model schemas and validation
344
+ - **[Installation Guide](https://vlrdevapi.readthedocs.io/en/latest/installation.html)** - Setup and troubleshooting
345
+
346
+ ### Community and Support
347
+
348
+ - **GitHub**: [github.com/vanshbordia/vlrdevapi](https://github.com/vanshbordia/vlrdevapi)
349
+ - **Issues**: [Report bugs or request features](https://github.com/vanshbordia/vlrdevapi/issues)
350
+ - **Discussions**: [Community Q&A](https://github.com/vanshbordia/vlrdevapi/discussions)
351
+
352
+ ## Frequently Asked Questions
353
+
354
+ ### Is this an official VLR.gg API?
355
+
356
+ No. VLR.gg does not provide an official API. vlrdevapi is a community-maintained web scraping library that provides programmatic access to publicly available data on VLR.gg.
357
+
358
+ ### Is web scraping legal?
359
+
360
+ vlrdevapi only accesses publicly available data and respects VLR.gg's servers with built-in rate limiting, caching, and retry logic. Always use the library responsibly.
361
+
362
+ ### What Python versions are supported?
363
+
364
+ Python 3.11 and higher. The library uses modern Python features including type hints and pattern matching.
365
+
366
+ ### How do I get player/event IDs?
367
+
368
+ IDs can be found in VLR.gg URLs. For example, in `https://www.vlr.gg/player/4164/aspas`, the player ID is `4164`.
369
+
370
+ ### Does it support other games?
371
+
372
+ No. vlrdevapi is specifically designed for Valorant esports data from VLR.gg.
373
+
374
+ ## Project Structure
375
+
376
+ ```
377
+ vlrdevapi/
378
+ ├── src/vlrdevapi/ # Source code
379
+ │ ├── events.py # Events API
380
+ │ ├── matches.py # Matches API
381
+ │ ├── players.py # Players API
382
+ │ ├── series.py # Series API
383
+ │ ├── fetcher.py # HTTP client
384
+ │ ├── utils.py # Parsing utilities
385
+ │ ├── exceptions.py # Custom exceptions
386
+ │ └── constants.py # Configuration
387
+ ├── tests/ # Test suite
388
+ │ ├── lib/ # Library tests
389
+ │ └── html_sources/ # HTML fixtures
390
+ ├── docs/ # Documentation
391
+ └── pyproject.toml # Package configuration
392
+ ```
393
+
394
+ ## Contributing
395
+
396
+ Contributions are welcome! Please ensure:
397
+
398
+ 1. All tests pass: `pytest tests/lib/`
399
+ 2. Code follows project style
400
+ 3. New features include tests and documentation
401
+
402
+ ## License
403
+
404
+ Released under the MIT License. See LICENSE for details.
405
+
406
+
407
+ ## Disclaimer
408
+
409
+ This library scrapes data from VLR.gg. Please use responsibly and respect their terms of service. The library includes rate limiting protection and caching to minimize server load. vlrdevapi is not affiliated with or endorsed by VLR.gg or Riot Games.
410
+
411
+ ## Version
412
+
413
+ Current version: **1.0.0**