openmatchkit 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openmatchkit-0.2.1/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- openmatchkit-0.2.1/.github/ISSUE_TEMPLATE/config.yml +5 -0
- openmatchkit-0.2.1/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
- openmatchkit-0.2.1/.github/ISSUE_TEMPLATE/source_adapter.md +25 -0
- openmatchkit-0.2.1/.github/pull_request_template.md +13 -0
- openmatchkit-0.2.1/.github/workflows/ci.yml +36 -0
- openmatchkit-0.2.1/.github/workflows/publish.yml +38 -0
- openmatchkit-0.2.1/.gitignore +16 -0
- openmatchkit-0.2.1/CHANGELOG.md +29 -0
- openmatchkit-0.2.1/CODE_OF_CONDUCT.md +18 -0
- openmatchkit-0.2.1/CONTRIBUTING.md +30 -0
- openmatchkit-0.2.1/DATA_SOURCES.md +82 -0
- openmatchkit-0.2.1/LICENSE +21 -0
- openmatchkit-0.2.1/PKG-INFO +192 -0
- openmatchkit-0.2.1/PRIVACY.md +17 -0
- openmatchkit-0.2.1/README.md +157 -0
- openmatchkit-0.2.1/ROADMAP.md +43 -0
- openmatchkit-0.2.1/SECURITY.md +28 -0
- openmatchkit-0.2.1/docs/detailed-data.md +26 -0
- openmatchkit-0.2.1/docs/index.md +21 -0
- openmatchkit-0.2.1/docs/prediction.md +8 -0
- openmatchkit-0.2.1/docs/sources.md +5 -0
- openmatchkit-0.2.1/examples/fixtures_demo.py +8 -0
- openmatchkit-0.2.1/examples/live_demo.py +8 -0
- openmatchkit-0.2.1/examples/prediction_demo.py +8 -0
- openmatchkit-0.2.1/pyproject.toml +72 -0
- openmatchkit-0.2.1/src/openmatchkit/__init__.py +41 -0
- openmatchkit-0.2.1/src/openmatchkit/cli.py +182 -0
- openmatchkit-0.2.1/src/openmatchkit/client.py +405 -0
- openmatchkit-0.2.1/src/openmatchkit/exceptions.py +14 -0
- openmatchkit-0.2.1/src/openmatchkit/export.py +94 -0
- openmatchkit-0.2.1/src/openmatchkit/http.py +181 -0
- openmatchkit-0.2.1/src/openmatchkit/models.py +198 -0
- openmatchkit-0.2.1/src/openmatchkit/prediction/__init__.py +7 -0
- openmatchkit-0.2.1/src/openmatchkit/prediction/elo.py +43 -0
- openmatchkit-0.2.1/src/openmatchkit/prediction/poisson.py +99 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/__init__.py +11 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/base.py +29 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/football_data_uk.py +121 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/json_file.py +189 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/openfootball.py +235 -0
- openmatchkit-0.2.1/src/openmatchkit/sources/public_html.py +41 -0
- openmatchkit-0.2.1/tests/fixtures/sample_detailed_source.json +160 -0
- openmatchkit-0.2.1/tests/fixtures/sample_football_data.csv +3 -0
- openmatchkit-0.2.1/tests/fixtures/sample_openfootball.json +25 -0
- openmatchkit-0.2.1/tests/test_client.py +79 -0
- openmatchkit-0.2.1/tests/test_detailed_data.py +45 -0
- openmatchkit-0.2.1/tests/test_export.py +23 -0
- openmatchkit-0.2.1/tests/test_football_data_uk.py +25 -0
- openmatchkit-0.2.1/tests/test_http.py +42 -0
- openmatchkit-0.2.1/tests/test_models.py +24 -0
- openmatchkit-0.2.1/tests/test_openfootball.py +39 -0
- openmatchkit-0.2.1/tests/test_prediction.py +49 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report something that is not working
|
|
4
|
+
title: "[Bug]: "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What happened?
|
|
10
|
+
|
|
11
|
+
## Steps to reproduce
|
|
12
|
+
|
|
13
|
+
1.
|
|
14
|
+
2.
|
|
15
|
+
3.
|
|
16
|
+
|
|
17
|
+
## Expected behavior
|
|
18
|
+
|
|
19
|
+
## Environment
|
|
20
|
+
|
|
21
|
+
- Python version:
|
|
22
|
+
- openmatchkit version:
|
|
23
|
+
- Operating system:
|
|
24
|
+
|
|
25
|
+
## Extra context
|
|
26
|
+
|
|
27
|
+
Please do not paste private tokens, cookies, credentials, or private source data.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an improvement
|
|
4
|
+
title: "[Feature]: "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Feature
|
|
10
|
+
|
|
11
|
+
## Why is this useful?
|
|
12
|
+
|
|
13
|
+
## Suggested API or CLI
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Source/legal notes
|
|
20
|
+
|
|
21
|
+
Does this require data from a third-party source? If yes, include public terms/licensing context.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Source adapter
|
|
3
|
+
about: Propose or implement a public data source adapter
|
|
4
|
+
title: "[Source]: "
|
|
5
|
+
labels: source, help wanted
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Source
|
|
10
|
+
|
|
11
|
+
## Data provided
|
|
12
|
+
|
|
13
|
+
- Fixtures:
|
|
14
|
+
- Results:
|
|
15
|
+
- Live scores:
|
|
16
|
+
- Scoreboards:
|
|
17
|
+
- Player stats:
|
|
18
|
+
|
|
19
|
+
## Terms and robots.txt
|
|
20
|
+
|
|
21
|
+
Link source terms and robots.txt here.
|
|
22
|
+
|
|
23
|
+
## Test strategy
|
|
24
|
+
|
|
25
|
+
Adapters should use saved fixtures in CI, not live network calls.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
## Tests
|
|
4
|
+
|
|
5
|
+
- [ ] `ruff check .`
|
|
6
|
+
- [ ] `ruff format --check .`
|
|
7
|
+
- [ ] `pytest`
|
|
8
|
+
|
|
9
|
+
## Source Safety
|
|
10
|
+
|
|
11
|
+
- [ ] No private, paid, login-only, or protected data source is used.
|
|
12
|
+
- [ ] Source attribution is included when data is fetched or parsed.
|
|
13
|
+
- [ ] New adapters use saved fixtures in tests.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install package
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
python -m pip install -e ".[dev]"
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: ruff check .
|
|
31
|
+
|
|
32
|
+
- name: Format check
|
|
33
|
+
run: ruff format --check .
|
|
34
|
+
|
|
35
|
+
- name: Test
|
|
36
|
+
run: pytest
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
name: Build and publish to PyPI
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
environment: pypi
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
id-token: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
|
|
29
|
+
- name: Install build tooling
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
python -m pip install build
|
|
33
|
+
|
|
34
|
+
- name: Build distributions
|
|
35
|
+
run: python -m build
|
|
36
|
+
|
|
37
|
+
- name: Publish to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.2.1 - 2026-06-12
|
|
4
|
+
|
|
5
|
+
- Added GitHub Actions trusted publishing workflow for PyPI.
|
|
6
|
+
- Added README badges, roadmap, security policy, issue templates, and PR template.
|
|
7
|
+
- Improved project onboarding and GitHub discoverability.
|
|
8
|
+
|
|
9
|
+
## v0.2.0 - 2026-06-12
|
|
10
|
+
|
|
11
|
+
- Added rich scoreboard models for clock, events, lineups, team stats, and player stats.
|
|
12
|
+
- Added `PlayerHistory` models and aggregation from detailed source data.
|
|
13
|
+
- Added `JsonFileSource` for authorized/public detailed JSON feeds and saved fixtures.
|
|
14
|
+
- Added CLI commands:
|
|
15
|
+
- `openmatch next-match`
|
|
16
|
+
- `openmatch scoreboards`
|
|
17
|
+
- `openmatch scoreboard`
|
|
18
|
+
- `openmatch live-scoreboards`
|
|
19
|
+
- `openmatch player-history`
|
|
20
|
+
- Added publish-ready wheel and source distribution checks.
|
|
21
|
+
|
|
22
|
+
## v0.1.0 - 2026-06-12
|
|
23
|
+
|
|
24
|
+
- Initial package structure.
|
|
25
|
+
- Added OpenFootball adapter.
|
|
26
|
+
- Added Football-Data.co.uk CSV adapter.
|
|
27
|
+
- Added safe HTTP client with robots.txt checks, caching, and rate limiting.
|
|
28
|
+
- Added fixtures, results, live score interface, standings, exports, CLI, and prediction baseline.
|
|
29
|
+
- Added tests, docs, source policy, privacy policy, MIT license, and CI.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
openmatchkit is for education, research, and practical public-data tooling. Keep contributions respectful, source-aware, and honest about limitations.
|
|
4
|
+
|
|
5
|
+
Expected behavior:
|
|
6
|
+
|
|
7
|
+
- Be considerate in issues, reviews, and discussions.
|
|
8
|
+
- Credit sources clearly.
|
|
9
|
+
- Avoid misleading claims about official data, real-time quality, or prediction accuracy.
|
|
10
|
+
- Respect privacy, copyright, and source access rules.
|
|
11
|
+
|
|
12
|
+
Unacceptable behavior:
|
|
13
|
+
|
|
14
|
+
- Harassment or personal attacks.
|
|
15
|
+
- Attempts to add bypasses for access controls, paywalls, CAPTCHA, private APIs, or protected feeds.
|
|
16
|
+
- Misrepresentation of third-party data or affiliation.
|
|
17
|
+
|
|
18
|
+
Maintainers may remove contributions or discussion that conflict with these rules.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve openmatchkit.
|
|
4
|
+
|
|
5
|
+
## Source adapter rules
|
|
6
|
+
|
|
7
|
+
Adapters must:
|
|
8
|
+
|
|
9
|
+
1. Respect source Terms of Service.
|
|
10
|
+
2. Respect robots.txt.
|
|
11
|
+
3. Avoid login-only, paid, private, or protected endpoints.
|
|
12
|
+
4. Avoid bypassing CAPTCHA, paywalls, anti-bot systems, geoblocks, or tokens.
|
|
13
|
+
5. Use caching and reasonable request rates.
|
|
14
|
+
6. Return source URL and fetched timestamp.
|
|
15
|
+
7. Include tests using saved fixtures, not live website calls in CI.
|
|
16
|
+
8. Avoid copyrighted media, articles, video, logos, and images.
|
|
17
|
+
|
|
18
|
+
## Development
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
python -m pip install -e ".[dev]"
|
|
22
|
+
ruff check .
|
|
23
|
+
ruff format .
|
|
24
|
+
pytest
|
|
25
|
+
python -m build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Prediction models
|
|
29
|
+
|
|
30
|
+
Prediction features must be documented as educational baselines. Do not market predictions as guaranteed outcomes, betting advice, financial advice, or professional advice.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Data Sources
|
|
2
|
+
|
|
3
|
+
This project separates the MIT license for code from third-party data-source terms. Do not assume a source is open licensed just because it is public or free to download.
|
|
4
|
+
|
|
5
|
+
## OpenFootball
|
|
6
|
+
|
|
7
|
+
Links:
|
|
8
|
+
|
|
9
|
+
- https://github.com/openfootball/football.json
|
|
10
|
+
- https://github.com/openfootball/worldcup.json
|
|
11
|
+
|
|
12
|
+
Use:
|
|
13
|
+
|
|
14
|
+
- Historical fixtures
|
|
15
|
+
- Historical results
|
|
16
|
+
- World Cup datasets
|
|
17
|
+
- Demo and test-friendly schemas
|
|
18
|
+
|
|
19
|
+
Notes:
|
|
20
|
+
|
|
21
|
+
- Preferred source for the default adapter.
|
|
22
|
+
- Upstream repositories describe their data as public domain or CC0 depending on repository.
|
|
23
|
+
- The adapter fetches from source and includes source URL plus fetch timestamp on each match.
|
|
24
|
+
|
|
25
|
+
## Football-Data.co.uk
|
|
26
|
+
|
|
27
|
+
Link:
|
|
28
|
+
|
|
29
|
+
- https://www.football-data.co.uk/
|
|
30
|
+
|
|
31
|
+
Use:
|
|
32
|
+
|
|
33
|
+
- Historical CSV results
|
|
34
|
+
- Prediction experiments
|
|
35
|
+
- Match statistics available in the public CSV files
|
|
36
|
+
|
|
37
|
+
Notes:
|
|
38
|
+
|
|
39
|
+
- Keep this as an optional adapter.
|
|
40
|
+
- Do not bundle or redistribute the site's CSV files in this repository.
|
|
41
|
+
- Users should check the current website terms before using downloaded data beyond local research or development.
|
|
42
|
+
|
|
43
|
+
## Public HTML Pages
|
|
44
|
+
|
|
45
|
+
Use:
|
|
46
|
+
|
|
47
|
+
- Best-effort live scores
|
|
48
|
+
- Public facts only, such as teams, score, match date, status, and venue
|
|
49
|
+
- Public player sporting facts only when the source terms allow it
|
|
50
|
+
|
|
51
|
+
Rules for public HTML adapters:
|
|
52
|
+
|
|
53
|
+
1. Respect the source Terms of Service.
|
|
54
|
+
2. Respect robots.txt.
|
|
55
|
+
3. Do not bypass login, CAPTCHA, paywalls, geoblocks, tokens, or anti-bot systems.
|
|
56
|
+
4. Do not copy images, logos, articles, video, protected feeds, or copyrighted media.
|
|
57
|
+
5. Use caching and low request rates.
|
|
58
|
+
6. Include source URL and fetched timestamp.
|
|
59
|
+
7. Use saved HTML fixtures in tests instead of live requests in CI.
|
|
60
|
+
8. Do not collect private personal data, contact data, sensitive data, or non-public player information.
|
|
61
|
+
|
|
62
|
+
## Local Detailed JSON
|
|
63
|
+
|
|
64
|
+
Use:
|
|
65
|
+
|
|
66
|
+
- Authorized public feeds
|
|
67
|
+
- Saved fixture data for demos and tests
|
|
68
|
+
- Scoreboards, lineups, match events, team stats, player match stats, and player histories
|
|
69
|
+
|
|
70
|
+
Notes:
|
|
71
|
+
|
|
72
|
+
- `JsonFileSource` performs no network requests.
|
|
73
|
+
- It is the safest way to integrate detailed data that users are allowed to store and process.
|
|
74
|
+
- The package schema accepts optional fields so sources can return only the facts they lawfully provide.
|
|
75
|
+
|
|
76
|
+
Relevant standard:
|
|
77
|
+
|
|
78
|
+
- https://www.rfc-editor.org/rfc/rfc9309
|
|
79
|
+
|
|
80
|
+
## Non-affiliation
|
|
81
|
+
|
|
82
|
+
openmatchkit is not affiliated with, endorsed by, or sponsored by FIFA, any football federation, league, club, broadcaster, sportsbook, or data provider.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prashant Patil
|
|
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,192 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openmatchkit
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Unofficial open-source football match data toolkit using public sources.
|
|
5
|
+
Project-URL: Homepage, https://github.com/patilprashan246/openmatchkit
|
|
6
|
+
Project-URL: Repository, https://github.com/patilprashan246/openmatchkit
|
|
7
|
+
Project-URL: Issues, https://github.com/patilprashan246/openmatchkit/issues
|
|
8
|
+
Author: Prashant Patil
|
|
9
|
+
License: MIT License
|
|
10
|
+
Keywords: cli,fixtures,football,open-data,prediction,scores,soccer,world-cup
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: beautifulsoup4>=4.12
|
|
25
|
+
Requires-Dist: httpx>=0.27
|
|
26
|
+
Requires-Dist: lxml>=5.0
|
|
27
|
+
Requires-Dist: pydantic>=2.7
|
|
28
|
+
Requires-Dist: typer>=0.12
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
33
|
+
Requires-Dist: twine>=5.1; extra == 'dev'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# openmatchkit
|
|
37
|
+
|
|
38
|
+
[](https://github.com/patilprashan246/openmatchkit/actions/workflows/ci.yml)
|
|
39
|
+
[](https://github.com/patilprashan246/openmatchkit/releases)
|
|
40
|
+
[](pyproject.toml)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
|
|
43
|
+
Unofficial open-source football match data toolkit for fixtures, results, best-effort live score adapters, standings, exports, and simple prediction models.
|
|
44
|
+
|
|
45
|
+
> This project is unofficial and not affiliated with FIFA, any league, club, broadcaster, federation, or data provider. It does not provide official FIFA data.
|
|
46
|
+
|
|
47
|
+
## Why openmatchkit?
|
|
48
|
+
|
|
49
|
+
openmatchkit gives Python developers a clean, source-attributed way to work with public football match facts without paid API keys. It starts with open/public datasets, keeps scraping optional and conservative, and returns structured JSON-ready models.
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install git+https://github.com/patilprashan246/openmatchkit.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For a pinned release:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install git+https://github.com/patilprashan246/openmatchkit.git@v0.2.1
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For local development:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python -m venv .venv
|
|
67
|
+
.venv\Scripts\activate
|
|
68
|
+
python -m pip install --upgrade pip
|
|
69
|
+
python -m pip install -e ".[dev]"
|
|
70
|
+
pytest
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Quick Start
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from openmatchkit import MatchClient
|
|
77
|
+
|
|
78
|
+
client = MatchClient()
|
|
79
|
+
next_match = client.next_match(competition="worldcup", season="2026")
|
|
80
|
+
|
|
81
|
+
print(next_match.model_dump(mode="json"))
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
openmatch next-match --competition worldcup --season 2026
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Python API
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from openmatchkit import MatchClient
|
|
92
|
+
|
|
93
|
+
client = MatchClient()
|
|
94
|
+
|
|
95
|
+
fixtures = client.fixtures(competition="worldcup", season="2026")
|
|
96
|
+
results = client.results(competition="worldcup", season="2026")
|
|
97
|
+
live = client.live_scores()
|
|
98
|
+
next_match = client.next_match(competition="worldcup", season="2026")
|
|
99
|
+
prediction = client.predict(home="Mexico", away="South Africa", history=results)
|
|
100
|
+
|
|
101
|
+
client.export_json(fixtures, "fixtures.json")
|
|
102
|
+
client.export_csv(fixtures, "fixtures.csv")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
League datasets from OpenFootball can be fetched with codes such as:
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
matches = client.fixtures(competition="en.1", season="2015-16")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## CLI
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
openmatch fixtures --competition worldcup --season 2026
|
|
115
|
+
openmatch results --competition en.1 --season 2015-16 --format csv --output results.csv
|
|
116
|
+
openmatch next-match --competition worldcup --season 2026
|
|
117
|
+
openmatch standings --competition worldcup --season 2026
|
|
118
|
+
openmatch predict --home Mexico --away "South Africa" --competition worldcup --season 2026
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Detailed JSON feeds can expose richer scoreboards and player history:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
openmatch scoreboards --data-file tests/fixtures/sample_detailed_source.json
|
|
125
|
+
openmatch scoreboard --match-id detail-1 --data-file tests/fixtures/sample_detailed_source.json
|
|
126
|
+
openmatch live-scoreboards --data-file tests/fixtures/sample_detailed_source.json
|
|
127
|
+
openmatch player-history --player "Alex Demo" --data-file tests/fixtures/sample_detailed_source.json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from openmatchkit import MatchClient
|
|
132
|
+
from openmatchkit.sources.json_file import JsonFileSource
|
|
133
|
+
|
|
134
|
+
client = MatchClient(sources=[JsonFileSource("tests/fixtures/sample_detailed_source.json")])
|
|
135
|
+
scoreboard = client.scoreboard(match_id="detail-1")
|
|
136
|
+
history = client.player_history("Alex Demo")
|
|
137
|
+
print(scoreboard.model_dump(mode="json"))
|
|
138
|
+
print(history.model_dump(mode="json"))
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Example Output
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"competition": "World Cup 2026",
|
|
146
|
+
"home": {"name": "Canada"},
|
|
147
|
+
"away": {"name": "Bosnia & Herzegovina"},
|
|
148
|
+
"status": "scheduled",
|
|
149
|
+
"source": "openfootball"
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Features
|
|
154
|
+
|
|
155
|
+
- Unified match, scoreboard, player history, standings, and prediction models
|
|
156
|
+
- OpenFootball JSON adapter
|
|
157
|
+
- Football-Data.co.uk CSV adapter
|
|
158
|
+
- Local detailed JSON adapter for authorized/public detailed feeds
|
|
159
|
+
- Generic optional public HTML adapter
|
|
160
|
+
- Safe HTTP client with robots.txt checks, caching, user agent, and per-origin delay
|
|
161
|
+
- Fixtures, results, next match, live score adapter interface, team info, standings
|
|
162
|
+
- Detailed scoreboards: clock, events, lineups, team stats, and player match stats when provided
|
|
163
|
+
- Player histories aggregated from player-level source data
|
|
164
|
+
- Simple Poisson prediction baseline and small Elo rating helper
|
|
165
|
+
- JSON and CSV export helpers
|
|
166
|
+
- Offline tests using local fixtures
|
|
167
|
+
|
|
168
|
+
## Current Status
|
|
169
|
+
|
|
170
|
+
- Stable enough for demos, research, education, and early open-source feedback
|
|
171
|
+
- Not official live FIFA data
|
|
172
|
+
- True live/player-level data requires a lawful source adapter that provides those facts
|
|
173
|
+
- Public roadmap: [ROADMAP.md](ROADMAP.md)
|
|
174
|
+
- Release notes: [CHANGELOG.md](CHANGELOG.md)
|
|
175
|
+
|
|
176
|
+
## Source and legal policy
|
|
177
|
+
|
|
178
|
+
The package code is MIT licensed. Third-party data sources have their own licenses and terms. Optional scraping adapters must respect Terms of Service, robots.txt, caching, and rate limits. Player-level data should only come from public or authorized sources and should contain public sporting facts, not private or sensitive information.
|
|
179
|
+
|
|
180
|
+
See [DATA_SOURCES.md](DATA_SOURCES.md), [PRIVACY.md](PRIVACY.md), and [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
181
|
+
|
|
182
|
+
## Development
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
python -m pip install -e ".[dev]"
|
|
186
|
+
ruff check .
|
|
187
|
+
ruff format .
|
|
188
|
+
pytest
|
|
189
|
+
python -m build
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The prediction output is an educational baseline only. It is not betting, financial, or professional advice.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Privacy
|
|
2
|
+
|
|
3
|
+
openmatchkit is a local Python library. It does not include telemetry, analytics, tracking, accounts, cookies, or background data collection.
|
|
4
|
+
|
|
5
|
+
Network requests happen only when user code or CLI commands call a source adapter that fetches public data. Those requests disclose normal HTTP metadata to the source, including IP address and User-Agent.
|
|
6
|
+
|
|
7
|
+
Project rules:
|
|
8
|
+
|
|
9
|
+
- Fetch public match facts only.
|
|
10
|
+
- Do not collect personal data.
|
|
11
|
+
- Do not process private accounts, login-only pages, or private APIs.
|
|
12
|
+
- Do not store credentials in this package.
|
|
13
|
+
- Do not bypass source protections or access controls.
|
|
14
|
+
- Player data must be limited to public sporting facts from public or authorized sources, such as match appearances, goals, cards, and minutes played.
|
|
15
|
+
- Do not collect contact information, private profiles, sensitive data, medical data, private social media data, or non-public information about players.
|
|
16
|
+
|
|
17
|
+
If a community adapter needs credentials, it should live outside the default package or be clearly optional, documented, and disabled by default.
|