semvec/pypi-packages huggingface dataset:
chess-tcn 1.0.1
Encode and decode TCN, a move format used by Chess.com's API
License: MIT

# Chess TCN Python

## Overview
**Chess TCN Python** is a Python package that provides functionality to encode and decode TCN, a move format used by **Chess.com**. 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_tcn, tcn_to_pgn, pgn_to_tcn

# Example TCN string (e.g. from Chess.com live‐game API)
tcn_string = "mC0Kgv7Tbq5Qlt9IqHT7cM1TMFWOHs2MFwZRfm6Eeg"

# Decode TCN to a list of move dicts
moves = decode_tcn(tcn_string)
print("Decoded moves (dicts):", moves)

# Re-encode that move list back into a TCN string
reencoded_tcn = encode_tcn(moves)
print("Re-encoded TCN string:", reencoded_tcn)

# Convert the TCN string directly to a PGN move-text string
pgn_text = tcn_to_pgn(tcn_string)
print("PGN move-text:", pgn_text)

# Convert a PGN move-text string back into TCN
roundtrip_tcn = pgn_to_tcn(pgn_text)
print("TCN from PGN:", roundtrip_tcn)
```

## API Reference
For complete details on usage, check out the [documentation](https://chess-tcn.github.io/docs).

## 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.
```
suiyue 1.0.0
Suiyue: 文本加密解密工具，支持多种加密算法和自定义密钥。
License: MIT
Requires Python: >=3.4
Keywords: suiyue, encryption, decryption, cryptography

# suiyue-crypto
随曰(yuē)：开源文本加解密工具 - 随心、随意、随时、随地、随曰。

![随曰(yuē)示例图片](images/SuiYue_GUI.jpg "随曰(yuē)界面图")

# 随曰文本加解密工具

## 项目简介
"随曰文本加解密工具"是一款基于Python开发的安全加密工具。该工具采用AES和ChaCha20-Poly1305两种高强度加密算法，在保障数据传输安全性的同时，通过Poly1305认证机制确保数据完整性，为用户提供专业级的数据保护解决方案。

## 项目地址
[随曰 SuiYue](https://github.com/zb848/suiyue-crypto)  https://github.com/zb848/suiyue-crypto

**注意：** 由于网络原因，链接解析可能失败。如果无法访问，请检查链接的合法性，或稍后重试。

[**离线客户端**](https://github.com/zb848/suiyue-crypto/releases)

## 功能特点
- 支持 AES-CTR 和 ChaCha20-Poly1305 加密算法。
- 支持标准 Base64 和中文 Base64 编码。
- 提供加密和解密接口。
- 支持错误处理和默认密码。

## 文件说明
suiyue-crypto/                  # 随曰项目根目录

|--SuiYue.py                    # 随曰文本加解密代码，可以单独使用。

|--SuiYue_GUI.py                # 随曰GUI界面代码

|--README.md                    # 随曰说明

|--LICENSE                      # 随曰版权声明

|--images/                      # 随曰图片



## 密文示例 (全是水 ^_^ 辨识度应该很高。那个有我水多 O(∩_∩)O~ )
```
湋渄漋泽汈溿溿涷泳漙灡漑汁洉漛汮渔汽潇滍浡汤灡涬湚灡澻泳滍潸渄涃汽涷湚滍淳瀫湔濗汷汥汈灡瀹洁溢汷汤潸灡濗涔汦灡泳泑泄濗濔涃淋滵湋滍涔漋瀫汷汽漛濗濗瀹瀹涫溃淳濈灡漛瀹漑湂泑洧灡洉沽泑濈濐瀹湚涫潇洦潬沚沚
```

##  suiyue(随曰) python库已上传PyPI，可以直接使用，suiyue库使用说明

### 安装suiyue库
```
pip install suiyue
```

### 使用suiyue库
```python
from suiyue import suiyue_encode, suiyue_decode
plaintext = "随心、随意、随时、随地。"
password = "随曰"

ciphertext = suiyue_encode(plaintext, password)
print("加密结果:", ciphertext)

decrypted_text = suiyue_decode(ciphertext, password)
print("解密结果:", decrypted_text)
```

## 版权信息
© 2025 随波逐流 保留所有权利。

## 许可证
[随曰-私下研究专用许可](https://github.com/zb848/suiyue-crypto?tab=License-1-ov-file#)

## 随曰 - 心随性起、意随情生、时随运转、地随缘现、言随风散。