PaifuLogger


NamePaifuLogger JSON
Version 0.4.0.2 PyPI version JSON
download
home_pageNone
SummaryLogging tenhou paifu into excel or html file with some key information.
upload_time2024-04-20 12:41:53
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2023-2024 Jim137 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.
keywords mahjong review logger paifu tenhou haifu paipu riichi-mahjong
VCS
bugtrack_url
requirements openpyxl lxml tables pandas platformdirs
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tenhou Paifu Logger

[![build](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/publish-to-test-pypi.yml/badge.svg)](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/publish-to-test-pypi.yml)
[![lint](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/test.yml/badge.svg)](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/test.yml)
[<img src="https://img.shields.io/pypi/v/PaifuLogger?style=plastic"> <img src="https://img.shields.io/pypi/wheel/PaifuLogger?style=plastic">](https://pypi.org/project/PaifuLogger/)
[![Downloads](https://static.pepy.tech/badge/Paifulogger)](https://pepy.tech/project/Paifulogger)
[<img src="https://img.shields.io/github/stars/Jim137/Tenhou-Paifu-Logger?style=plastic">](https://github.com/Jim137/Tenhou-Paifu-Logger/)
[<img src="https://img.shields.io/github/downloads/Jim137/Tenhou-Paifu-Logger/total?style=plastic">](https://github.com/Jim137/Tenhou-Paifu-Logger/releases)
![support-version](https://img.shields.io/pypi/pyversions/PaifuLogger?style=plastic)
![platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgray?style=plastic)
![License](https://img.shields.io/github/license/Jim137/Tenhou-Paifu-Logger?style=plastic)

Logging tenhou paifu into excel, csv or html file with some key information.

![Generated by DALL·E](https://github.com/Jim137/Tenhou-Paifu-Logger/raw/master/READMEs/image/paifulogger.png)

If you like this project, please leave a star. It will be a great encouragement for me. And if you have any suggestions, please feel free to create an issue.

[Downloads](https://github.com/Jim137/Tenhou-Paifu-Logger/releases/latest) | [中文說明](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/READMEs/README_zh.md) | [日本語](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/READMEs/README_ja.md)

## Requirements

* Python 3.10 or later

Since CLI-0.3.8, the project is only compatible with Python 3.10 or later.
For Python 3.9 or earlier users, please use [CLI-0.3.7.1](https://github.com/Jim137/Tenhou-Paifu-Logger/tree/CLI-0.3.7.1) which is the last version that supports Python 3.9 or earlier.
Or download from pypi with the following command.

```
pip install PaifuLogger==0.3.7.1
```

## Usage

### Command Line / Script

1. Download the project.

> a. Via GitHub.
>
>> i. Clone the repository or download the [latest release](https://github.com/Jim137/Tenhou-Paifu-Logger/releases/latest).
>>
>> ```
>> git clone https://github.com/Jim137/Tenhou-Paifu-Logger.git
>> ```
>>
>> ii. Copy the paifu URL from tenhou.net to clipboard.
>>
>> iii. Run `runlog-user.bat` or `runlog-user.sh`.
>
> b. Via pypi.
>
>> i. Open terminal and install with pip command.
>>
>> ```
>> pip install PaifuLogger
>> ```
>>
>> ii. Copy the paifu URL from tenhou.net to clipboard. And run by
>>
>> ```shell
>> plog -l [language] -o [output directory] [paifu URLs]
>> ```
>> ```shell
>> paifulogger plog -l [language] -o [output directory] [paifu URLs]
>> ```

2. Once `Please enter the URL of match:` appears, paste the URL and press Enter.\
Note: In the latest version, you can input multiple URLs at once, separated by whatever you like. If you are lazy, you can just paste w/o anything.
3. After `Match of {paifu name} has been recorded` appears, the paifu has been successfully logged.

### Inline

You can manually log the paifu by the following code.

```python
from paifulogger import get_paifu, localized_str, log_paifu, main_path
from paifulogger.log import _get_log_func

url = "Your paifu URL"
local_lang = localized_str("en", main_path) # Localization
log_formats = _get_log_func(["csv", "html"]) # Log into csv and html file.
output = "./" # Output directory
mjai = False # Whether have output in mjai format

# Log the paifu into the file.
log_paifu(
    url,
    log_formats = log_formats,
    local_lang = local_lang,
    output = output,
    mjai = mjai
)
# Get Paifu object, which contains all the information of the paifu.
paifu = get_paifu(url, local_lang)
```

## Features
* [x] Support multiple URLs at once.
* [x] Log paifu into excel, csv or html file with some key information. (-f, --format)
* [x] Support logging to multiple formats at once. (e.g.: -f csv -f html; -a, --all-formats)
* [x] Distinguish Sanma(3p) and Yonma(4p) and log into separate sheets.
* [x] Skip duplicated paifu
* [x] Remake the paifu with URL already logged (-r, --remake). It will be useful when we updated the logging information in future.
* [x] Customized output directory (-o, --output)
* [x] Support mjai format paifu output (--mjai). *You have to run `git pull --recurse-submodules` first*.
* [x] Localization support (-l, --language)
  * [x] English: en
  * [x] Traditional Chinese: zh_tw
  * [x] Simplified Chinese: zh
  * [x] Japanese (ChatGPT): ja
* [x] Support config file. Placing `config.json` in the same directory as the execution enables local configuration. For global configuration, place it in the following directories:
  * Windows: `%localappdata%\Jim137\paifulogger\config.json`
  * macOS: `/Users/{UserName}/Library/Application Support/paifulogger/config.json`
  * Linux: `~/.local/share/paifulogger/config.json`

## Information logged

* Game time
* Placing
* URL (for future use)
* Rate before the game
* The change of Rate: Note it assumes that the player has played more than 400 games.
* Number of wins
* Number of deal-ins

## Future features

* [ ] Add match replay for every round in html file
* [ ] Agari analysis
* [ ] Support Majsoul paifu
* [ ] GUI

## Contribute
We welcome all kinds of contributions, including but not limited to bug reports, pull requests, feature requests, documentation improvements, localizations...etc.

See [CONTRIBUTING.md](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/CONTRIBUTING.md) for more details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "PaifuLogger",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "mahjong, review, logger, paifu, tenhou, haifu, paipu, riichi-mahjong",
    "author": null,
    "author_email": "Jim137 <jim@mail.jim137.eu.org>",
    "download_url": "https://files.pythonhosted.org/packages/46/33/f20fce3da8cae57ab1102fb85dfe5ab328d5a8bcd7774fa4a65d9f9f9437/paifulogger-0.4.0.2.tar.gz",
    "platform": null,
    "description": "# Tenhou Paifu Logger\n\n[![build](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/publish-to-test-pypi.yml/badge.svg)](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/publish-to-test-pypi.yml)\n[![lint](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/test.yml/badge.svg)](https://github.com/Jim137/Tenhou-Paifu-Logger/actions/workflows/test.yml)\n[<img src=\"https://img.shields.io/pypi/v/PaifuLogger?style=plastic\"> <img src=\"https://img.shields.io/pypi/wheel/PaifuLogger?style=plastic\">](https://pypi.org/project/PaifuLogger/)\n[![Downloads](https://static.pepy.tech/badge/Paifulogger)](https://pepy.tech/project/Paifulogger)\n[<img src=\"https://img.shields.io/github/stars/Jim137/Tenhou-Paifu-Logger?style=plastic\">](https://github.com/Jim137/Tenhou-Paifu-Logger/)\n[<img src=\"https://img.shields.io/github/downloads/Jim137/Tenhou-Paifu-Logger/total?style=plastic\">](https://github.com/Jim137/Tenhou-Paifu-Logger/releases)\n![support-version](https://img.shields.io/pypi/pyversions/PaifuLogger?style=plastic)\n![platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgray?style=plastic)\n![License](https://img.shields.io/github/license/Jim137/Tenhou-Paifu-Logger?style=plastic)\n\nLogging tenhou paifu into excel, csv or html file with some key information.\n\n![Generated by DALL\u00b7E](https://github.com/Jim137/Tenhou-Paifu-Logger/raw/master/READMEs/image/paifulogger.png)\n\nIf you like this project, please leave a star. It will be a great encouragement for me. And if you have any suggestions, please feel free to create an issue.\n\n[Downloads](https://github.com/Jim137/Tenhou-Paifu-Logger/releases/latest) | [\u4e2d\u6587\u8aaa\u660e](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/READMEs/README_zh.md) | [\u65e5\u672c\u8a9e](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/READMEs/README_ja.md)\n\n## Requirements\n\n* Python 3.10 or later\n\nSince CLI-0.3.8, the project is only compatible with Python 3.10 or later.\nFor Python 3.9 or earlier users, please use [CLI-0.3.7.1](https://github.com/Jim137/Tenhou-Paifu-Logger/tree/CLI-0.3.7.1) which is the last version that supports Python 3.9 or earlier.\nOr download from pypi with the following command.\n\n```\npip install PaifuLogger==0.3.7.1\n```\n\n## Usage\n\n### Command Line / Script\n\n1. Download the project.\n\n> a. Via GitHub.\n>\n>> i. Clone the repository or download the [latest release](https://github.com/Jim137/Tenhou-Paifu-Logger/releases/latest).\n>>\n>> ```\n>> git clone https://github.com/Jim137/Tenhou-Paifu-Logger.git\n>> ```\n>>\n>> ii. Copy the paifu URL from tenhou.net to clipboard.\n>>\n>> iii. Run `runlog-user.bat` or `runlog-user.sh`.\n>\n> b. Via pypi.\n>\n>> i. Open terminal and install with pip command.\n>>\n>> ```\n>> pip install PaifuLogger\n>> ```\n>>\n>> ii. Copy the paifu URL from tenhou.net to clipboard. And run by\n>>\n>> ```shell\n>> plog -l [language] -o [output directory] [paifu URLs]\n>> ```\n>> ```shell\n>> paifulogger plog -l [language] -o [output directory] [paifu URLs]\n>> ```\n\n2. Once `Please enter the URL of match:` appears, paste the URL and press Enter.\\\nNote: In the latest version, you can input multiple URLs at once, separated by whatever you like. If you are lazy, you can just paste w/o anything.\n3. After `Match of {paifu name} has been recorded` appears, the paifu has been successfully logged.\n\n### Inline\n\nYou can manually log the paifu by the following code.\n\n```python\nfrom paifulogger import get_paifu, localized_str, log_paifu, main_path\nfrom paifulogger.log import _get_log_func\n\nurl = \"Your paifu URL\"\nlocal_lang = localized_str(\"en\", main_path) # Localization\nlog_formats = _get_log_func([\"csv\", \"html\"]) # Log into csv and html file.\noutput = \"./\" # Output directory\nmjai = False # Whether have output in mjai format\n\n# Log the paifu into the file.\nlog_paifu(\n    url,\n    log_formats = log_formats,\n    local_lang = local_lang,\n    output = output,\n    mjai = mjai\n)\n# Get Paifu object, which contains all the information of the paifu.\npaifu = get_paifu(url, local_lang)\n```\n\n## Features\n* [x] Support multiple URLs at once.\n* [x] Log paifu into excel, csv or html file with some key information. (-f, --format)\n* [x] Support logging to multiple formats at once. (e.g.: -f csv -f html; -a, --all-formats)\n* [x] Distinguish Sanma(3p) and Yonma(4p) and log into separate sheets.\n* [x] Skip duplicated paifu\n* [x] Remake the paifu with URL already logged (-r, --remake). It will be useful when we updated the logging information in future.\n* [x] Customized output directory (-o, --output)\n* [x] Support mjai format paifu output (--mjai). *You have to run `git pull --recurse-submodules` first*.\n* [x] Localization support (-l, --language)\n  * [x] English: en\n  * [x] Traditional Chinese: zh_tw\n  * [x] Simplified Chinese: zh\n  * [x] Japanese (ChatGPT): ja\n* [x] Support config file. Placing `config.json` in the same directory as the execution enables local configuration. For global configuration, place it in the following directories:\n  * Windows: `%localappdata%\\Jim137\\paifulogger\\config.json`\n  * macOS: `/Users/{UserName}/Library/Application Support/paifulogger/config.json`\n  * Linux: `~/.local/share/paifulogger/config.json`\n\n## Information logged\n\n* Game time\n* Placing\n* URL (for future use)\n* Rate before the game\n* The change of Rate: Note it assumes that the player has played more than 400 games.\n* Number of wins\n* Number of deal-ins\n\n## Future features\n\n* [ ] Add match replay for every round in html file\n* [ ] Agari analysis\n* [ ] Support Majsoul paifu\n* [ ] GUI\n\n## Contribute\nWe welcome all kinds of contributions, including but not limited to bug reports, pull requests, feature requests, documentation improvements, localizations...etc.\n\nSee [CONTRIBUTING.md](https://github.com/Jim137/Tenhou-Paifu-Logger/blob/master/CONTRIBUTING.md) for more details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023-2024 Jim137  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.",
    "summary": "Logging tenhou paifu into excel or html file with some key information.",
    "version": "0.4.0.2",
    "project_urls": {
        "Homepage": "https://github.com/Jim137/Tenhou-Paifu-Logger"
    },
    "split_keywords": [
        "mahjong",
        " review",
        " logger",
        " paifu",
        " tenhou",
        " haifu",
        " paipu",
        " riichi-mahjong"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae80340c599c04a5207486537c5671b089a4a0bc48e2fd13753034870282a5b3",
                "md5": "e389040737190a332d2ff0a8444ed39c",
                "sha256": "86e3b5c9f1e73faa8cef521a007d3d08247b6146d1c09148116a18f404973e24"
            },
            "downloads": -1,
            "filename": "PaifuLogger-0.4.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e389040737190a332d2ff0a8444ed39c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 30581,
            "upload_time": "2024-04-20T12:41:51",
            "upload_time_iso_8601": "2024-04-20T12:41:51.678143Z",
            "url": "https://files.pythonhosted.org/packages/ae/80/340c599c04a5207486537c5671b089a4a0bc48e2fd13753034870282a5b3/PaifuLogger-0.4.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4633f20fce3da8cae57ab1102fb85dfe5ab328d5a8bcd7774fa4a65d9f9f9437",
                "md5": "bacaad5235646267435e596b07c0c5d1",
                "sha256": "c5bc41902c58cf9b1e3efde3b87528b612c45630ec1aa6bf71dbca807df6d496"
            },
            "downloads": -1,
            "filename": "paifulogger-0.4.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "bacaad5235646267435e596b07c0c5d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22644,
            "upload_time": "2024-04-20T12:41:53",
            "upload_time_iso_8601": "2024-04-20T12:41:53.206178Z",
            "url": "https://files.pythonhosted.org/packages/46/33/f20fce3da8cae57ab1102fb85dfe5ab328d5a8bcd7774fa4a65d9f9f9437/paifulogger-0.4.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-20 12:41:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jim137",
    "github_project": "Tenhou-Paifu-Logger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "openpyxl",
            "specs": []
        },
        {
            "name": "lxml",
            "specs": []
        },
        {
            "name": "tables",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "platformdirs",
            "specs": []
        }
    ],
    "lcname": "paifulogger"
}
        
Elapsed time: 0.24579s