PHPackages                             huehue/pgn-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. huehue/pgn-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

huehue/pgn-parser
=================

Parse PGN files

0.7.0(1y ago)012MITPHPPHP ^8.3CI passing

Since May 10Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/HueHue-dev/pgn-parser)[ Packagist](https://packagist.org/packages/huehue/pgn-parser)[ RSS](/packages/huehue-pgn-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

PGN Parser
==========

[](#pgn-parser)

[![Test status](https://github.com/HueHue-dev/pgn-parser/actions/workflows/tests.yml/badge.svg)](https://github.com/HueHue-dev/pgn-parser/actions)[![Latest Stable Version](https://camo.githubusercontent.com/313994489944f94160a5a9c10bb3dfbc489260972d9c3c2c5a840019b701b3d6/687474703a2f2f706f7365722e707567782e6f72672f6875656875652f70676e2d7061727365722f76)](https://packagist.org/packages/huehue/pgn-parser)[![Total Downloads](https://camo.githubusercontent.com/4a5564b52b95dc40324836aebe50ee240193566b54f06a431392b8a588226aae/687474703a2f2f706f7365722e707567782e6f72672f6875656875652f70676e2d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/huehue/pgn-parser)[![License](https://camo.githubusercontent.com/c1a70cc840830fab9404a25cacc9264ed3bad816384bc97303330965d526441f/687474703a2f2f706f7365722e707567782e6f72672f6875656875652f70676e2d7061727365722f6c6963656e7365)](https://packagist.org/packages/huehue/pgn-parser)

A PHP library for parsing Portable Game Notation (PGN) files. This library is designed to extract chess game metadata and moves from PGN strings. It validates move syntax, including support for move annotations.

Features
--------

[](#features)

- **PGN Parsing:** Parses PGN formatted strings.
- **Tag Extraction:** Extracts tag pairs (e.g., `[Event "Chess Game"]`, `[Site "Home"]`).
- **Move Parsing:** Parses chess moves, including SAN notation.
- **Move Validation:** Validates move syntax, including:
    - Basic piece moves (e.g., Ne5, Ra1, Qf3)
    - Piece captures (e.g., Qxe7, Rxf5)
    - Pawn moves (e.g., e4, d5)
    - Pawn captures (e.g., exd5, bxa6)
    - Pawn promotions (e.g., e8=Q, d8=N+)
    - Castling (`O-O`, `O-O-O`)
    - Disambiguation (e.g., Rae1, Nfd2)
    - Move annotations/evaluation symbols (+, #, !, ?, !!, ??, !?, ?!)

Installation
------------

[](#installation)

The preferred method of installation is via [Composer](https://getcomposer.org/):

```
composer require huehue/pgn-parser
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance60

Regular maintenance activity

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

367d ago

PHP version history (2 changes)0.5.0PHP ^8.1

0.7.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/92b5929de6bb89c36702e172079ab9dbe7ddc88793f7142c5d5e62afeb35cad7?d=identicon)[HueHue](/maintainers/HueHue)

---

Top Contributors

[![HueHue-dev](https://avatars.githubusercontent.com/u/72305912?v=4)](https://github.com/HueHue-dev "HueHue-dev (37 commits)")

---

Tags

chessparserpgnpgn-parserphpsymfony

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/huehue-pgn-parser/health.svg)

```
[![Health](https://phpackages.com/badges/huehue-pgn-parser/health.svg)](https://phpackages.com/packages/huehue-pgn-parser)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
