Repository: joke2k/faker (python)

Issue:
Support Minguo calendar years
* Faker version: 17.0.0
* OS: macOS

Brief summary of the issue goes here.

[Minguo calendar years](https://en.wikipedia.org/wiki/Republic_of_China_calendar) are commonly and officially used in Taiwan. It's not a difficult conversion from Gregorian years, but it would be helpful and convenient to have a function to generate random years in the Minguo calendar, maybe under the `zh_TW` provider.

Pull request description:
Add zh_TW date_time provider
### What does this change

Adds zh_TW date_time provider, which provides month and day of week names in traditional Chinese. Also supports generating [Minguo calendar years](https://en.wikipedia.org/wiki/Republic_of_China_calendar), which is commonly and officially used in Taiwan.

### What was wrong

See #1801 

### How this fixes it

Provides a `minguo_year()` function under the `zh_TW` provider that works similarly to the `year()` function, except the generated Gregorian years are converted to the Minguo calendar.

Fixes #1801 


Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 26d4ff16..0bf2cafc 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 17.1.0
+current_version = 17.2.0
 files = VERSION faker/__init__.py docs/conf.py
 commit = True
 tag = True
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f36ac715..2dd1cb61 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 ## Changelog
 
+### [v17.2.0 - 2023-02-24](https://github.com/joke2k/faker/compare/v17.1.0...v17.2.0)
+
+* Add support for latvian `ssn` generation. Thanks @OskarsPakers.
+
 ### [v17.1.0 - 2023-02-24](https://github.com/joke2k/faker/compare/v17.0.0...v17.1.0)
 
 * Add argument validation to `pybool()`. Thanks @Kolyunya.
diff --git a/VERSION b/VERSION
index d9e58927..290a3f36 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-17.1.0
+17.2.0
diff --git a/docs/conf.py b/docs/conf.py
index 1296da2c..8d651846 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = "2014, Daniele Faraglia"
 # built documents.
 #
 # The short X.Y version.
-version = "17.1.0"
+version = "17.2.0"
 # The full version, including alpha/beta/rc tags.
-release = "17.1.0"
+release = "17.2.0"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/faker/__init__.py b/faker/__init__.py
index e119878d..17840657 100644
--- a/faker/__init__.py
+++ b/faker/__init__.py
@@ -2,6 +2,6 @@ from faker.factory import Factory
 from faker.generator import Generator
 from faker.proxy import Faker
 
-VERSION = "17.1.0"
+VERSION = "17.2.0"
 
 __all__ = ("Factory", "Generator", "Faker")
diff --git a/faker/providers/date_time/zh_TW/__init__.py b/faker/providers/date_time/zh_TW/__init__.py
new file mode 100644
index 00000000..9b53b6c9
--- /dev/null
+++ b/faker/providers/date_time/zh_TW/__init__.py
@@ -0,0 +1,39 @@
+from .. import Provider as DateTimeProvider
+
+
+class Provider(DateTimeProvider):
+    MONTH_NAMES = {
+        "01": "一月",
+        "02": "二月",
+        "03": "三月",
+        "04": "四月",
+        "05": "五月",
+        "06": "六月",
+        "07": "七月",
+        "08": "八月",
+        "09": "九月",
+        "10": "十月",
+        "11": "十一月",
+        "12": "十二月",
+    }
+    DAY_NAMES = {
+        "0": "星期日",
+        "1": "星期一",
+        "2": "星期二",
+        "3": "星期三",
+        "4": "星期四",
+        "5": "星期五",
+        "6": "星期六",
+    }
+
+    def day_of_week(self) -> str:
+        day = self.date("%w")
+        return self.DAY_NAMES[day]
+
+    def month_name(self) -> str:
+        month = self.month()
+        return self.MONTH_NAMES[month]
+
+    def minguo_year(self) -> str:
+        year = self.year()
+        return str(int(year) - 1911)


Test patch:
diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py
index 89e1b5e3..50389be9 100644
--- a/tests/providers/test_date_time.py
+++ b/tests/providers/test_date_time.py
@@ -40,6 +40,7 @@ from faker.providers.date_time.sl_SI import Provider as SlSiProvider
 from faker.providers.date_time.ta_IN import Provider as TaInProvider
 from faker.providers.date_time.tr_TR import Provider as TrTrProvider
 from faker.providers.date_time.zh_CN import Provider as ZhCnProvider
+from faker.providers.date_time.zh_TW import Provider as ZhTwProvider
 
 
 def is64bit():
@@ -1192,8 +1193,34 @@ class TestZhCn(unittest.TestCase):
         assert day in ZhCnProvider.DAY_NAMES.values()
 
     def test_month(self):
-        day = self.fake.month_name()
-        assert day in ZhCnProvider.MONTH_NAMES.values()
+        month = self.fake.month_name()
+        assert month in ZhCnProvider.MONTH_NAMES.values()
+
+
+class TestZhTw(unittest.TestCase):
+    def setUp(self):
+        self.fake = Faker("zh-TW")
+        Faker.seed(0)
+
+    def test_day(self):
+        day = self.fake.day_of_week()
+        assert day in ZhTwProvider.DAY_NAMES.values()
+
+    def test_month(self):
+        month = self.fake.month_name()
+        assert month in ZhTwProvider.MONTH_NAMES.values()
+
+    def test_year(self):
+        year = self.fake.year()
+        assert isinstance(year, str)
+        assert year.isdigit()
+        assert len(year) >= 4
+
+    def test_minguo_year(self):
+        year = self.fake.minguo_year()
+        assert isinstance(year, str)
+        assert year.isdigit()
+        assert 1 <= len(year) <= 3
 
 
 class TestNoNo(unittest.TestCase):