pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
176 stars 47 forks source link

Added LanguageAlpha2 and LanguageName types #153

Closed odelmarcelle closed 6 months ago

odelmarcelle commented 6 months ago

Hello,

I was a bit disappointed that #141 did not implement alpha-2 languages codes, so here's my take at the implementation. Unlike #141, I tried to follow as closely as possible the existing implementation in country.py.

I thought that naming the types following convention in country.py was also much clearer than the obscure segmentation of the ISO 639 standards. Hence, I created two new types: LanguageAlpha2 and LanguageName and I would suggest refactoring ISO639_3 and ISO639_5 into LanguageAlpha3.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (e186814) to head (b735056). Report is 13 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #153 +/- ## ========================================== Coverage 100.00% 100.00% ========================================== Files 11 13 +2 Lines 685 817 +132 Branches 169 209 +40 ========================================== + Hits 685 817 +132 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.