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 7mo 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 today

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

30

—

LowBetter than 62% of packages

Maintenance55

Moderate activity, may be stable

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

412d ago

PHP version history (2 changes)0.5.0PHP ^8.1

0.7.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/899672?v=4)[HueHue](/maintainers/HueHue)[@huehue](https://github.com/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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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