Skip to main content

Library for parsing .gnr game notation files

Project description

Localizations

GNR Parser

A lightweight library for parsing .gnr (Game Notation Record) files and operating on structured game data.

Features

  • gnrparser.read(data: str): Parses raw GNR text and returns structured tag and move data.
  • gnrparser.analyze(data: dict): Takes parsed data and returns normalized output with default fields and autocompletions.

GNR Format Specification (Version 1)

Each GNR file may include the following fields:

  • [Version: INTEGER] — Format version.
  • [Game: STRING] — Name of the game.
  • [P<INT>: STRING] — Player index and name. The format supports any number of players (e.g. [P1: Alice], [P2: Bob]).
  • [Variation: STRING] — Name of the game variation.
  • [Termination: STRING] — How the game ended. Use "null" if the game is still in progress.
  • [Date: STRING] — Date of the game (format: DD.MM.YYYY).
  • [Field Size: INT, INT] — Width and height of the game field.
  • [Time Limit: STRING] — Time control format. Examples: 10+5, 15, or null (no time limit).
  • [Organization: STRING] — Where or by whom the game was held.
  • [Start Position: STRING] — Encoded initial field position (custom format, game-specific).
  • 1. MOVES 2. MOVES 3. ... — Turn-based move list (space-separated per turn).

Installation

pip install gnrparser

Usage

import gnrparser

raw_data = "...your GNR content..."
parsed = gnrparser.read(raw_data)
analyzed = gnrparser.analyze(parsed)

Author

BesBobowyy — 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnrparser-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gnrparser-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file gnrparser-1.0.0.tar.gz.

File metadata

  • Download URL: gnrparser-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gnrparser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2f4619ca74291236bd3a08a134cb9952b636f4523bb75cabb0a26c9cc6a72242
MD5 ad9534615d779fe2b7614d29f801c53a
BLAKE2b-256 d30b67427d35abc7a53ebc23122bac6688dd7949afc726175ec770707b7dc8c1

See more details on using hashes here.

File details

Details for the file gnrparser-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gnrparser-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gnrparser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7116225aa25ce1e0b2512c07ef9d1a0f7db0ba408d3ecefffc95a9588290ba96
MD5 a00b50b6e76cc9178f841d1233f4f697
BLAKE2b-256 6517614289e522c43206d594e3261ab231cda803d9f8c678e735a9b9bf93a0cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page