Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
598369c
implements French Southern Territories holidays
LuccaAug Apr 7, 2025
d1a499d
implements French Southern Territories tests
LuccaAug Apr 7, 2025
c533df7
setup French Southern Territories
LuccaAug Apr 7, 2025
6bff1ad
Fixes typo on country code
LuccaAug Apr 7, 2025
3bba492
Fixes typo and pre-commit
LuccaAug Apr 7, 2025
20b5418
Fixes locale files
LuccaAug Apr 7, 2025
13d503f
Removes unused test
LuccaAug Apr 7, 2025
19cd6b0
Fixes wrong names
LuccaAug Apr 7, 2025
cff7986
Update tests/countries/test_french_southern_territories.py
LuccaAug Apr 7, 2025
5c14820
Improves quality code with Copilot recommendation
LuccaAug Apr 7, 2025
3d21ad7
Merge remote-tracking branch 'origin/french-southern-territories' int…
LuccaAug Apr 7, 2025
5dbff5f
Merge remote-tracking branch 'origin/dev' into french-southern-territ…
LuccaAug Apr 7, 2025
f1b4c0c
Merge branch 'dev' into french-southern-territories
LuccaAug Apr 7, 2025
9cfbb64
Updates TF main code to subdivision structure
LuccaAug Apr 7, 2025
b71ae77
Adds uk locale to match with super class France
LuccaAug Apr 8, 2025
fe24a59
Updates subdivision alias structure to allow empty value
LuccaAug Apr 8, 2025
6f926e1
Fixes tests to new subdivision pattern
LuccaAug Apr 8, 2025
2b1663f
Merge branch 'dev' into french-southern-territories
LuccaAug Apr 8, 2025
53ed898
Fixes comment on uk locale
LuccaAug Apr 8, 2025
8b26d01
Fixes HolidaysTF setup with languages
LuccaAug Apr 8, 2025
bc679d2
Registries HolidaysTF
LuccaAug Apr 8, 2025
4f78230
Removes unnecessary code
LuccaAug Apr 8, 2025
ee04186
Fixes HolidaysTF setup to match with HolidaysGU (Guam)
LuccaAug Apr 8, 2025
5ded1ba
Apply suggestions from code review
LuccaAug Apr 8, 2025
e6a6788
Updates project version on po files
LuccaAug Apr 8, 2025
f88ac5e
Updates po files to empty ones
LuccaAug Apr 8, 2025
dc65839
Removes redundant tests
LuccaAug Apr 8, 2025
8d14e65
Merge branch 'dev' into french-southern-territories
LuccaAug Apr 17, 2025
45ac5b9
Improves docstring
LuccaAug Apr 17, 2025
133085e
Update doctring
LuccaAug Apr 17, 2025
4a8d956
Update code
arkid15r Apr 18, 2025
5877deb
Merge branch 'dev' into pr/LuccaAug/2442
arkid15r Apr 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Kelsey Karin Hawley
Koert van der Veer
Koki Nomura
Kriti Birda
Lucca Augusto
Maina Kamau
Malthe Borch
Marek Šuppa
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ and detailed information.

## Available Countries

