jeraconv (Japanese Era Name Converter) is a converter that converts Japanese eras to West calendar.
Project description
jeraconv
jeraconv (Japanese Era Name Converter) is a converter that converts Japanese eras to West calendar.
Installation
$ pip install jeraconv
Usage
from jeraconv import jeraconv
# Create J2W class instance
jc = jeraconv.J2W()
# ex.1 : General usage
print(jc.convert('文治6年'))
# result (int)1190
# ex.2 : Full-width numbers are also available
print(jc.convert('平成31年'))
# result (int)2019
# ex.3 : It is also possible to write "1年" as "元年"
print(jc.convert('令和元年'))
# result (int)2019
# ex.4 : Returns a ValueError if the era name does not exist
print(jc.convert('牌孫4年'))
# result ValueError
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
jeraconv-0.1.0-py3-none-any.whl
(11.4 kB
view hashes)