crawlora-sofascore 0.1.2__tar.gz → 0.2.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.
Files changed (26) hide show
  1. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/PKG-INFO +44 -7
  2. crawlora_sofascore-0.2.0/README.md +75 -0
  3. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/__init__.py +2 -2
  4. crawlora_sofascore-0.2.0/crawlora_sofascore/operations.py +849 -0
  5. crawlora_sofascore-0.2.0/crawlora_sofascore/platform.py +533 -0
  6. crawlora_sofascore-0.2.0/crawlora_sofascore/platform.pyi +4904 -0
  7. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore.egg-info/PKG-INFO +44 -7
  8. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/pyproject.toml +1 -1
  9. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/tests/test_package.py +5 -5
  10. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/tests/test_types.py +16 -16
  11. crawlora_sofascore-0.1.2/README.md +0 -38
  12. crawlora_sofascore-0.1.2/crawlora_sofascore/operations.py +0 -222
  13. crawlora_sofascore-0.1.2/crawlora_sofascore/platform.py +0 -197
  14. crawlora_sofascore-0.1.2/crawlora_sofascore/platform.pyi +0 -1816
  15. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/LICENSE +0 -0
  16. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/__init__.pyi +0 -0
  17. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/_pagination.py +0 -0
  18. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/_transport_sync.py +0 -0
  19. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/async_client.py +0 -0
  20. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/client.py +0 -0
  21. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore/py.typed +0 -0
  22. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore.egg-info/SOURCES.txt +0 -0
  23. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore.egg-info/dependency_links.txt +0 -0
  24. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore.egg-info/requires.txt +0 -0
  25. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/crawlora_sofascore.egg-info/top_level.txt +0 -0
  26. {crawlora_sofascore-0.1.2 → crawlora_sofascore-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crawlora-sofascore
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Typed SofaScore client for the Crawlora hosted API
5
5
  Author: Crawlora
6
6
  License-Expression: MIT
@@ -23,9 +23,9 @@ Dynamic: license-file
23
23
  # crawlora-sofascore
24
24
 
25
25
  Python client for Crawlora's hosted SofaScore API. It calls Crawlora's
26
- service; it does not run a browser or scrape SofaScore locally. A Crawlora
27
- account and `CRAWLORA_API_KEY` are required, and API use is billed under your
28
- Crawlora account. Crawlora is independent from and not endorsed by
26
+ service at [Crawlora](https://crawlora.net); it does not run a browser or scrape
27
+ SofaScore locally. A Crawlora account and `CRAWLORA_API_KEY` are required,
28
+ and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by
29
29
  SofaScore or its owners.
30
30
 
31
31
  ## Install
@@ -34,16 +34,32 @@ SofaScore or its owners.
34
34
  python -m pip install crawlora-sofascore
35
35
  ```
36
36
 
37
+ ## Get an API key
38
+
39
+ Create an account at [crawlora.net](https://crawlora.net/signup), then open the [Crawlora console](https://crawlora.net/app) for API-key setup. Set your key in the shell before running the client:
40
+
41
+ ```sh
42
+ export CRAWLORA_API_KEY="your-crawlora-api-key"
43
+ ```
44
+
37
45
  ## Use
38
46
 
47
+ Save this example as `example.py`, then run `python example.py` after installing the package and setting your API key.
48
+
39
49
  ```python
40
50
  import os
41
51
 
42
52
  from crawlora_sofascore import SofascoreClient
43
53
 
44
- with SofascoreClient(api_key=os.environ["CRAWLORA_API_KEY"]) as client:
45
- result = client.search(q='Liverpool')
46
- print(result)
54
+ api_key = os.environ.get("CRAWLORA_API_KEY")
55
+ if not api_key:
56
+ raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
57
+
58
+ with SofascoreClient(api_key=api_key) as client:
59
+ result_1 = client.search(q='Liverpool')
60
+ print(result_1)
61
+ result_2 = client.live_events(sport='football')
62
+ print(result_2)
47
63
  ```
48
64
 
49
65
  The package also exports `Client` as an alias for `SofascoreClient`. Operation
@@ -51,6 +67,27 @@ methods are available directly in snake_case and through the `sofascore`
51
67
  group. The async package client is `AsyncSofascoreClient`; see the [online
52
68
  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).
53
69
 
70
+ ### Async usage
71
+
72
+ The package also exports `AsyncClient` for asynchronous requests:
73
+
74
+ ```python
75
+ import asyncio
76
+ import os
77
+
78
+ from crawlora_sofascore import AsyncClient
79
+
80
+ async def main():
81
+ api_key = os.environ.get("CRAWLORA_API_KEY")
82
+ if not api_key:
83
+ raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
84
+ async with AsyncClient(api_key=api_key) as client:
85
+ result_1 = await client.search(q='Liverpool')
86
+ print(result_1)
87
+
88
+ asyncio.run(main())
89
+ ```
90
+
54
91
  The import snippet above is for a project where this PyPI package is installed. To run the checked-in example from a source checkout, install `./python` from the repository root and run `python examples/python.py`; see the [source-checkout instructions](https://github.com/Crawlora-org/crawlora-sofascore#run-examples-from-a-source-checkout).
55
92
 
56
93
  ## Configuration
@@ -0,0 +1,75 @@
1
+ # crawlora-sofascore
2
+
3
+ Python client for Crawlora's hosted SofaScore API. It calls Crawlora's
4
+ service at [Crawlora](https://crawlora.net); 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), then open the [Crawlora console](https://crawlora.net/app) 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
+ The import snippet above is for a project where this PyPI package is installed. To run the checked-in example from a source checkout, install `./python` from the repository root and run `python examples/python.py`; see the [source-checkout instructions](https://github.com/Crawlora-org/crawlora-sofascore#run-examples-from-a-source-checkout).
70
+
71
+ ## Configuration
72
+
73
+ Pass your key through `api_key` or read `CRAWLORA_API_KEY` from the environment.
74
+ Keep credentials out of source control and logs. Requests go to Crawlora's
75
+ hosted API, and response data and availability follow its current contract.
@@ -6,10 +6,10 @@ from .operations import OPERATION_COUNT, OPERATION_IDS, PLATFORM
6
6
 
7
7
  Client = SofascoreClient
8
8
  AsyncClient = AsyncSofascoreClient
9
- __version__ = '0.1.2'
9
+ __version__ = '0.2.0'
10
10
  DISPLAY_NAME = 'SofaScore'
11
11
  PLATFORM = 'sofascore'
12
- CONTRACT_REVISION = 'sha256:8dc2e500465b7b7f98054def2f9794e0e433d8bbbcba6cfb688e0b6ed0ecbfcd'
12
+ CONTRACT_REVISION = 'sha256:91686922e3c5ab6569dbe0abd882fbbbc86c4395a86f151582a2291fb11de036'
13
13
 
14
14
  __all__ = [
15
15
  "SofascoreClient", "AsyncSofascoreClient", "Client", "AsyncClient",