{"id":15808445,"url":"https://github.com/ghostbuster91/pgn-parser","last_synced_at":"2026-01-19T06:33:08.314Z","repository":{"id":57733318,"uuid":"343094681","full_name":"ghostbuster91/pgn-parser","owner":"ghostbuster91","description":"Parser for chess games stored as PGN using standard arithmetic notation","archived":false,"fork":false,"pushed_at":"2023-07-10T20:35:55.000Z","size":1522,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T21:43:55.331Z","etag":null,"topics":["chess","parser","pgn"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostbuster91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-28T12:01:33.000Z","updated_at":"2023-07-10T20:36:01.000Z","dependencies_parsed_at":"2024-10-26T09:08:29.818Z","dependency_job_id":null,"html_url":"https://github.com/ghostbuster91/pgn-parser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ghostbuster91/pgn-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbuster91%2Fpgn-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbuster91%2Fpgn-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbuster91%2Fpgn-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbuster91%2Fpgn-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostbuster91","download_url":"https://codeload.github.com/ghostbuster91/pgn-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbuster91%2Fpgn-parser/sbom","scorecard":{"id":425850,"data":{"date":"2025-08-11","repo":{"name":"github.com/ghostbuster91/pgn-parser","commit":"1ab16f4eb69876539d226015ecf9460b86adc008"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ghostbuster91/pgn-parser/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/ghostbuster91/pgn-parser/main.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T02:13:35.834Z","repository_id":57733318,"created_at":"2025-08-19T02:13:35.834Z","updated_at":"2025-08-19T02:13:35.834Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","parser","pgn"],"created_at":"2024-10-05T03:01:56.293Z","updated_at":"2026-01-19T06:33:08.291Z","avatar_url":"https://github.com/ghostbuster91.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgn-parser\n\n[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/workflow/status/ghostbuster91/pgn-parser/CI/master?style=for-the-badge\" height=\"24\"\u003e](https://github.com/ghostbuster91/pgn-parser/actions)\n[\u003cimg alt=\"Maven Central\" src=\"https://img.shields.io/maven-central/v/io.github.ghostbuster91.pgnparser/core_2.13?style=for-the-badge\" height=\"24\"\u003e](https://search.maven.org/artifact/io.github.ghostbuster91.pgnparser/core_2.13)\n\n### parser\n\nParser can simply parse chess games stored in [PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation) format.\n\n```scala\nval inputGame = \"1. e4 e5 2. Bc4 Bc5 3. Qh5 Nf6 4. Qxf7# 1-0\"\nPgnParser.pgnGame.parseAll(inputGame)\nres1: Either[cats.parse.Parser.Error, io.github.ghostbuster91.pgnparser.parser.PgnGame] =\nRight(\n  PgnGame(\n    List(),\n    List(\n      Round(\n        1,\n        PawnMove(Position('e', '4'), NoCheck, None),\n        Some(PawnMove(Position('e', '5'), NoCheck, None))\n      ),\n      Round(\n        2,\n        FigureMove(Bishop, Position('c', '4'), NoCheck, None, None, false),\n        Some(FigureMove(Bishop, Position('c', '5'), NoCheck, None, None, false))\n      ),\n      Round(\n        3,\n        FigureMove(Queen, Position('h', '5'), NoCheck, None, None, false),\n        Some(FigureMove(Knight, Position('f', '6'), NoCheck, None, None, false))\n      ),\n      Round(4, FigureMove(Queen, Position('f', '7'), Checkmate, None, None, true), None)\n    ),\n    WhiteWins\n  )\n)\n```\n\nIn case of malformed input an error will be returned:\n\n```scala\nval malformedGame = \"1. e4 e5 2. Bc4 Bc5 3. Qh5 Nf6asdasd\"\nPgnParser.pgnGame.parseAll(malformedGame)\nres6: Either[cats.parse.Parser.Error, io.github.ghostbuster91.pgnparser.parser.PgnGame] = Left(\n  Error(\n    20,\n    NonEmptyList(Str(20, \"0-1\"), List(Str(20, \"1-0\"), Str(20, \"1/2-1/2\"), InRange(20, '*', '*')))\n  )\n)\n```\n\n### reader\n\nReader is an abstraction build on top of parser. Apart from parsing the game, reader also converts it to unambiogious [LAN](\u003chttps://en.wikipedia.org/wiki/Algebraic_notation_(chess)#Long_algebraic_notation\u003e) format. It does that by partially implementing chess rules needed to filter out incorrect movements.\n\n```scala\nval inputGame = \"1. e4 e5 2. Bc4 Bc5 3. Qh5 Nf6 4. Qxf7# 1-0\"\nnew PgnReader().read(inputGame)\nres2: Either[io.github.ghostbuster91.pgnparser.core.ParsingException, io.github.ghostbuster91.pgnparser.core.ChessGame] = Right(\n  ChessGame(\n    Board(\n      HashMap(\n        Coordinate(1, 0) -\u003e PlayerPiece(Knight, White),\n        Coordinate(4, 3) -\u003e PlayerPiece(Pawn, White),\n        Coordinate(4, 7) -\u003e PlayerPiece(King, Black),\n        Coordinate(3, 7) -\u003e PlayerPiece(Queen, Black),\n        Coordinate(7, 1) -\u003e PlayerPiece(Pawn, White),\n        Coordinate(4, 0) -\u003e PlayerPiece(King, White),\n        Coordinate(1, 1) -\u003e PlayerPiece(Pawn, White),\n        Coordinate(0, 1) -\u003e PlayerPiece(Pawn, White),\n        Coordinate(0, 0) -\u003e PlayerPiece(Rook, White),\n...\n```\n\nThe whole output is actually to big to be included in the readme as reader outputs the game as a list of state transistions of a chess board. The structer of the result looks as follows:\n\n```scala\ncase class ChessGame(\n    board: Board,\n    currentPlayer: Player,\n    previousState: Option[(ChessGame, LanMove)]\n)\n```\n\nReader does not verify game's correctness. The game is assumed to be valid.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbuster91%2Fpgn-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostbuster91%2Fpgn-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbuster91%2Fpgn-parser/lists"}