Metadata-Version: 2.4
Name: chess-tcn
Version: 0.0.1
Summary: Encode and decode TCN, a move format used by Chess.com's API
Author: chess-tcn
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Chess TCN Python

## Overview
**Chess TCN Python** is a Python package that provides functionality to encode and decode TCN (Tournament Chess Notation), a move format used by **Chess.com**'s live-game API. This package is ideal for developers looking to work with TCN in Python applications.

## What is TCN?
TCN is a format used by **Chess.com** to transmit move lists in its JSON API. A typical endpoint for retrieving a game’s move list is:
```
https://www.chess.com/callback/live/game/{gameId}
```
This endpoint returns a `moveList` field containing a TCN string.

## Features
- Decode TCN strings into PGN (Portable Game Notation).
- Encode PGN back into TCN format.

## Installation
To install the package, use pip:
```bash
pip install chess-tcn
```

## Usage
Here’s a quick example of how to use the package:

```python
from chess_tcn import decode_tcn, encode_pgn

# Decode TCN to PGN
tcn_string = 'mC0Kgv7Tbq5Qlt9IqHT7cM1TMFWOHs2MFwZRfm6Eeg'
pgn = decode_tcn(tcn_string)
print(pgn)

# Encode PGN back to TCN
new_tcn_string = encode_pgn(pgn)
print(new_tcn_string)
```

## License
This project is licensed under the MIT License. See below for full text.
```
MIT License

Copyright (c) 2021-2025 chess-tcn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
