https://github.com/osoken/jittok
Swiss Army Knife-like toolbox for data processing
https://github.com/osoken/jittok
Last synced: 4 months ago
JSON representation
Swiss Army Knife-like toolbox for data processing
- Host: GitHub
- URL: https://github.com/osoken/jittok
- Owner: osoken
- License: mit
- Created: 2022-10-23T11:33:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-07T14:31:30.000Z (about 3 years ago)
- Last Synced: 2025-09-15T09:39:57.012Z (9 months ago)
- Language: Python
- Homepage:
- Size: 107 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jittok
`jittok` is a Swiss Army Knife-like toolbox for data processing.
## Installation
```
pip install jittok
```
## Features
### `jptext` - Japanese text related functions
#### text normalization
```
>>> from jittok import jptext
>>> jptext.normalization("ゼンカクカナ")
'ゼンカクカナ'
```
#### parsing Japanese numeric string
```
>>> from jittok import jptext
>>> jptext.to_numeric("一二,三四五億2百十万987")
1234502100987
```
### `jpdatetime` - Japanese datetime related functions
#### parsing Japanese "wareki" string
```
>>> from jittok import jpdatetime
>>> jpdatetime.strptime("令和元年10月3日", "%Y年%m月%d日")
datetime.datetime(2019, 10, 3, 0, 0)
>>> jpdatetime.strptime("昭和64年1月1日", "%Y年%m月%d日")
datetime.datetime(1989, 1, 1, 0, 0)
```
It parses `"明治"`, `"大正"`, `"昭和"`, `"平成"`, `"令和"` and does not support consistency check:
```
>>> from jittok import jpdatetime
>>> jpdatetime.strptime("大正90年10月3日", "%Y年%m月%d日")
datetime.datetime(2001, 10, 3, 0, 0)
```