Logging tenhou paifu into excel or html file with some key information.
Project description
Tenhou Paifu Logger
Logging tenhou paifu into excel, csv or html file with some key information.
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.
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 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
- Download the project.
a. Via GitHub.
i. Clone the repository or download the latest release.
git clone https://github.com/Jim137/Tenhou-Paifu-Logger.gitii. Copy the paifu URL from tenhou.net to clipboard.
iii. Run
runlog-user.bat
orrunlog-user.sh
.b. Via pypi.
i. Open terminal and install with pip command.
pip install PaifuLoggerii. Copy the paifu URL from tenhou.net to clipboard. And run by
plog -l [language] -o [output directory] [paifu URLs]paifu plog -l [language] -o [output directory] [paifu URLs]
- 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. - 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.
from paifulogger import get_log_func, get_paifu, localized_str, log_paifu
url = "Your paifu URL"
local_lang = localized_str("en") # 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
- Support multiple URLs at once.
- Log paifu into excel, csv or html file with some key information. (-f, --format)
- Support logging to multiple formats at once. (e.g.: -f csv -f html; -a, --all-formats)
- Distinguish Sanma(3p) and Yonma(4p) and log into separate sheets.
- Skip duplicated paifu
- Remake the paifu with URL already logged (-r, --remake). It will be useful when we updated the logging information in future.
- Customized output directory (-o, --output)
- Support mjai format paifu output (--mjai). You have to run
git pull --recurse-submodules
first. - Localization support (-l, --language)
- English: en
- Traditional Chinese: zh_tw
- Simplified Chinese: zh
- Japanese (ChatGPT): ja
- 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
- Windows:
- Support logging from Tenhou client(*.mjlog). (-c, --from-client DIR_TO_MJLOG)
Note: Typically, the saved directory is{Documents}/My Tenhou/log/
on Windows. - Match replay for html format. By clicking the match you want to review, the match replay will pop up accordingly.
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
- 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 for more details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file paifulogger-0.4.2.tar.gz
.
File metadata
- Download URL: paifulogger-0.4.2.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a627551cab12ac49b8b02d090448ab53be90641665698867992635d194bc7d36 |
|
MD5 | dceb6e4e25ad581e5b89f22a3b1eeacf |
|
BLAKE2b-256 | 0644bc4bd2fad1aadb9ecd2cd62c2ae3a17eafb538c91e4ccd2cd88df14f1115 |
File details
Details for the file PaifuLogger-0.4.2-py3-none-any.whl
.
File metadata
- Download URL: PaifuLogger-0.4.2-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 963810845edd980c0b490cc890148b25737f37dc7b8a63b92b5833a4e82789ed |
|
MD5 | 17724f946c4120d2293c02600f6cb426 |
|
BLAKE2b-256 | 73dea7521ef15f76284796d20570d7d632a81c515397f0959eb5ebbee698c2b2 |