Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chesszebra/pgn-splitter
A PHP library to split PGN files into chunks per game.
https://github.com/chesszebra/pgn-splitter
chess chess-game pgn php portable-game-notation split splitter splitting
Last synced: 3 days ago
JSON representation
A PHP library to split PGN files into chunks per game.
- Host: GitHub
- URL: https://github.com/chesszebra/pgn-splitter
- Owner: chesszebra
- License: mit
- Created: 2017-09-03T13:01:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T09:42:44.000Z (almost 5 years ago)
- Last Synced: 2024-04-14T00:16:43.187Z (7 months ago)
- Topics: chess, chess-game, pgn, php, portable-game-notation, split, splitter, splitting
- Language: PHP
- Size: 15.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pgn-splitter
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]A PHP library to split PGN files into chunks per game or per section.
## Installation
Via composer:
```bash
composer require chesszebra/pgn-splitter
```## Usage
Split a stream per game:
```php
use ChessZebra\Chess\Pgn\Splitter;$stream = fopen('my-games.pgn', 'r');
$splitter = new Splitter($stream, Splitter::SPLIT_GAMES);
$splitter->split(function(string $buffer) {
echo $buffer;
});
```Or split a stream per chunk (tags and moves chunks):
```php
use ChessZebra\Chess\Pgn\Splitter;$stream = fopen('my-games.pgn', 'r');
$splitter = new Splitter($stream, Splitter::SPLIT_CHUNKS);
$splitter->split(function(string $buffer) {
echo $buffer;
});
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
## Security
If you discover any security related issues, please report them via [HackerOne][link-hackerone].
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/chesszebra/pgn-splitter.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/chesszebra/pgn-splitter/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/chesszebra/pgn-splitter.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/chesszebra/pgn-splitter.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/chesszebra/pgn-splitter.svg?style=flat-square[link-packagist]: https://packagist.org/packages/chesszebra/pgn-splitter
[link-travis]: https://travis-ci.org/chesszebra/pgn-splitter
[link-scrutinizer]: https://scrutinizer-ci.com/g/chesszebra/pgn-splitter/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/chesszebra/pgn-splitter
[link-downloads]: https://packagist.org/packages/chesszebra/pgn-splitter
[link-contributors]: ../../contributors
[link-hackerone]: https://hackerone.com/chesszebra