We currently support 168 country codes. The standard way to refer to a country is by using its [ISO
We currently support 169 country codes. The standard way to refer to a country is by using its [ISO
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
for domain names, and for a subdivision its [ISO 3166-2
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
Expand Down Expand Up @@ -526,6 +526,13 @@ any) in brackets, available languages and additional holiday categories. All cou
<td></td>
</tr>
<tr>
<td>French Southern Territories</td>
<td>TF</td>
<td></td>
<td>en_US, <strong>fr</strong>, uk</td>
<td></td>
</tr>
<tr>
<td>Gabon</td>
<td>GA</td>
<td></td>
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
from .fiji import Fiji, FJ, FJI
from .finland import Finland, FI, FIN
from .france import France, FR, FRA
from .french_southern_territories import FrenchSouthernTerritories, TF, ATF, HolidaysTF
from .gabon import Gabon, GA, GAB
from .georgia import Georgia, GE, GEO
from .germany import Germany, DE, DEU
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/france.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class France(HolidayBase, ChristianHolidays, InternationalHolidays):
country = "FR"
default_language = "fr"
supported_languages = ("en_US", "fr", "uk")
subdivisions = (
subdivisions: tuple[str, ...] = (
"BL", # Saint-Barthélemy.
"GES", # Alsace, Champagne-Ardenne, Lorraine(Moselle).
"GP", # Guadeloupe.
Expand Down
53 changes: 53 additions & 0 deletions holidays/countries/french_southern_territories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from holidays.countries.france import France


class HolidaysTF(France):
"""French Southern Territories holidays.

Alias of a French subdivision that is also officially assigned
its own country code in ISO 31661.

!!! note "Note"
Since most islands doesn't have a permanent population,
the holidays are just the public ones from France.

References:
* <https://www.iso.org/obp/ui#iso:code:3166:TF>
* <https://en.wikipedia.org/wiki/French_Southern_and_Antarctic_Lands>
* <https://en.wikipedia.org/wiki/Public_holidays_in_France>
"""
Comment thread
KJhellico marked this conversation as resolved.

country = "TF"
parent_entity = France
subdivisions = () # Override France subdivisions.
subdivisions_aliases = {} # Override France subdivisions aliases.
Comment thread
LuccaAug marked this conversation as resolved.
# This overseas territory was separated in 1955.
start_year = 1956

Comment thread
LuccaAug marked this conversation as resolved.
def _populate_public_holidays(self) -> None:
self.subdiv = "TF"
super()._populate_public_holidays()


class FrenchSouthernTerritories(HolidaysTF):
pass


class TF(HolidaysTF):
pass


class ATF(HolidaysTF):
pass
28 changes: 28 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/TF.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# French Southern Territories holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.71\n"
"POT-Creation-Date: 2023-03-23 14:44+0200\n"
"PO-Revision-Date: 2023-03-23 14:47+0200\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"
28 changes: 28 additions & 0 deletions holidays/locale/fr/LC_MESSAGES/TF.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# French Southern Territories holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.71\n"
"POT-Creation-Date: 2023-03-23 14:44+0200\n"
"PO-Revision-Date: 2023-03-23 14:45+0200\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"
28 changes: 28 additions & 0 deletions holidays/locale/uk/LC_MESSAGES/TF.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# French Southern Territories holidays uk localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.71\n"
"POT-Creation-Date: 2023-03-23 14:44+0200\n"
"PO-Revision-Date: 2024-01-23 20:54+0200\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.4\n"
1 change: 1 addition & 0 deletions holidays/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"fiji": ("Fiji", "FJ", "FJI"),
"finland": ("Finland", "FI", "FIN"),
"france": ("France", "FR", "FRA"),
"french_southern_territories": ("FrenchSouthernTerritories", "TF", "ATF", "HolidaysTF"),
"gabon": ("Gabon", "GA", "GAB"),
"georgia": ("Georgia", "GE", "GEO"),
"germany": ("Germany", "DE", "DEU"),
Expand Down
46 changes: 46 additions & 0 deletions tests/countries/test_french_southern_territories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from unittest import TestCase

from holidays.countries.french_southern_territories import (
HolidaysTF,
FrenchSouthernTerritories,
TF,
ATF,
)
from tests.common import CommonCountryTests


class TestTF(CommonCountryTests, TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass(HolidaysTF)

def test_country_aliases(self):
self.assertAliases(HolidaysTF, FrenchSouthernTerritories, TF, ATF)

def test_2022(self):
self.assertHolidayDates(
HolidaysTF(years=2022),
"2022-01-01",
"2022-04-18",
"2022-05-01",
"2022-05-08",
"2022-05-26",
"2022-06-06",
"2022-07-14",
"2022-08-15",
"2022-11-01",
"2022-11-11",
"2022-12-25",
)