https://github.com/tegenterter/fide-data
Library for processing open data published by FIDE for PHP
https://github.com/tegenterter/fide-data
chess library opendata php scraping
Last synced: about 1 month ago
JSON representation
Library for processing open data published by FIDE for PHP
- Host: GitHub
- URL: https://github.com/tegenterter/fide-data
- Owner: tegenterter
- Created: 2020-11-06T21:12:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-03T12:27:08.000Z (almost 2 years ago)
- Last Synced: 2025-12-14T12:43:13.234Z (7 months ago)
- Topics: chess, library, opendata, php, scraping
- Language: PHP
- Homepage:
- Size: 78.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

**Library for processing open data published by [FIDE](https://www.fide.com) for [PHP](https://php.net)**
[](https://travis-ci.org/tegenterter/fide-data)
## Features
- Download all player rating XML files [published by FIDE](https://ratings.fide.com/download_lists.phtml)
- Read and parse player rating XML files
## Documentation
### Installation
Use [Composer](https://getcomposer.org) to install the library for your project:
composer require tegenterter/fide-data
### Basic Usage
```php
download(\FideData\Enum\RatingType::STANDARD, 2020, 12);
// Read and parse the rating file
$rating = new \FideData\PlayerRating($path);
/** @var \FideData\Structure\Player $player */
foreach ($rating->process() as $player) {
// Get array representation of the player object
$array = $player->toArray();
echo json_encode($array, JSON_PRETTY_PRINT) . PHP_EOL;
/**
{
"fideId": 1503014,
"name": "Carlsen, Magnus",
"federation": "NOR",
"birthYear": 1990,
"sex": "M",
"title": "GM",
"standardRating": {
"type": "standard",
"rating": 2862,
"k": 10
},
"rapidRating": null,
"blitzRating": null,
"active": true
}
*/
}
```
### Testing
The library is covered by unit tests using [PHPUnit](https://phpunit.de). You can use the following [Composer](https://getcomposer.org) script to run them:
composer run test