crawlora-sofascore 0.3.3__tar.gz → 0.3.5__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.
- crawlora_sofascore-0.3.5/PKG-INFO +214 -0
- crawlora_sofascore-0.3.5/README.md +190 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/__init__.py +1 -1
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/platform.py +2 -2
- crawlora_sofascore-0.3.5/crawlora_sofascore.egg-info/PKG-INFO +214 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/pyproject.toml +3 -2
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/tests/test_package.py +1 -1
- crawlora_sofascore-0.3.3/PKG-INFO +0 -96
- crawlora_sofascore-0.3.3/README.md +0 -73
- crawlora_sofascore-0.3.3/crawlora_sofascore.egg-info/PKG-INFO +0 -96
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/LICENSE +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/__init__.pyi +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/_pagination.py +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/_transport_sync.py +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/async_client.py +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/client.py +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/operations.py +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/platform.pyi +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore/py.typed +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/SOURCES.txt +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/dependency_links.txt +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/requires.txt +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/top_level.txt +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/setup.cfg +0 -0
- {crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/tests/test_types.py +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: crawlora-sofascore
|
|
3
|
+
Version: 0.3.5
|
|
4
|
+
Summary: Crawlora SofaScore API client with 109 endpoints for live events, match details, lineups, statistics, tournaments, and player/team data
|
|
5
|
+
Author: Crawlora
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage
|
|
8
|
+
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-api-docs
|
|
9
|
+
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-sofascore
|
|
10
|
+
Keywords: crawlora,api-client,sdk,web-scraping,scraping-api,sofascore,sofascore-api,sofascore-scraper,sofascore-data,sofascore-live-events,sofascore-match-details,sofascore-lineups,sofascore-statistics,sofascore-tournaments,sofascore-player-team-data
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typing-extensions>=4.7; python_version < "3.11"
|
|
18
|
+
Provides-Extra: async
|
|
19
|
+
Requires-Dist: httpx>=0.27; extra == "async"
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Requires-Dist: mypy>=1.11; extra == "test"
|
|
22
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# crawlora-sofascore — SofaScore API client for Python
|
|
26
|
+
|
|
27
|
+
Python client for Crawlora's hosted SofaScore API. It exposes 109 API endpoints covering live events, match details, lineups, statistics, tournaments, and player/team data. Requests go to [Crawlora](https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); the package does not run a browser or scrape
|
|
28
|
+
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
29
|
+
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
30
|
+
SofaScore or its owners.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
python -m pip install crawlora-sofascore
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Get an API key
|
|
39
|
+
|
|
40
|
+
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Use
|
|
47
|
+
|
|
48
|
+
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import os
|
|
52
|
+
|
|
53
|
+
from crawlora_sofascore import SofascoreClient
|
|
54
|
+
|
|
55
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
56
|
+
if not api_key:
|
|
57
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
58
|
+
|
|
59
|
+
with SofascoreClient(api_key=api_key) as client:
|
|
60
|
+
result_1 = client.search(q='Liverpool')
|
|
61
|
+
print(result_1)
|
|
62
|
+
result_2 = client.live_events(sport='football')
|
|
63
|
+
print(result_2)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
67
|
+
methods are available directly in snake_case and through the `sofascore`
|
|
68
|
+
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
69
|
+
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
70
|
+
|
|
71
|
+
### Async usage
|
|
72
|
+
|
|
73
|
+
The package also exports `AsyncClient` for asynchronous requests:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import asyncio
|
|
77
|
+
import os
|
|
78
|
+
|
|
79
|
+
from crawlora_sofascore import AsyncClient
|
|
80
|
+
|
|
81
|
+
async def main():
|
|
82
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
83
|
+
if not api_key:
|
|
84
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
85
|
+
async with AsyncClient(api_key=api_key) as client:
|
|
86
|
+
result_1 = await client.search(q='Liverpool')
|
|
87
|
+
print(result_1)
|
|
88
|
+
|
|
89
|
+
asyncio.run(main())
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See the [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py) for a complete usage example.
|
|
93
|
+
|
|
94
|
+
## Supported SofaScore API endpoints
|
|
95
|
+
|
|
96
|
+
This package exposes every route below through direct snake_case methods and the `sofascore` group. See the [endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) for complete input details.
|
|
97
|
+
|
|
98
|
+
| Method | Endpoint | API operation | Description |
|
|
99
|
+
| --- | --- | --- | --- |
|
|
100
|
+
| `GET` | `/sofascore/categories` | `sofascore-categories` | SofaScore categories for a sport |
|
|
101
|
+
| `GET` | `/sofascore/category-tournaments` | `sofascore-category-tournaments` | SofaScore competitions in a category |
|
|
102
|
+
| `GET` | `/sofascore/draft` | `sofascore-draft` | SofaScore league draft |
|
|
103
|
+
| `GET` | `/sofascore/draft-picks` | `sofascore-draft-picks` | SofaScore league draft picks |
|
|
104
|
+
| `GET` | `/sofascore/esports-game` | `sofascore-esports-game` | SofaScore esports game detail |
|
|
105
|
+
| `GET` | `/sofascore/event` | `sofascore-event` | SofaScore event detail |
|
|
106
|
+
| `GET` | `/sofascore/event-at-bat-pitches` | `sofascore-event-at-bat-pitches` | SofaScore event at-bat pitches |
|
|
107
|
+
| `GET` | `/sofascore/event-at-bats` | `sofascore-event-at-bats` | SofaScore event at-bats |
|
|
108
|
+
| `GET` | `/sofascore/event-average-positions` | `sofascore-event-average-positions` | SofaScore event average positions |
|
|
109
|
+
| `GET` | `/sofascore/event-baseball-top-performers` | `sofascore-event-baseball-top-performers` | SofaScore event baseball top performers |
|
|
110
|
+
| `GET` | `/sofascore/event-best-players` | `sofascore-event-best-players` | SofaScore event best players |
|
|
111
|
+
| `GET` | `/sofascore/event-comments` | `sofascore-event-comments` | SofaScore event commentary |
|
|
112
|
+
| `GET` | `/sofascore/event-esports-games` | `sofascore-event-esports-games` | SofaScore event esports games |
|
|
113
|
+
| `GET` | `/sofascore/event-graph` | `sofascore-event-graph` | SofaScore event momentum graph |
|
|
114
|
+
| `GET` | `/sofascore/event-h2h` | `sofascore-event-h2h` | SofaScore event head-to-head |
|
|
115
|
+
| `GET` | `/sofascore/event-highlights` | `sofascore-event-highlights` | SofaScore event highlights |
|
|
116
|
+
| `GET` | `/sofascore/event-incidents` | `sofascore-event-incidents` | SofaScore event incidents |
|
|
117
|
+
| `GET` | `/sofascore/event-innings` | `sofascore-event-innings` | SofaScore event innings |
|
|
118
|
+
| `GET` | `/sofascore/event-lineups` | `sofascore-event-lineups` | SofaScore event lineups |
|
|
119
|
+
| `GET` | `/sofascore/event-managers` | `sofascore-event-managers` | SofaScore event managers |
|
|
120
|
+
| `GET` | `/sofascore/event-odds` | `sofascore-event-odds` | SofaScore event odds |
|
|
121
|
+
| `GET` | `/sofascore/event-player-heatmap` | `sofascore-event-player-heatmap` | SofaScore event player heatmap |
|
|
122
|
+
| `GET` | `/sofascore/event-player-statistics` | `sofascore-event-player-statistics` | SofaScore event player statistics |
|
|
123
|
+
| `GET` | `/sofascore/event-point-by-point` | `sofascore-event-point-by-point` | SofaScore event point-by-point |
|
|
124
|
+
| `GET` | `/sofascore/event-pregame-form` | `sofascore-event-pregame-form` | SofaScore event pre-game form |
|
|
125
|
+
| `GET` | `/sofascore/event-shotmap` | `sofascore-event-shotmap` | SofaScore event shot map |
|
|
126
|
+
| `GET` | `/sofascore/event-statistics` | `sofascore-event-statistics` | SofaScore event statistics |
|
|
127
|
+
| `GET` | `/sofascore/event-team-heatmap` | `sofascore-event-team-heatmap` | SofaScore event team heatmap |
|
|
128
|
+
| `GET` | `/sofascore/event-team-streaks` | `sofascore-event-team-streaks` | SofaScore event team streaks |
|
|
129
|
+
| `GET` | `/sofascore/event-tennis-power` | `sofascore-event-tennis-power` | SofaScore event tennis power |
|
|
130
|
+
| `GET` | `/sofascore/event-tv-channels` | `sofascore-event-tv-channels` | SofaScore event TV channels |
|
|
131
|
+
| `GET` | `/sofascore/event-votes` | `sofascore-event-votes` | SofaScore event votes |
|
|
132
|
+
| `GET` | `/sofascore/live-events` | `sofascore-live-events` | SofaScore live events |
|
|
133
|
+
| `GET` | `/sofascore/manager` | `sofascore-manager` | SofaScore manager detail |
|
|
134
|
+
| `GET` | `/sofascore/manager-events` | `sofascore-manager-events` | SofaScore manager recent matches |
|
|
135
|
+
| `GET` | `/sofascore/mma-card` | `sofascore-mma-card` | SofaScore MMA card |
|
|
136
|
+
| `GET` | `/sofascore/mma-schedule` | `sofascore-mma-schedule` | SofaScore MMA schedule |
|
|
137
|
+
| `GET` | `/sofascore/odds-dropping` | `sofascore-odds-dropping` | SofaScore dropping odds |
|
|
138
|
+
| `GET` | `/sofascore/odds-winning` | `sofascore-odds-winning` | SofaScore winning odds |
|
|
139
|
+
| `GET` | `/sofascore/player` | `sofascore-player` | SofaScore player detail |
|
|
140
|
+
| `GET` | `/sofascore/player-attributes` | `sofascore-player-attributes` | SofaScore player attributes and characteristics |
|
|
141
|
+
| `GET` | `/sofascore/player-events` | `sofascore-player-events` | SofaScore player matches with per-match numbers |
|
|
142
|
+
| `GET` | `/sofascore/player-last-year-summary` | `sofascore-player-last-year-summary` | SofaScore player form over the last year |
|
|
143
|
+
| `GET` | `/sofascore/player-national-team-statistics` | `sofascore-player-national-team-statistics` | SofaScore player national team record |
|
|
144
|
+
| `GET` | `/sofascore/player-penalty-history` | `sofascore-player-penalty-history` | SofaScore player penalty history |
|
|
145
|
+
| `GET` | `/sofascore/player-ratings` | `sofascore-player-ratings` | SofaScore player match ratings for a season |
|
|
146
|
+
| `GET` | `/sofascore/player-season-heatmap` | `sofascore-player-season-heatmap` | SofaScore player season heatmap |
|
|
147
|
+
| `GET` | `/sofascore/player-season-statistics` | `sofascore-player-season-statistics` | SofaScore player season statistics |
|
|
148
|
+
| `GET` | `/sofascore/player-statistical-rankings` | `sofascore-player-statistical-rankings` | SofaScore player ranking among all players in a season |
|
|
149
|
+
| `GET` | `/sofascore/player-statistics-seasons` | `sofascore-player-statistics-seasons` | SofaScore player statistics seasons |
|
|
150
|
+
| `GET` | `/sofascore/player-tournaments` | `sofascore-player-tournaments` | SofaScore player competitions |
|
|
151
|
+
| `GET` | `/sofascore/player-transfers` | `sofascore-player-transfers` | SofaScore player transfer history |
|
|
152
|
+
| `GET` | `/sofascore/ranking-types` | `sofascore-ranking-types` | SofaScore ranking catalogue |
|
|
153
|
+
| `GET` | `/sofascore/rankings` | `sofascore-rankings` | SofaScore rankings |
|
|
154
|
+
| `GET` | `/sofascore/referee` | `sofascore-referee` | SofaScore referee profile |
|
|
155
|
+
| `GET` | `/sofascore/referee-events` | `sofascore-referee-events` | SofaScore referee officiated matches |
|
|
156
|
+
| `GET` | `/sofascore/referee-statistics` | `sofascore-referee-statistics` | SofaScore referee card statistics |
|
|
157
|
+
| `GET` | `/sofascore/round-events` | `sofascore-round-events` | SofaScore round fixtures |
|
|
158
|
+
| `GET` | `/sofascore/scheduled-events` | `sofascore-scheduled-events` | SofaScore events scheduled in a category on a date |
|
|
159
|
+
| `GET` | `/sofascore/scheduled-tournaments` | `sofascore-scheduled-tournaments` | SofaScore tournaments scheduled on a date |
|
|
160
|
+
| `GET` | `/sofascore/search` | `sofascore-search` | SofaScore universal search |
|
|
161
|
+
| `GET` | `/sofascore/search-typed` | `sofascore-search-typed` | SofaScore search by entity type |
|
|
162
|
+
| `GET` | `/sofascore/season-events` | `sofascore-season-events` | SofaScore season fixtures and results |
|
|
163
|
+
| `GET` | `/sofascore/sports` | `sofascore-sports` | SofaScore supported sports |
|
|
164
|
+
| `GET` | `/sofascore/stage` | `sofascore-stage` | SofaScore motorsport and cycling stage |
|
|
165
|
+
| `GET` | `/sofascore/stage-categories` | `sofascore-stage-categories` | SofaScore motorsport and cycling categories and competitions |
|
|
166
|
+
| `GET` | `/sofascore/stage-driver-performance` | `sofascore-stage-driver-performance` | SofaScore motorsport race progress per driver |
|
|
167
|
+
| `GET` | `/sofascore/stage-featured` | `sofascore-stage-featured` | SofaScore featured motorsport and cycling events |
|
|
168
|
+
| `GET` | `/sofascore/stage-schedule` | `sofascore-stage-schedule` | SofaScore motorsport and cycling events around a date |
|
|
169
|
+
| `GET` | `/sofascore/stage-seasons` | `sofascore-stage-seasons` | SofaScore seasons of a motorsport or cycling competition |
|
|
170
|
+
| `GET` | `/sofascore/stage-standings` | `sofascore-stage-standings` | SofaScore motorsport and cycling stage standings |
|
|
171
|
+
| `GET` | `/sofascore/stage-substages` | `sofascore-stage-substages` | SofaScore children of a motorsport or cycling stage |
|
|
172
|
+
| `GET` | `/sofascore/standings` | `sofascore-standings` | SofaScore standings |
|
|
173
|
+
| `GET` | `/sofascore/team` | `sofascore-team` | SofaScore team detail |
|
|
174
|
+
| `GET` | `/sofascore/team-achievements` | `sofascore-team-achievements` | SofaScore team trophies |
|
|
175
|
+
| `GET` | `/sofascore/team-events` | `sofascore-team-events` | SofaScore team fixtures |
|
|
176
|
+
| `GET` | `/sofascore/team-goal-distributions` | `sofascore-team-goal-distributions` | SofaScore team goals by match minute |
|
|
177
|
+
| `GET` | `/sofascore/team-near-events` | `sofascore-team-near-events` | SofaScore team previous and next match |
|
|
178
|
+
| `GET` | `/sofascore/team-of-the-week` | `sofascore-team-of-the-week` | SofaScore team of the week |
|
|
179
|
+
| `GET` | `/sofascore/team-of-the-week-periods` | `sofascore-team-of-the-week-periods` | SofaScore team of the week periods |
|
|
180
|
+
| `GET` | `/sofascore/team-performance` | `sofascore-team-performance` | SofaScore team recent performance |
|
|
181
|
+
| `GET` | `/sofascore/team-player-statistics` | `sofascore-team-player-statistics` | SofaScore team player statistics |
|
|
182
|
+
| `GET` | `/sofascore/team-player-statistics-seasons` | `sofascore-team-player-statistics-seasons` | SofaScore team player statistics seasons |
|
|
183
|
+
| `GET` | `/sofascore/team-players` | `sofascore-team-players` | SofaScore team players |
|
|
184
|
+
| `GET` | `/sofascore/team-rankings` | `sofascore-team-rankings` | SofaScore team rankings |
|
|
185
|
+
| `GET` | `/sofascore/team-season-statistics` | `sofascore-team-season-statistics` | SofaScore team season statistics |
|
|
186
|
+
| `GET` | `/sofascore/team-statistics-seasons` | `sofascore-team-statistics-seasons` | SofaScore team statistics seasons |
|
|
187
|
+
| `GET` | `/sofascore/team-top-players` | `sofascore-team-top-players` | SofaScore team top players |
|
|
188
|
+
| `GET` | `/sofascore/team-tournaments` | `sofascore-team-tournaments` | SofaScore team competitions |
|
|
189
|
+
| `GET` | `/sofascore/team-transfers` | `sofascore-team-transfers` | SofaScore team transfers |
|
|
190
|
+
| `GET` | `/sofascore/tennis-player-grand-slam-results` | `sofascore-tennis-player-grand-slam-results` | SofaScore tennis player grand slam results |
|
|
191
|
+
| `GET` | `/sofascore/tournament-cuptree` | `sofascore-tournament-cuptree` | SofaScore competition knockout tree |
|
|
192
|
+
| `GET` | `/sofascore/tournament-info` | `sofascore-tournament-info` | SofaScore competition info |
|
|
193
|
+
| `GET` | `/sofascore/tournament-player-of-the-season` | `sofascore-tournament-player-of-the-season` | SofaScore player of the season |
|
|
194
|
+
| `GET` | `/sofascore/tournament-player-statistics` | `sofascore-tournament-player-statistics` | SofaScore season player statistics table |
|
|
195
|
+
| `GET` | `/sofascore/tournament-rounds` | `sofascore-tournament-rounds` | SofaScore competition season rounds |
|
|
196
|
+
| `GET` | `/sofascore/tournament-seasons` | `sofascore-tournament-seasons` | SofaScore competition seasons |
|
|
197
|
+
| `GET` | `/sofascore/tournament-statistics-info` | `sofascore-tournament-statistics-info` | SofaScore player statistics table filters |
|
|
198
|
+
| `GET` | `/sofascore/tournament-team-of-the-season` | `sofascore-tournament-team-of-the-season` | SofaScore team of the season |
|
|
199
|
+
| `GET` | `/sofascore/tournament-teams` | `sofascore-tournament-teams` | SofaScore teams of a competition season |
|
|
200
|
+
| `GET` | `/sofascore/tournament-top-players` | `sofascore-tournament-top-players` | SofaScore season top players |
|
|
201
|
+
| `GET` | `/sofascore/tournament-top-teams` | `sofascore-tournament-top-teams` | SofaScore season top teams |
|
|
202
|
+
| `GET` | `/sofascore/tournament-venues` | `sofascore-tournament-venues` | SofaScore venues of a competition season |
|
|
203
|
+
| `GET` | `/sofascore/tournament-winners` | `sofascore-tournament-winners` | SofaScore past winners of a competition |
|
|
204
|
+
| `GET` | `/sofascore/tournaments-with-feature` | `sofascore-tournaments-with-feature` | SofaScore competitions that carry a feature |
|
|
205
|
+
| `GET` | `/sofascore/trending-events` | `sofascore-trending-events` | SofaScore trending events |
|
|
206
|
+
| `GET` | `/sofascore/trending-players` | `sofascore-trending-players` | SofaScore trending players |
|
|
207
|
+
| `GET` | `/sofascore/venue` | `sofascore-venue` | SofaScore venue |
|
|
208
|
+
| `GET` | `/sofascore/venue-events` | `sofascore-venue-events` | SofaScore matches at a venue |
|
|
209
|
+
|
|
210
|
+
## Configuration
|
|
211
|
+
|
|
212
|
+
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
213
|
+
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
214
|
+
hosted API.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# crawlora-sofascore — SofaScore API client for Python
|
|
2
|
+
|
|
3
|
+
Python client for Crawlora's hosted SofaScore API. It exposes 109 API endpoints covering live events, match details, lineups, statistics, tournaments, and player/team data. Requests go to [Crawlora](https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); the package does not run a browser or scrape
|
|
4
|
+
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
5
|
+
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
6
|
+
SofaScore or its owners.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
python -m pip install crawlora-sofascore
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Get an API key
|
|
15
|
+
|
|
16
|
+
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Use
|
|
23
|
+
|
|
24
|
+
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
import os
|
|
28
|
+
|
|
29
|
+
from crawlora_sofascore import SofascoreClient
|
|
30
|
+
|
|
31
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
32
|
+
if not api_key:
|
|
33
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
34
|
+
|
|
35
|
+
with SofascoreClient(api_key=api_key) as client:
|
|
36
|
+
result_1 = client.search(q='Liverpool')
|
|
37
|
+
print(result_1)
|
|
38
|
+
result_2 = client.live_events(sport='football')
|
|
39
|
+
print(result_2)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
43
|
+
methods are available directly in snake_case and through the `sofascore`
|
|
44
|
+
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
45
|
+
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
46
|
+
|
|
47
|
+
### Async usage
|
|
48
|
+
|
|
49
|
+
The package also exports `AsyncClient` for asynchronous requests:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
import asyncio
|
|
53
|
+
import os
|
|
54
|
+
|
|
55
|
+
from crawlora_sofascore import AsyncClient
|
|
56
|
+
|
|
57
|
+
async def main():
|
|
58
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
59
|
+
if not api_key:
|
|
60
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
61
|
+
async with AsyncClient(api_key=api_key) as client:
|
|
62
|
+
result_1 = await client.search(q='Liverpool')
|
|
63
|
+
print(result_1)
|
|
64
|
+
|
|
65
|
+
asyncio.run(main())
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
See the [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py) for a complete usage example.
|
|
69
|
+
|
|
70
|
+
## Supported SofaScore API endpoints
|
|
71
|
+
|
|
72
|
+
This package exposes every route below through direct snake_case methods and the `sofascore` group. See the [endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) for complete input details.
|
|
73
|
+
|
|
74
|
+
| Method | Endpoint | API operation | Description |
|
|
75
|
+
| --- | --- | --- | --- |
|
|
76
|
+
| `GET` | `/sofascore/categories` | `sofascore-categories` | SofaScore categories for a sport |
|
|
77
|
+
| `GET` | `/sofascore/category-tournaments` | `sofascore-category-tournaments` | SofaScore competitions in a category |
|
|
78
|
+
| `GET` | `/sofascore/draft` | `sofascore-draft` | SofaScore league draft |
|
|
79
|
+
| `GET` | `/sofascore/draft-picks` | `sofascore-draft-picks` | SofaScore league draft picks |
|
|
80
|
+
| `GET` | `/sofascore/esports-game` | `sofascore-esports-game` | SofaScore esports game detail |
|
|
81
|
+
| `GET` | `/sofascore/event` | `sofascore-event` | SofaScore event detail |
|
|
82
|
+
| `GET` | `/sofascore/event-at-bat-pitches` | `sofascore-event-at-bat-pitches` | SofaScore event at-bat pitches |
|
|
83
|
+
| `GET` | `/sofascore/event-at-bats` | `sofascore-event-at-bats` | SofaScore event at-bats |
|
|
84
|
+
| `GET` | `/sofascore/event-average-positions` | `sofascore-event-average-positions` | SofaScore event average positions |
|
|
85
|
+
| `GET` | `/sofascore/event-baseball-top-performers` | `sofascore-event-baseball-top-performers` | SofaScore event baseball top performers |
|
|
86
|
+
| `GET` | `/sofascore/event-best-players` | `sofascore-event-best-players` | SofaScore event best players |
|
|
87
|
+
| `GET` | `/sofascore/event-comments` | `sofascore-event-comments` | SofaScore event commentary |
|
|
88
|
+
| `GET` | `/sofascore/event-esports-games` | `sofascore-event-esports-games` | SofaScore event esports games |
|
|
89
|
+
| `GET` | `/sofascore/event-graph` | `sofascore-event-graph` | SofaScore event momentum graph |
|
|
90
|
+
| `GET` | `/sofascore/event-h2h` | `sofascore-event-h2h` | SofaScore event head-to-head |
|
|
91
|
+
| `GET` | `/sofascore/event-highlights` | `sofascore-event-highlights` | SofaScore event highlights |
|
|
92
|
+
| `GET` | `/sofascore/event-incidents` | `sofascore-event-incidents` | SofaScore event incidents |
|
|
93
|
+
| `GET` | `/sofascore/event-innings` | `sofascore-event-innings` | SofaScore event innings |
|
|
94
|
+
| `GET` | `/sofascore/event-lineups` | `sofascore-event-lineups` | SofaScore event lineups |
|
|
95
|
+
| `GET` | `/sofascore/event-managers` | `sofascore-event-managers` | SofaScore event managers |
|
|
96
|
+
| `GET` | `/sofascore/event-odds` | `sofascore-event-odds` | SofaScore event odds |
|
|
97
|
+
| `GET` | `/sofascore/event-player-heatmap` | `sofascore-event-player-heatmap` | SofaScore event player heatmap |
|
|
98
|
+
| `GET` | `/sofascore/event-player-statistics` | `sofascore-event-player-statistics` | SofaScore event player statistics |
|
|
99
|
+
| `GET` | `/sofascore/event-point-by-point` | `sofascore-event-point-by-point` | SofaScore event point-by-point |
|
|
100
|
+
| `GET` | `/sofascore/event-pregame-form` | `sofascore-event-pregame-form` | SofaScore event pre-game form |
|
|
101
|
+
| `GET` | `/sofascore/event-shotmap` | `sofascore-event-shotmap` | SofaScore event shot map |
|
|
102
|
+
| `GET` | `/sofascore/event-statistics` | `sofascore-event-statistics` | SofaScore event statistics |
|
|
103
|
+
| `GET` | `/sofascore/event-team-heatmap` | `sofascore-event-team-heatmap` | SofaScore event team heatmap |
|
|
104
|
+
| `GET` | `/sofascore/event-team-streaks` | `sofascore-event-team-streaks` | SofaScore event team streaks |
|
|
105
|
+
| `GET` | `/sofascore/event-tennis-power` | `sofascore-event-tennis-power` | SofaScore event tennis power |
|
|
106
|
+
| `GET` | `/sofascore/event-tv-channels` | `sofascore-event-tv-channels` | SofaScore event TV channels |
|
|
107
|
+
| `GET` | `/sofascore/event-votes` | `sofascore-event-votes` | SofaScore event votes |
|
|
108
|
+
| `GET` | `/sofascore/live-events` | `sofascore-live-events` | SofaScore live events |
|
|
109
|
+
| `GET` | `/sofascore/manager` | `sofascore-manager` | SofaScore manager detail |
|
|
110
|
+
| `GET` | `/sofascore/manager-events` | `sofascore-manager-events` | SofaScore manager recent matches |
|
|
111
|
+
| `GET` | `/sofascore/mma-card` | `sofascore-mma-card` | SofaScore MMA card |
|
|
112
|
+
| `GET` | `/sofascore/mma-schedule` | `sofascore-mma-schedule` | SofaScore MMA schedule |
|
|
113
|
+
| `GET` | `/sofascore/odds-dropping` | `sofascore-odds-dropping` | SofaScore dropping odds |
|
|
114
|
+
| `GET` | `/sofascore/odds-winning` | `sofascore-odds-winning` | SofaScore winning odds |
|
|
115
|
+
| `GET` | `/sofascore/player` | `sofascore-player` | SofaScore player detail |
|
|
116
|
+
| `GET` | `/sofascore/player-attributes` | `sofascore-player-attributes` | SofaScore player attributes and characteristics |
|
|
117
|
+
| `GET` | `/sofascore/player-events` | `sofascore-player-events` | SofaScore player matches with per-match numbers |
|
|
118
|
+
| `GET` | `/sofascore/player-last-year-summary` | `sofascore-player-last-year-summary` | SofaScore player form over the last year |
|
|
119
|
+
| `GET` | `/sofascore/player-national-team-statistics` | `sofascore-player-national-team-statistics` | SofaScore player national team record |
|
|
120
|
+
| `GET` | `/sofascore/player-penalty-history` | `sofascore-player-penalty-history` | SofaScore player penalty history |
|
|
121
|
+
| `GET` | `/sofascore/player-ratings` | `sofascore-player-ratings` | SofaScore player match ratings for a season |
|
|
122
|
+
| `GET` | `/sofascore/player-season-heatmap` | `sofascore-player-season-heatmap` | SofaScore player season heatmap |
|
|
123
|
+
| `GET` | `/sofascore/player-season-statistics` | `sofascore-player-season-statistics` | SofaScore player season statistics |
|
|
124
|
+
| `GET` | `/sofascore/player-statistical-rankings` | `sofascore-player-statistical-rankings` | SofaScore player ranking among all players in a season |
|
|
125
|
+
| `GET` | `/sofascore/player-statistics-seasons` | `sofascore-player-statistics-seasons` | SofaScore player statistics seasons |
|
|
126
|
+
| `GET` | `/sofascore/player-tournaments` | `sofascore-player-tournaments` | SofaScore player competitions |
|
|
127
|
+
| `GET` | `/sofascore/player-transfers` | `sofascore-player-transfers` | SofaScore player transfer history |
|
|
128
|
+
| `GET` | `/sofascore/ranking-types` | `sofascore-ranking-types` | SofaScore ranking catalogue |
|
|
129
|
+
| `GET` | `/sofascore/rankings` | `sofascore-rankings` | SofaScore rankings |
|
|
130
|
+
| `GET` | `/sofascore/referee` | `sofascore-referee` | SofaScore referee profile |
|
|
131
|
+
| `GET` | `/sofascore/referee-events` | `sofascore-referee-events` | SofaScore referee officiated matches |
|
|
132
|
+
| `GET` | `/sofascore/referee-statistics` | `sofascore-referee-statistics` | SofaScore referee card statistics |
|
|
133
|
+
| `GET` | `/sofascore/round-events` | `sofascore-round-events` | SofaScore round fixtures |
|
|
134
|
+
| `GET` | `/sofascore/scheduled-events` | `sofascore-scheduled-events` | SofaScore events scheduled in a category on a date |
|
|
135
|
+
| `GET` | `/sofascore/scheduled-tournaments` | `sofascore-scheduled-tournaments` | SofaScore tournaments scheduled on a date |
|
|
136
|
+
| `GET` | `/sofascore/search` | `sofascore-search` | SofaScore universal search |
|
|
137
|
+
| `GET` | `/sofascore/search-typed` | `sofascore-search-typed` | SofaScore search by entity type |
|
|
138
|
+
| `GET` | `/sofascore/season-events` | `sofascore-season-events` | SofaScore season fixtures and results |
|
|
139
|
+
| `GET` | `/sofascore/sports` | `sofascore-sports` | SofaScore supported sports |
|
|
140
|
+
| `GET` | `/sofascore/stage` | `sofascore-stage` | SofaScore motorsport and cycling stage |
|
|
141
|
+
| `GET` | `/sofascore/stage-categories` | `sofascore-stage-categories` | SofaScore motorsport and cycling categories and competitions |
|
|
142
|
+
| `GET` | `/sofascore/stage-driver-performance` | `sofascore-stage-driver-performance` | SofaScore motorsport race progress per driver |
|
|
143
|
+
| `GET` | `/sofascore/stage-featured` | `sofascore-stage-featured` | SofaScore featured motorsport and cycling events |
|
|
144
|
+
| `GET` | `/sofascore/stage-schedule` | `sofascore-stage-schedule` | SofaScore motorsport and cycling events around a date |
|
|
145
|
+
| `GET` | `/sofascore/stage-seasons` | `sofascore-stage-seasons` | SofaScore seasons of a motorsport or cycling competition |
|
|
146
|
+
| `GET` | `/sofascore/stage-standings` | `sofascore-stage-standings` | SofaScore motorsport and cycling stage standings |
|
|
147
|
+
| `GET` | `/sofascore/stage-substages` | `sofascore-stage-substages` | SofaScore children of a motorsport or cycling stage |
|
|
148
|
+
| `GET` | `/sofascore/standings` | `sofascore-standings` | SofaScore standings |
|
|
149
|
+
| `GET` | `/sofascore/team` | `sofascore-team` | SofaScore team detail |
|
|
150
|
+
| `GET` | `/sofascore/team-achievements` | `sofascore-team-achievements` | SofaScore team trophies |
|
|
151
|
+
| `GET` | `/sofascore/team-events` | `sofascore-team-events` | SofaScore team fixtures |
|
|
152
|
+
| `GET` | `/sofascore/team-goal-distributions` | `sofascore-team-goal-distributions` | SofaScore team goals by match minute |
|
|
153
|
+
| `GET` | `/sofascore/team-near-events` | `sofascore-team-near-events` | SofaScore team previous and next match |
|
|
154
|
+
| `GET` | `/sofascore/team-of-the-week` | `sofascore-team-of-the-week` | SofaScore team of the week |
|
|
155
|
+
| `GET` | `/sofascore/team-of-the-week-periods` | `sofascore-team-of-the-week-periods` | SofaScore team of the week periods |
|
|
156
|
+
| `GET` | `/sofascore/team-performance` | `sofascore-team-performance` | SofaScore team recent performance |
|
|
157
|
+
| `GET` | `/sofascore/team-player-statistics` | `sofascore-team-player-statistics` | SofaScore team player statistics |
|
|
158
|
+
| `GET` | `/sofascore/team-player-statistics-seasons` | `sofascore-team-player-statistics-seasons` | SofaScore team player statistics seasons |
|
|
159
|
+
| `GET` | `/sofascore/team-players` | `sofascore-team-players` | SofaScore team players |
|
|
160
|
+
| `GET` | `/sofascore/team-rankings` | `sofascore-team-rankings` | SofaScore team rankings |
|
|
161
|
+
| `GET` | `/sofascore/team-season-statistics` | `sofascore-team-season-statistics` | SofaScore team season statistics |
|
|
162
|
+
| `GET` | `/sofascore/team-statistics-seasons` | `sofascore-team-statistics-seasons` | SofaScore team statistics seasons |
|
|
163
|
+
| `GET` | `/sofascore/team-top-players` | `sofascore-team-top-players` | SofaScore team top players |
|
|
164
|
+
| `GET` | `/sofascore/team-tournaments` | `sofascore-team-tournaments` | SofaScore team competitions |
|
|
165
|
+
| `GET` | `/sofascore/team-transfers` | `sofascore-team-transfers` | SofaScore team transfers |
|
|
166
|
+
| `GET` | `/sofascore/tennis-player-grand-slam-results` | `sofascore-tennis-player-grand-slam-results` | SofaScore tennis player grand slam results |
|
|
167
|
+
| `GET` | `/sofascore/tournament-cuptree` | `sofascore-tournament-cuptree` | SofaScore competition knockout tree |
|
|
168
|
+
| `GET` | `/sofascore/tournament-info` | `sofascore-tournament-info` | SofaScore competition info |
|
|
169
|
+
| `GET` | `/sofascore/tournament-player-of-the-season` | `sofascore-tournament-player-of-the-season` | SofaScore player of the season |
|
|
170
|
+
| `GET` | `/sofascore/tournament-player-statistics` | `sofascore-tournament-player-statistics` | SofaScore season player statistics table |
|
|
171
|
+
| `GET` | `/sofascore/tournament-rounds` | `sofascore-tournament-rounds` | SofaScore competition season rounds |
|
|
172
|
+
| `GET` | `/sofascore/tournament-seasons` | `sofascore-tournament-seasons` | SofaScore competition seasons |
|
|
173
|
+
| `GET` | `/sofascore/tournament-statistics-info` | `sofascore-tournament-statistics-info` | SofaScore player statistics table filters |
|
|
174
|
+
| `GET` | `/sofascore/tournament-team-of-the-season` | `sofascore-tournament-team-of-the-season` | SofaScore team of the season |
|
|
175
|
+
| `GET` | `/sofascore/tournament-teams` | `sofascore-tournament-teams` | SofaScore teams of a competition season |
|
|
176
|
+
| `GET` | `/sofascore/tournament-top-players` | `sofascore-tournament-top-players` | SofaScore season top players |
|
|
177
|
+
| `GET` | `/sofascore/tournament-top-teams` | `sofascore-tournament-top-teams` | SofaScore season top teams |
|
|
178
|
+
| `GET` | `/sofascore/tournament-venues` | `sofascore-tournament-venues` | SofaScore venues of a competition season |
|
|
179
|
+
| `GET` | `/sofascore/tournament-winners` | `sofascore-tournament-winners` | SofaScore past winners of a competition |
|
|
180
|
+
| `GET` | `/sofascore/tournaments-with-feature` | `sofascore-tournaments-with-feature` | SofaScore competitions that carry a feature |
|
|
181
|
+
| `GET` | `/sofascore/trending-events` | `sofascore-trending-events` | SofaScore trending events |
|
|
182
|
+
| `GET` | `/sofascore/trending-players` | `sofascore-trending-players` | SofaScore trending players |
|
|
183
|
+
| `GET` | `/sofascore/venue` | `sofascore-venue` | SofaScore venue |
|
|
184
|
+
| `GET` | `/sofascore/venue-events` | `sofascore-venue-events` | SofaScore matches at a venue |
|
|
185
|
+
|
|
186
|
+
## Configuration
|
|
187
|
+
|
|
188
|
+
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
189
|
+
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
190
|
+
hosted API.
|
|
@@ -6,7 +6,7 @@ from .operations import OPERATION_COUNT, OPERATION_IDS, PLATFORM
|
|
|
6
6
|
|
|
7
7
|
Client = SofascoreClient
|
|
8
8
|
AsyncClient = AsyncSofascoreClient
|
|
9
|
-
__version__ = '0.3.
|
|
9
|
+
__version__ = '0.3.5'
|
|
10
10
|
DISPLAY_NAME = 'SofaScore'
|
|
11
11
|
PLATFORM = 'sofascore'
|
|
12
12
|
CONTRACT_REVISION = 'sha256:645115670262bb86bf9c49f16ddbfdd94bbec67befb2aa8497f10f86ee2d5e46'
|
|
@@ -7,7 +7,7 @@ from .async_client import AsyncCrawloraClient
|
|
|
7
7
|
class SofascoreClient(CrawloraClient):
|
|
8
8
|
"""Synchronous SofaScore API client."""
|
|
9
9
|
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
10
|
-
kwargs.setdefault('user_agent', 'crawlora-sofascore-python/0.3.
|
|
10
|
+
kwargs.setdefault('user_agent', 'crawlora-sofascore-python/0.3.5')
|
|
11
11
|
super().__init__(*args, **kwargs)
|
|
12
12
|
|
|
13
13
|
def categories(self, **params: Any) -> Any:
|
|
@@ -667,7 +667,7 @@ class SofascoreClient(CrawloraClient):
|
|
|
667
667
|
class AsyncSofascoreClient(AsyncCrawloraClient):
|
|
668
668
|
"""Asynchronous SofaScore API client."""
|
|
669
669
|
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
670
|
-
kwargs.setdefault('user_agent', 'crawlora-sofascore-python/0.3.
|
|
670
|
+
kwargs.setdefault('user_agent', 'crawlora-sofascore-python/0.3.5')
|
|
671
671
|
super().__init__(*args, **kwargs)
|
|
672
672
|
|
|
673
673
|
async def categories(self, **params: Any) -> Any:
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: crawlora-sofascore
|
|
3
|
+
Version: 0.3.5
|
|
4
|
+
Summary: Crawlora SofaScore API client with 109 endpoints for live events, match details, lineups, statistics, tournaments, and player/team data
|
|
5
|
+
Author: Crawlora
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage
|
|
8
|
+
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-api-docs
|
|
9
|
+
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-sofascore
|
|
10
|
+
Keywords: crawlora,api-client,sdk,web-scraping,scraping-api,sofascore,sofascore-api,sofascore-scraper,sofascore-data,sofascore-live-events,sofascore-match-details,sofascore-lineups,sofascore-statistics,sofascore-tournaments,sofascore-player-team-data
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typing-extensions>=4.7; python_version < "3.11"
|
|
18
|
+
Provides-Extra: async
|
|
19
|
+
Requires-Dist: httpx>=0.27; extra == "async"
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Requires-Dist: mypy>=1.11; extra == "test"
|
|
22
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# crawlora-sofascore — SofaScore API client for Python
|
|
26
|
+
|
|
27
|
+
Python client for Crawlora's hosted SofaScore API. It exposes 109 API endpoints covering live events, match details, lineups, statistics, tournaments, and player/team data. Requests go to [Crawlora](https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); the package does not run a browser or scrape
|
|
28
|
+
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
29
|
+
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
30
|
+
SofaScore or its owners.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
python -m pip install crawlora-sofascore
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Get an API key
|
|
39
|
+
|
|
40
|
+
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Use
|
|
47
|
+
|
|
48
|
+
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import os
|
|
52
|
+
|
|
53
|
+
from crawlora_sofascore import SofascoreClient
|
|
54
|
+
|
|
55
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
56
|
+
if not api_key:
|
|
57
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
58
|
+
|
|
59
|
+
with SofascoreClient(api_key=api_key) as client:
|
|
60
|
+
result_1 = client.search(q='Liverpool')
|
|
61
|
+
print(result_1)
|
|
62
|
+
result_2 = client.live_events(sport='football')
|
|
63
|
+
print(result_2)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
67
|
+
methods are available directly in snake_case and through the `sofascore`
|
|
68
|
+
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
69
|
+
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
70
|
+
|
|
71
|
+
### Async usage
|
|
72
|
+
|
|
73
|
+
The package also exports `AsyncClient` for asynchronous requests:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import asyncio
|
|
77
|
+
import os
|
|
78
|
+
|
|
79
|
+
from crawlora_sofascore import AsyncClient
|
|
80
|
+
|
|
81
|
+
async def main():
|
|
82
|
+
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
83
|
+
if not api_key:
|
|
84
|
+
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
85
|
+
async with AsyncClient(api_key=api_key) as client:
|
|
86
|
+
result_1 = await client.search(q='Liverpool')
|
|
87
|
+
print(result_1)
|
|
88
|
+
|
|
89
|
+
asyncio.run(main())
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See the [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py) for a complete usage example.
|
|
93
|
+
|
|
94
|
+
## Supported SofaScore API endpoints
|
|
95
|
+
|
|
96
|
+
This package exposes every route below through direct snake_case methods and the `sofascore` group. See the [endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) for complete input details.
|
|
97
|
+
|
|
98
|
+
| Method | Endpoint | API operation | Description |
|
|
99
|
+
| --- | --- | --- | --- |
|
|
100
|
+
| `GET` | `/sofascore/categories` | `sofascore-categories` | SofaScore categories for a sport |
|
|
101
|
+
| `GET` | `/sofascore/category-tournaments` | `sofascore-category-tournaments` | SofaScore competitions in a category |
|
|
102
|
+
| `GET` | `/sofascore/draft` | `sofascore-draft` | SofaScore league draft |
|
|
103
|
+
| `GET` | `/sofascore/draft-picks` | `sofascore-draft-picks` | SofaScore league draft picks |
|
|
104
|
+
| `GET` | `/sofascore/esports-game` | `sofascore-esports-game` | SofaScore esports game detail |
|
|
105
|
+
| `GET` | `/sofascore/event` | `sofascore-event` | SofaScore event detail |
|
|
106
|
+
| `GET` | `/sofascore/event-at-bat-pitches` | `sofascore-event-at-bat-pitches` | SofaScore event at-bat pitches |
|
|
107
|
+
| `GET` | `/sofascore/event-at-bats` | `sofascore-event-at-bats` | SofaScore event at-bats |
|
|
108
|
+
| `GET` | `/sofascore/event-average-positions` | `sofascore-event-average-positions` | SofaScore event average positions |
|
|
109
|
+
| `GET` | `/sofascore/event-baseball-top-performers` | `sofascore-event-baseball-top-performers` | SofaScore event baseball top performers |
|
|
110
|
+
| `GET` | `/sofascore/event-best-players` | `sofascore-event-best-players` | SofaScore event best players |
|
|
111
|
+
| `GET` | `/sofascore/event-comments` | `sofascore-event-comments` | SofaScore event commentary |
|
|
112
|
+
| `GET` | `/sofascore/event-esports-games` | `sofascore-event-esports-games` | SofaScore event esports games |
|
|
113
|
+
| `GET` | `/sofascore/event-graph` | `sofascore-event-graph` | SofaScore event momentum graph |
|
|
114
|
+
| `GET` | `/sofascore/event-h2h` | `sofascore-event-h2h` | SofaScore event head-to-head |
|
|
115
|
+
| `GET` | `/sofascore/event-highlights` | `sofascore-event-highlights` | SofaScore event highlights |
|
|
116
|
+
| `GET` | `/sofascore/event-incidents` | `sofascore-event-incidents` | SofaScore event incidents |
|
|
117
|
+
| `GET` | `/sofascore/event-innings` | `sofascore-event-innings` | SofaScore event innings |
|
|
118
|
+
| `GET` | `/sofascore/event-lineups` | `sofascore-event-lineups` | SofaScore event lineups |
|
|
119
|
+
| `GET` | `/sofascore/event-managers` | `sofascore-event-managers` | SofaScore event managers |
|
|
120
|
+
| `GET` | `/sofascore/event-odds` | `sofascore-event-odds` | SofaScore event odds |
|
|
121
|
+
| `GET` | `/sofascore/event-player-heatmap` | `sofascore-event-player-heatmap` | SofaScore event player heatmap |
|
|
122
|
+
| `GET` | `/sofascore/event-player-statistics` | `sofascore-event-player-statistics` | SofaScore event player statistics |
|
|
123
|
+
| `GET` | `/sofascore/event-point-by-point` | `sofascore-event-point-by-point` | SofaScore event point-by-point |
|
|
124
|
+
| `GET` | `/sofascore/event-pregame-form` | `sofascore-event-pregame-form` | SofaScore event pre-game form |
|
|
125
|
+
| `GET` | `/sofascore/event-shotmap` | `sofascore-event-shotmap` | SofaScore event shot map |
|
|
126
|
+
| `GET` | `/sofascore/event-statistics` | `sofascore-event-statistics` | SofaScore event statistics |
|
|
127
|
+
| `GET` | `/sofascore/event-team-heatmap` | `sofascore-event-team-heatmap` | SofaScore event team heatmap |
|
|
128
|
+
| `GET` | `/sofascore/event-team-streaks` | `sofascore-event-team-streaks` | SofaScore event team streaks |
|
|
129
|
+
| `GET` | `/sofascore/event-tennis-power` | `sofascore-event-tennis-power` | SofaScore event tennis power |
|
|
130
|
+
| `GET` | `/sofascore/event-tv-channels` | `sofascore-event-tv-channels` | SofaScore event TV channels |
|
|
131
|
+
| `GET` | `/sofascore/event-votes` | `sofascore-event-votes` | SofaScore event votes |
|
|
132
|
+
| `GET` | `/sofascore/live-events` | `sofascore-live-events` | SofaScore live events |
|
|
133
|
+
| `GET` | `/sofascore/manager` | `sofascore-manager` | SofaScore manager detail |
|
|
134
|
+
| `GET` | `/sofascore/manager-events` | `sofascore-manager-events` | SofaScore manager recent matches |
|
|
135
|
+
| `GET` | `/sofascore/mma-card` | `sofascore-mma-card` | SofaScore MMA card |
|
|
136
|
+
| `GET` | `/sofascore/mma-schedule` | `sofascore-mma-schedule` | SofaScore MMA schedule |
|
|
137
|
+
| `GET` | `/sofascore/odds-dropping` | `sofascore-odds-dropping` | SofaScore dropping odds |
|
|
138
|
+
| `GET` | `/sofascore/odds-winning` | `sofascore-odds-winning` | SofaScore winning odds |
|
|
139
|
+
| `GET` | `/sofascore/player` | `sofascore-player` | SofaScore player detail |
|
|
140
|
+
| `GET` | `/sofascore/player-attributes` | `sofascore-player-attributes` | SofaScore player attributes and characteristics |
|
|
141
|
+
| `GET` | `/sofascore/player-events` | `sofascore-player-events` | SofaScore player matches with per-match numbers |
|
|
142
|
+
| `GET` | `/sofascore/player-last-year-summary` | `sofascore-player-last-year-summary` | SofaScore player form over the last year |
|
|
143
|
+
| `GET` | `/sofascore/player-national-team-statistics` | `sofascore-player-national-team-statistics` | SofaScore player national team record |
|
|
144
|
+
| `GET` | `/sofascore/player-penalty-history` | `sofascore-player-penalty-history` | SofaScore player penalty history |
|
|
145
|
+
| `GET` | `/sofascore/player-ratings` | `sofascore-player-ratings` | SofaScore player match ratings for a season |
|
|
146
|
+
| `GET` | `/sofascore/player-season-heatmap` | `sofascore-player-season-heatmap` | SofaScore player season heatmap |
|
|
147
|
+
| `GET` | `/sofascore/player-season-statistics` | `sofascore-player-season-statistics` | SofaScore player season statistics |
|
|
148
|
+
| `GET` | `/sofascore/player-statistical-rankings` | `sofascore-player-statistical-rankings` | SofaScore player ranking among all players in a season |
|
|
149
|
+
| `GET` | `/sofascore/player-statistics-seasons` | `sofascore-player-statistics-seasons` | SofaScore player statistics seasons |
|
|
150
|
+
| `GET` | `/sofascore/player-tournaments` | `sofascore-player-tournaments` | SofaScore player competitions |
|
|
151
|
+
| `GET` | `/sofascore/player-transfers` | `sofascore-player-transfers` | SofaScore player transfer history |
|
|
152
|
+
| `GET` | `/sofascore/ranking-types` | `sofascore-ranking-types` | SofaScore ranking catalogue |
|
|
153
|
+
| `GET` | `/sofascore/rankings` | `sofascore-rankings` | SofaScore rankings |
|
|
154
|
+
| `GET` | `/sofascore/referee` | `sofascore-referee` | SofaScore referee profile |
|
|
155
|
+
| `GET` | `/sofascore/referee-events` | `sofascore-referee-events` | SofaScore referee officiated matches |
|
|
156
|
+
| `GET` | `/sofascore/referee-statistics` | `sofascore-referee-statistics` | SofaScore referee card statistics |
|
|
157
|
+
| `GET` | `/sofascore/round-events` | `sofascore-round-events` | SofaScore round fixtures |
|
|
158
|
+
| `GET` | `/sofascore/scheduled-events` | `sofascore-scheduled-events` | SofaScore events scheduled in a category on a date |
|
|
159
|
+
| `GET` | `/sofascore/scheduled-tournaments` | `sofascore-scheduled-tournaments` | SofaScore tournaments scheduled on a date |
|
|
160
|
+
| `GET` | `/sofascore/search` | `sofascore-search` | SofaScore universal search |
|
|
161
|
+
| `GET` | `/sofascore/search-typed` | `sofascore-search-typed` | SofaScore search by entity type |
|
|
162
|
+
| `GET` | `/sofascore/season-events` | `sofascore-season-events` | SofaScore season fixtures and results |
|
|
163
|
+
| `GET` | `/sofascore/sports` | `sofascore-sports` | SofaScore supported sports |
|
|
164
|
+
| `GET` | `/sofascore/stage` | `sofascore-stage` | SofaScore motorsport and cycling stage |
|
|
165
|
+
| `GET` | `/sofascore/stage-categories` | `sofascore-stage-categories` | SofaScore motorsport and cycling categories and competitions |
|
|
166
|
+
| `GET` | `/sofascore/stage-driver-performance` | `sofascore-stage-driver-performance` | SofaScore motorsport race progress per driver |
|
|
167
|
+
| `GET` | `/sofascore/stage-featured` | `sofascore-stage-featured` | SofaScore featured motorsport and cycling events |
|
|
168
|
+
| `GET` | `/sofascore/stage-schedule` | `sofascore-stage-schedule` | SofaScore motorsport and cycling events around a date |
|
|
169
|
+
| `GET` | `/sofascore/stage-seasons` | `sofascore-stage-seasons` | SofaScore seasons of a motorsport or cycling competition |
|
|
170
|
+
| `GET` | `/sofascore/stage-standings` | `sofascore-stage-standings` | SofaScore motorsport and cycling stage standings |
|
|
171
|
+
| `GET` | `/sofascore/stage-substages` | `sofascore-stage-substages` | SofaScore children of a motorsport or cycling stage |
|
|
172
|
+
| `GET` | `/sofascore/standings` | `sofascore-standings` | SofaScore standings |
|
|
173
|
+
| `GET` | `/sofascore/team` | `sofascore-team` | SofaScore team detail |
|
|
174
|
+
| `GET` | `/sofascore/team-achievements` | `sofascore-team-achievements` | SofaScore team trophies |
|
|
175
|
+
| `GET` | `/sofascore/team-events` | `sofascore-team-events` | SofaScore team fixtures |
|
|
176
|
+
| `GET` | `/sofascore/team-goal-distributions` | `sofascore-team-goal-distributions` | SofaScore team goals by match minute |
|
|
177
|
+
| `GET` | `/sofascore/team-near-events` | `sofascore-team-near-events` | SofaScore team previous and next match |
|
|
178
|
+
| `GET` | `/sofascore/team-of-the-week` | `sofascore-team-of-the-week` | SofaScore team of the week |
|
|
179
|
+
| `GET` | `/sofascore/team-of-the-week-periods` | `sofascore-team-of-the-week-periods` | SofaScore team of the week periods |
|
|
180
|
+
| `GET` | `/sofascore/team-performance` | `sofascore-team-performance` | SofaScore team recent performance |
|
|
181
|
+
| `GET` | `/sofascore/team-player-statistics` | `sofascore-team-player-statistics` | SofaScore team player statistics |
|
|
182
|
+
| `GET` | `/sofascore/team-player-statistics-seasons` | `sofascore-team-player-statistics-seasons` | SofaScore team player statistics seasons |
|
|
183
|
+
| `GET` | `/sofascore/team-players` | `sofascore-team-players` | SofaScore team players |
|
|
184
|
+
| `GET` | `/sofascore/team-rankings` | `sofascore-team-rankings` | SofaScore team rankings |
|
|
185
|
+
| `GET` | `/sofascore/team-season-statistics` | `sofascore-team-season-statistics` | SofaScore team season statistics |
|
|
186
|
+
| `GET` | `/sofascore/team-statistics-seasons` | `sofascore-team-statistics-seasons` | SofaScore team statistics seasons |
|
|
187
|
+
| `GET` | `/sofascore/team-top-players` | `sofascore-team-top-players` | SofaScore team top players |
|
|
188
|
+
| `GET` | `/sofascore/team-tournaments` | `sofascore-team-tournaments` | SofaScore team competitions |
|
|
189
|
+
| `GET` | `/sofascore/team-transfers` | `sofascore-team-transfers` | SofaScore team transfers |
|
|
190
|
+
| `GET` | `/sofascore/tennis-player-grand-slam-results` | `sofascore-tennis-player-grand-slam-results` | SofaScore tennis player grand slam results |
|
|
191
|
+
| `GET` | `/sofascore/tournament-cuptree` | `sofascore-tournament-cuptree` | SofaScore competition knockout tree |
|
|
192
|
+
| `GET` | `/sofascore/tournament-info` | `sofascore-tournament-info` | SofaScore competition info |
|
|
193
|
+
| `GET` | `/sofascore/tournament-player-of-the-season` | `sofascore-tournament-player-of-the-season` | SofaScore player of the season |
|
|
194
|
+
| `GET` | `/sofascore/tournament-player-statistics` | `sofascore-tournament-player-statistics` | SofaScore season player statistics table |
|
|
195
|
+
| `GET` | `/sofascore/tournament-rounds` | `sofascore-tournament-rounds` | SofaScore competition season rounds |
|
|
196
|
+
| `GET` | `/sofascore/tournament-seasons` | `sofascore-tournament-seasons` | SofaScore competition seasons |
|
|
197
|
+
| `GET` | `/sofascore/tournament-statistics-info` | `sofascore-tournament-statistics-info` | SofaScore player statistics table filters |
|
|
198
|
+
| `GET` | `/sofascore/tournament-team-of-the-season` | `sofascore-tournament-team-of-the-season` | SofaScore team of the season |
|
|
199
|
+
| `GET` | `/sofascore/tournament-teams` | `sofascore-tournament-teams` | SofaScore teams of a competition season |
|
|
200
|
+
| `GET` | `/sofascore/tournament-top-players` | `sofascore-tournament-top-players` | SofaScore season top players |
|
|
201
|
+
| `GET` | `/sofascore/tournament-top-teams` | `sofascore-tournament-top-teams` | SofaScore season top teams |
|
|
202
|
+
| `GET` | `/sofascore/tournament-venues` | `sofascore-tournament-venues` | SofaScore venues of a competition season |
|
|
203
|
+
| `GET` | `/sofascore/tournament-winners` | `sofascore-tournament-winners` | SofaScore past winners of a competition |
|
|
204
|
+
| `GET` | `/sofascore/tournaments-with-feature` | `sofascore-tournaments-with-feature` | SofaScore competitions that carry a feature |
|
|
205
|
+
| `GET` | `/sofascore/trending-events` | `sofascore-trending-events` | SofaScore trending events |
|
|
206
|
+
| `GET` | `/sofascore/trending-players` | `sofascore-trending-players` | SofaScore trending players |
|
|
207
|
+
| `GET` | `/sofascore/venue` | `sofascore-venue` | SofaScore venue |
|
|
208
|
+
| `GET` | `/sofascore/venue-events` | `sofascore-venue-events` | SofaScore matches at a venue |
|
|
209
|
+
|
|
210
|
+
## Configuration
|
|
211
|
+
|
|
212
|
+
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
213
|
+
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
214
|
+
hosted API.
|
|
@@ -4,9 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "crawlora-sofascore"
|
|
7
|
-
version = "0.3.
|
|
8
|
-
description = "
|
|
7
|
+
version = "0.3.5"
|
|
8
|
+
description = "Crawlora SofaScore API client with 109 endpoints for live events, match details, lineups, statistics, tournaments, and player/team data"
|
|
9
9
|
readme = "README.md"
|
|
10
|
+
keywords = ["crawlora", "api-client", "sdk", "web-scraping", "scraping-api", "sofascore", "sofascore-api", "sofascore-scraper", "sofascore-data", "sofascore-live-events", "sofascore-match-details", "sofascore-lineups", "sofascore-statistics", "sofascore-tournaments", "sofascore-player-team-data"]
|
|
10
11
|
requires-python = ">=3.10"
|
|
11
12
|
license = "MIT"
|
|
12
13
|
license-files = ["LICENSE"]
|
|
@@ -28,7 +28,7 @@ class MockTransport:
|
|
|
28
28
|
class PackageTests(unittest.TestCase):
|
|
29
29
|
def test_platform_metadata_and_aliases(self):
|
|
30
30
|
self.assertEqual(client_package.PLATFORM, "sofascore")
|
|
31
|
-
self.assertEqual(client_package.__version__, "0.3.
|
|
31
|
+
self.assertEqual(client_package.__version__, "0.3.5")
|
|
32
32
|
self.assertIs(client_package.Client, client_package.SofascoreClient)
|
|
33
33
|
self.assertIs(client_package.AsyncClient, client_package.AsyncSofascoreClient)
|
|
34
34
|
self.assertEqual(client_package.OPERATION_COUNT, len(client_package.OPERATION_IDS))
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: crawlora-sofascore
|
|
3
|
-
Version: 0.3.3
|
|
4
|
-
Summary: Typed SofaScore client for the Crawlora hosted API
|
|
5
|
-
Author: Crawlora
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage
|
|
8
|
-
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-api-docs
|
|
9
|
-
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-sofascore
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Classifier: Typing :: Typed
|
|
13
|
-
Requires-Python: >=3.10
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: typing-extensions>=4.7; python_version < "3.11"
|
|
17
|
-
Provides-Extra: async
|
|
18
|
-
Requires-Dist: httpx>=0.27; extra == "async"
|
|
19
|
-
Provides-Extra: test
|
|
20
|
-
Requires-Dist: mypy>=1.11; extra == "test"
|
|
21
|
-
Requires-Dist: pytest>=8; extra == "test"
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
|
|
24
|
-
# crawlora-sofascore
|
|
25
|
-
|
|
26
|
-
Python client for Crawlora's hosted SofaScore API. It calls Crawlora's
|
|
27
|
-
service at [Crawlora](https://crawlora.net?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); it does not run a browser or scrape
|
|
28
|
-
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
29
|
-
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
30
|
-
SofaScore or its owners.
|
|
31
|
-
|
|
32
|
-
## Install
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
python -m pip install crawlora-sofascore
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Get an API key
|
|
39
|
-
|
|
40
|
-
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Use
|
|
47
|
-
|
|
48
|
-
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
49
|
-
|
|
50
|
-
```python
|
|
51
|
-
import os
|
|
52
|
-
|
|
53
|
-
from crawlora_sofascore import SofascoreClient
|
|
54
|
-
|
|
55
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
56
|
-
if not api_key:
|
|
57
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
58
|
-
|
|
59
|
-
with SofascoreClient(api_key=api_key) as client:
|
|
60
|
-
result_1 = client.search(q='Liverpool')
|
|
61
|
-
print(result_1)
|
|
62
|
-
result_2 = client.live_events(sport='football')
|
|
63
|
-
print(result_2)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
67
|
-
methods are available directly in snake_case and through the `sofascore`
|
|
68
|
-
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
69
|
-
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
70
|
-
|
|
71
|
-
### Async usage
|
|
72
|
-
|
|
73
|
-
The package also exports `AsyncClient` for asynchronous requests:
|
|
74
|
-
|
|
75
|
-
```python
|
|
76
|
-
import asyncio
|
|
77
|
-
import os
|
|
78
|
-
|
|
79
|
-
from crawlora_sofascore import AsyncClient
|
|
80
|
-
|
|
81
|
-
async def main():
|
|
82
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
83
|
-
if not api_key:
|
|
84
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
85
|
-
async with AsyncClient(api_key=api_key) as client:
|
|
86
|
-
result_1 = await client.search(q='Liverpool')
|
|
87
|
-
print(result_1)
|
|
88
|
-
|
|
89
|
-
asyncio.run(main())
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Configuration
|
|
93
|
-
|
|
94
|
-
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
95
|
-
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
96
|
-
hosted API, and response data and availability follow its current contract.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# crawlora-sofascore
|
|
2
|
-
|
|
3
|
-
Python client for Crawlora's hosted SofaScore API. It calls Crawlora's
|
|
4
|
-
service at [Crawlora](https://crawlora.net?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); it does not run a browser or scrape
|
|
5
|
-
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
6
|
-
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
7
|
-
SofaScore or its owners.
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
python -m pip install crawlora-sofascore
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Get an API key
|
|
16
|
-
|
|
17
|
-
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Use
|
|
24
|
-
|
|
25
|
-
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
26
|
-
|
|
27
|
-
```python
|
|
28
|
-
import os
|
|
29
|
-
|
|
30
|
-
from crawlora_sofascore import SofascoreClient
|
|
31
|
-
|
|
32
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
33
|
-
if not api_key:
|
|
34
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
35
|
-
|
|
36
|
-
with SofascoreClient(api_key=api_key) as client:
|
|
37
|
-
result_1 = client.search(q='Liverpool')
|
|
38
|
-
print(result_1)
|
|
39
|
-
result_2 = client.live_events(sport='football')
|
|
40
|
-
print(result_2)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
44
|
-
methods are available directly in snake_case and through the `sofascore`
|
|
45
|
-
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
46
|
-
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
47
|
-
|
|
48
|
-
### Async usage
|
|
49
|
-
|
|
50
|
-
The package also exports `AsyncClient` for asynchronous requests:
|
|
51
|
-
|
|
52
|
-
```python
|
|
53
|
-
import asyncio
|
|
54
|
-
import os
|
|
55
|
-
|
|
56
|
-
from crawlora_sofascore import AsyncClient
|
|
57
|
-
|
|
58
|
-
async def main():
|
|
59
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
60
|
-
if not api_key:
|
|
61
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
62
|
-
async with AsyncClient(api_key=api_key) as client:
|
|
63
|
-
result_1 = await client.search(q='Liverpool')
|
|
64
|
-
print(result_1)
|
|
65
|
-
|
|
66
|
-
asyncio.run(main())
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Configuration
|
|
70
|
-
|
|
71
|
-
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
72
|
-
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
73
|
-
hosted API, and response data and availability follow its current contract.
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: crawlora-sofascore
|
|
3
|
-
Version: 0.3.3
|
|
4
|
-
Summary: Typed SofaScore client for the Crawlora hosted API
|
|
5
|
-
Author: Crawlora
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://crawlora.net/?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage
|
|
8
|
-
Project-URL: Documentation, https://crawlora.net/docs?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-api-docs
|
|
9
|
-
Project-URL: Repository, https://github.com/Crawlora-org/crawlora-sofascore
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Classifier: Typing :: Typed
|
|
13
|
-
Requires-Python: >=3.10
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: typing-extensions>=4.7; python_version < "3.11"
|
|
17
|
-
Provides-Extra: async
|
|
18
|
-
Requires-Dist: httpx>=0.27; extra == "async"
|
|
19
|
-
Provides-Extra: test
|
|
20
|
-
Requires-Dist: mypy>=1.11; extra == "test"
|
|
21
|
-
Requires-Dist: pytest>=8; extra == "test"
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
|
|
24
|
-
# crawlora-sofascore
|
|
25
|
-
|
|
26
|
-
Python client for Crawlora's hosted SofaScore API. It calls Crawlora's
|
|
27
|
-
service at [Crawlora](https://crawlora.net?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-homepage); it does not run a browser or scrape
|
|
28
|
-
SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
|
|
29
|
-
and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
|
|
30
|
-
SofaScore or its owners.
|
|
31
|
-
|
|
32
|
-
## Install
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
python -m pip install crawlora-sofascore
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Get an API key
|
|
39
|
-
|
|
40
|
-
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-signup), then open the [Crawlora console](https://crawlora.net/app?utm_source=pypi&utm_medium=referral&utm_campaign=platform-clients&utm_content=sofascore-python-console) for API-key setup. Set your key in the shell before running the client:
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
export CRAWLORA_API_KEY="your-crawlora-api-key"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Use
|
|
47
|
-
|
|
48
|
-
Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
|
|
49
|
-
|
|
50
|
-
```python
|
|
51
|
-
import os
|
|
52
|
-
|
|
53
|
-
from crawlora_sofascore import SofascoreClient
|
|
54
|
-
|
|
55
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
56
|
-
if not api_key:
|
|
57
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
58
|
-
|
|
59
|
-
with SofascoreClient(api_key=api_key) as client:
|
|
60
|
-
result_1 = client.search(q='Liverpool')
|
|
61
|
-
print(result_1)
|
|
62
|
-
result_2 = client.live_events(sport='football')
|
|
63
|
-
print(result_2)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The package also exports `Client` as an alias for `SofascoreClient`. Operation
|
|
67
|
-
methods are available directly in snake_case and through the `sofascore`
|
|
68
|
-
group. The async package client is `AsyncSofascoreClient`; see the [online
|
|
69
|
-
endpoint and parameter reference](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/docs/usage.md) and [runnable example](https://github.com/Crawlora-org/crawlora-sofascore/blob/main/examples/python.py).
|
|
70
|
-
|
|
71
|
-
### Async usage
|
|
72
|
-
|
|
73
|
-
The package also exports `AsyncClient` for asynchronous requests:
|
|
74
|
-
|
|
75
|
-
```python
|
|
76
|
-
import asyncio
|
|
77
|
-
import os
|
|
78
|
-
|
|
79
|
-
from crawlora_sofascore import AsyncClient
|
|
80
|
-
|
|
81
|
-
async def main():
|
|
82
|
-
api_key = os.environ.get("CRAWLORA_API_KEY")
|
|
83
|
-
if not api_key:
|
|
84
|
-
raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
|
|
85
|
-
async with AsyncClient(api_key=api_key) as client:
|
|
86
|
-
result_1 = await client.search(q='Liverpool')
|
|
87
|
-
print(result_1)
|
|
88
|
-
|
|
89
|
-
asyncio.run(main())
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Configuration
|
|
93
|
-
|
|
94
|
-
Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
|
|
95
|
-
Keep credentials out of source control and logs. Requests go to Crawlora's
|
|
96
|
-
hosted API, and response data and availability follow its current contract.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/requires.txt
RENAMED
|
File without changes
|
{crawlora_sofascore-0.3.3 → crawlora_sofascore-0.3.5}/crawlora_sofascore.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|