fx-spot-dates 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fx_spot_dates/__init__.py +121 -0
- fx_spot_dates/__main__.py +5 -0
- fx_spot_dates/data/coverage_2026_2028.csv +19 -0
- fx_spot_dates/data/settlement_holidays_2026_2028.csv +163 -0
- fx_spot_dates-0.1.0.dist-info/METADATA +94 -0
- fx_spot_dates-0.1.0.dist-info/RECORD +10 -0
- fx_spot_dates-0.1.0.dist-info/WHEEL +5 -0
- fx_spot_dates-0.1.0.dist-info/entry_points.txt +2 -0
- fx_spot_dates-0.1.0.dist-info/licenses/LICENSE +24 -0
- fx_spot_dates-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""FX settlement business days and T+2 spot value dates for USD, EUR, GBP, JPY, AUD, NZD (2026-2028).
|
|
2
|
+
|
|
3
|
+
>>> import fx_spot_dates as fx
|
|
4
|
+
>>> fx.spot_date("USDJPY", "2026-12-29")
|
|
5
|
+
datetime.date(2027, 1, 4)
|
|
6
|
+
>>> fx.is_business_day("EUR", "2026-12-24") # TARGET2 is open on Christmas Eve
|
|
7
|
+
True
|
|
8
|
+
|
|
9
|
+
Calendars: USD Federal Reserve (Fedwire), EUR TARGET2, GBP England and Wales bank holidays, JPY Japan bank
|
|
10
|
+
holidays, AUD New South Wales bank holidays (2028 only), NZD New Zealand incl. Wellington Anniversary.
|
|
11
|
+
Dates come from the Python `holidays` package and were kept only where QuantLib agrees on every weekday.
|
|
12
|
+
Outside the covered currency-years every function raises NotCovered (it never guesses).
|
|
13
|
+
|
|
14
|
+
Spot convention (T+2): for pairs with USD, day 1 is the next business day of the non-USD currency and day 2 the
|
|
15
|
+
next day that is a business day in both; for crosses, two business days of both currencies, then forward to
|
|
16
|
+
the first day that is also a USD business day. Some banks use other rules: confirm with your counterparty.
|
|
17
|
+
Not financial advice. Full 2000-2050 data and 15-pair tables: https://github.com/plainfoldhq/fx-settlement-holidays
|
|
18
|
+
"""
|
|
19
|
+
import csv
|
|
20
|
+
import os
|
|
21
|
+
from datetime import date, timedelta
|
|
22
|
+
|
|
23
|
+
__version__ = "0.1.0"
|
|
24
|
+
__all__ = ["CURRENCIES", "NotCovered", "is_business_day", "add_business_days", "spot_date", "holidays"]
|
|
25
|
+
|
|
26
|
+
_DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
|
|
27
|
+
CURRENCIES = ("USD", "EUR", "GBP", "JPY", "AUD", "NZD")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class NotCovered(ValueError):
|
|
31
|
+
"""The currency-year is not in the bundled data."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _load():
|
|
35
|
+
covered, closed = set(), {}
|
|
36
|
+
with open(os.path.join(_DATA, "coverage_2026_2028.csv"), newline="", encoding="utf-8") as f:
|
|
37
|
+
for r in csv.DictReader(f):
|
|
38
|
+
if r["status"] == "covered":
|
|
39
|
+
covered.add((r["currency"], int(r["year"])))
|
|
40
|
+
with open(os.path.join(_DATA, "settlement_holidays_2026_2028.csv"), newline="", encoding="utf-8") as f:
|
|
41
|
+
for r in csv.DictReader(f):
|
|
42
|
+
closed[(r["currency"], date.fromisoformat(r["date"]))] = r["holiday"]
|
|
43
|
+
return covered, closed
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
_COVERED, _CLOSED = _load()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _d(x):
|
|
50
|
+
return x if isinstance(x, date) else date.fromisoformat(str(x))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def is_business_day(currency, d):
|
|
54
|
+
"""True if `d` is a settlement business day for `currency`."""
|
|
55
|
+
c, d = currency.upper(), _d(d)
|
|
56
|
+
if c not in CURRENCIES:
|
|
57
|
+
raise KeyError(f"unknown currency {currency}; available: {', '.join(CURRENCIES)}")
|
|
58
|
+
if (c, d.year) not in _COVERED:
|
|
59
|
+
raise NotCovered(f"{c} {d.year} is not covered (bundled: 2026-2028; AUD 2028 only)")
|
|
60
|
+
return d.weekday() < 5 and (c, d) not in _CLOSED
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def holidays(currency, year):
|
|
64
|
+
"""[(date, name)] weekday settlement holidays of `currency` in `year`."""
|
|
65
|
+
c = currency.upper()
|
|
66
|
+
is_business_day(c, date(year, 1, 1)) # raises for unknown/uncovered
|
|
67
|
+
return sorted((d, n) for (cc, d), n in _CLOSED.items() if cc == c and d.year == year)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _joint(ccys, d):
|
|
71
|
+
return all([is_business_day(c, d) for c in ccys])
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def add_business_days(currencies, d, n):
|
|
75
|
+
"""n >= 0 days that are business days in every currency of `currencies` (n = 0: d or the next such day)."""
|
|
76
|
+
if isinstance(currencies, str):
|
|
77
|
+
currencies = [currencies]
|
|
78
|
+
d = _d(d)
|
|
79
|
+
if n < 0:
|
|
80
|
+
raise ValueError("n must be >= 0")
|
|
81
|
+
if n == 0:
|
|
82
|
+
while not _joint(currencies, d):
|
|
83
|
+
d += timedelta(days=1)
|
|
84
|
+
return d
|
|
85
|
+
for _ in range(n):
|
|
86
|
+
d += timedelta(days=1)
|
|
87
|
+
while not _joint(currencies, d):
|
|
88
|
+
d += timedelta(days=1)
|
|
89
|
+
return d
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def spot_date(pair, trade_date):
|
|
93
|
+
"""T+2 spot value date for a 6-letter pair such as 'EURUSD' and a weekday trade date."""
|
|
94
|
+
pair = pair.upper().replace("/", "")
|
|
95
|
+
a, b = pair[:3], pair[3:]
|
|
96
|
+
t = _d(trade_date)
|
|
97
|
+
if len(pair) != 6 or a == b:
|
|
98
|
+
raise ValueError(f"not a currency pair: {pair}")
|
|
99
|
+
if t.weekday() >= 5:
|
|
100
|
+
raise ValueError(f"trade date {t} is a weekend")
|
|
101
|
+
if "USD" in (a, b):
|
|
102
|
+
other = b if a == "USD" else a
|
|
103
|
+
return add_business_days([a, b], add_business_days([other], t, 1), 1)
|
|
104
|
+
return add_business_days([a, b, "USD"], add_business_days([a, b], t, 2), 0)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def cli(argv=None):
|
|
108
|
+
import sys
|
|
109
|
+
argv = sys.argv[1:] if argv is None else argv
|
|
110
|
+
if len(argv) != 2:
|
|
111
|
+
print("usage: fx-spot-dates EURUSD 2026-12-24 | fx-spot-dates USD 2026-07-03")
|
|
112
|
+
return 2
|
|
113
|
+
try:
|
|
114
|
+
if len(argv[0].replace("/", "")) == 6:
|
|
115
|
+
print(spot_date(argv[0], argv[1]))
|
|
116
|
+
else:
|
|
117
|
+
print("business day" if is_business_day(argv[0], argv[1]) else "holiday/weekend")
|
|
118
|
+
except (NotCovered, KeyError, ValueError) as e:
|
|
119
|
+
print(f"error: {e}", file=sys.stderr)
|
|
120
|
+
return 1
|
|
121
|
+
return 0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
currency,year,status,reason
|
|
2
|
+
USD,2026,covered,
|
|
3
|
+
USD,2027,covered,
|
|
4
|
+
USD,2028,covered,
|
|
5
|
+
EUR,2026,covered,
|
|
6
|
+
EUR,2027,covered,
|
|
7
|
+
EUR,2028,covered,
|
|
8
|
+
GBP,2026,covered,
|
|
9
|
+
GBP,2027,covered,
|
|
10
|
+
GBP,2028,covered,
|
|
11
|
+
JPY,2026,covered,
|
|
12
|
+
JPY,2027,covered,
|
|
13
|
+
JPY,2028,covered,
|
|
14
|
+
AUD,2026,not_covered,sources disagree on 1 weekday(s): 2026-04-27
|
|
15
|
+
AUD,2027,not_covered,sources disagree on 1 weekday(s): 2027-04-26
|
|
16
|
+
AUD,2028,covered,
|
|
17
|
+
NZD,2026,covered,
|
|
18
|
+
NZD,2027,covered,
|
|
19
|
+
NZD,2028,covered,
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
date,weekday,currency,calendar,holiday
|
|
2
|
+
2026-01-01,Thu,USD,Federal Reserve (Fedwire) holidays,New Year's Day
|
|
3
|
+
2026-01-01,Thu,EUR,TARGET2 / T2 closing days,New Year's Day
|
|
4
|
+
2026-01-01,Thu,GBP,"England and Wales bank holidays (CHAPS, Bacs)",New Year's Day
|
|
5
|
+
2026-01-01,Thu,JPY,Japan bank holidays,Bank Holiday; New Year's Day
|
|
6
|
+
2026-01-01,Thu,NZD,New Zealand holidays incl. Wellington Anniversary,New Year's Day
|
|
7
|
+
2026-01-02,Fri,JPY,Japan bank holidays,Bank Holiday
|
|
8
|
+
2026-01-02,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Day after New Year's Day
|
|
9
|
+
2026-01-12,Mon,JPY,Japan bank holidays,Coming of Age Day
|
|
10
|
+
2026-01-19,Mon,USD,Federal Reserve (Fedwire) holidays,"Birthday of Martin Luther King, Jr."
|
|
11
|
+
2026-01-19,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Wellington Anniversary Day
|
|
12
|
+
2026-02-06,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Waitangi Day
|
|
13
|
+
2026-02-11,Wed,JPY,Japan bank holidays,Foundation Day
|
|
14
|
+
2026-02-16,Mon,USD,Federal Reserve (Fedwire) holidays,Washington's Birthday
|
|
15
|
+
2026-02-23,Mon,JPY,Japan bank holidays,Emperor's Birthday
|
|
16
|
+
2026-03-20,Fri,JPY,Japan bank holidays,Vernal Equinox Day
|
|
17
|
+
2026-04-03,Fri,EUR,TARGET2 / T2 closing days,Good Friday
|
|
18
|
+
2026-04-03,Fri,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Good Friday
|
|
19
|
+
2026-04-03,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Good Friday
|
|
20
|
+
2026-04-06,Mon,EUR,TARGET2 / T2 closing days,Easter Monday
|
|
21
|
+
2026-04-06,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Easter Monday
|
|
22
|
+
2026-04-06,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Easter Monday
|
|
23
|
+
2026-04-27,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Anzac Day (observed)
|
|
24
|
+
2026-04-29,Wed,JPY,Japan bank holidays,Showa Day
|
|
25
|
+
2026-05-01,Fri,EUR,TARGET2 / T2 closing days,Labour Day
|
|
26
|
+
2026-05-04,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",May Day
|
|
27
|
+
2026-05-04,Mon,JPY,Japan bank holidays,Greenery Day
|
|
28
|
+
2026-05-05,Tue,JPY,Japan bank holidays,Children's Day
|
|
29
|
+
2026-05-06,Wed,JPY,Japan bank holidays,Substitute Holiday
|
|
30
|
+
2026-05-25,Mon,USD,Federal Reserve (Fedwire) holidays,Memorial Day
|
|
31
|
+
2026-05-25,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Spring Bank Holiday
|
|
32
|
+
2026-06-01,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,King's Birthday
|
|
33
|
+
2026-06-19,Fri,USD,Federal Reserve (Fedwire) holidays,Juneteenth National Independence Day
|
|
34
|
+
2026-07-10,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Matariki
|
|
35
|
+
2026-07-20,Mon,JPY,Japan bank holidays,Marine Day
|
|
36
|
+
2026-08-11,Tue,JPY,Japan bank holidays,Mountain Day
|
|
37
|
+
2026-08-31,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Late Summer Bank Holiday
|
|
38
|
+
2026-09-07,Mon,USD,Federal Reserve (Fedwire) holidays,Labor Day
|
|
39
|
+
2026-09-21,Mon,JPY,Japan bank holidays,Respect for the Aged Day
|
|
40
|
+
2026-09-22,Tue,JPY,Japan bank holidays,National Holiday
|
|
41
|
+
2026-09-23,Wed,JPY,Japan bank holidays,Autumnal Equinox Day
|
|
42
|
+
2026-10-12,Mon,USD,Federal Reserve (Fedwire) holidays,Columbus Day
|
|
43
|
+
2026-10-12,Mon,JPY,Japan bank holidays,Sports Day
|
|
44
|
+
2026-10-26,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Labour Day
|
|
45
|
+
2026-11-03,Tue,JPY,Japan bank holidays,Culture Day
|
|
46
|
+
2026-11-11,Wed,USD,Federal Reserve (Fedwire) holidays,Veterans Day
|
|
47
|
+
2026-11-23,Mon,JPY,Japan bank holidays,Labor Thanksgiving Day
|
|
48
|
+
2026-11-26,Thu,USD,Federal Reserve (Fedwire) holidays,Thanksgiving Day
|
|
49
|
+
2026-12-25,Fri,USD,Federal Reserve (Fedwire) holidays,Christmas Day
|
|
50
|
+
2026-12-25,Fri,EUR,TARGET2 / T2 closing days,Christmas Day
|
|
51
|
+
2026-12-25,Fri,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Christmas Day
|
|
52
|
+
2026-12-25,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Christmas Day
|
|
53
|
+
2026-12-28,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Boxing Day (observed)
|
|
54
|
+
2026-12-28,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Boxing Day (observed)
|
|
55
|
+
2026-12-31,Thu,JPY,Japan bank holidays,Bank Holiday
|
|
56
|
+
2027-01-01,Fri,USD,Federal Reserve (Fedwire) holidays,New Year's Day
|
|
57
|
+
2027-01-01,Fri,EUR,TARGET2 / T2 closing days,New Year's Day
|
|
58
|
+
2027-01-01,Fri,GBP,"England and Wales bank holidays (CHAPS, Bacs)",New Year's Day
|
|
59
|
+
2027-01-01,Fri,JPY,Japan bank holidays,Bank Holiday; New Year's Day
|
|
60
|
+
2027-01-01,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,New Year's Day
|
|
61
|
+
2027-01-04,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Day after New Year's Day (observed)
|
|
62
|
+
2027-01-11,Mon,JPY,Japan bank holidays,Coming of Age Day
|
|
63
|
+
2027-01-18,Mon,USD,Federal Reserve (Fedwire) holidays,"Birthday of Martin Luther King, Jr."
|
|
64
|
+
2027-01-25,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Wellington Anniversary Day
|
|
65
|
+
2027-02-08,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Waitangi Day (observed)
|
|
66
|
+
2027-02-11,Thu,JPY,Japan bank holidays,Foundation Day
|
|
67
|
+
2027-02-15,Mon,USD,Federal Reserve (Fedwire) holidays,Washington's Birthday
|
|
68
|
+
2027-02-23,Tue,JPY,Japan bank holidays,Emperor's Birthday
|
|
69
|
+
2027-03-22,Mon,JPY,Japan bank holidays,Substitute Holiday
|
|
70
|
+
2027-03-26,Fri,EUR,TARGET2 / T2 closing days,Good Friday
|
|
71
|
+
2027-03-26,Fri,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Good Friday
|
|
72
|
+
2027-03-26,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Good Friday
|
|
73
|
+
2027-03-29,Mon,EUR,TARGET2 / T2 closing days,Easter Monday
|
|
74
|
+
2027-03-29,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Easter Monday
|
|
75
|
+
2027-03-29,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Easter Monday
|
|
76
|
+
2027-04-26,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Anzac Day (observed)
|
|
77
|
+
2027-04-29,Thu,JPY,Japan bank holidays,Showa Day
|
|
78
|
+
2027-05-03,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",May Day
|
|
79
|
+
2027-05-03,Mon,JPY,Japan bank holidays,Constitution Day
|
|
80
|
+
2027-05-04,Tue,JPY,Japan bank holidays,Greenery Day
|
|
81
|
+
2027-05-05,Wed,JPY,Japan bank holidays,Children's Day
|
|
82
|
+
2027-05-31,Mon,USD,Federal Reserve (Fedwire) holidays,Memorial Day
|
|
83
|
+
2027-05-31,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Spring Bank Holiday
|
|
84
|
+
2027-06-07,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,King's Birthday
|
|
85
|
+
2027-06-25,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Matariki
|
|
86
|
+
2027-07-05,Mon,USD,Federal Reserve (Fedwire) holidays,Independence Day (observed)
|
|
87
|
+
2027-07-19,Mon,JPY,Japan bank holidays,Marine Day
|
|
88
|
+
2027-08-11,Wed,JPY,Japan bank holidays,Mountain Day
|
|
89
|
+
2027-08-30,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Late Summer Bank Holiday
|
|
90
|
+
2027-09-06,Mon,USD,Federal Reserve (Fedwire) holidays,Labor Day
|
|
91
|
+
2027-09-20,Mon,JPY,Japan bank holidays,Respect for the Aged Day
|
|
92
|
+
2027-09-23,Thu,JPY,Japan bank holidays,Autumnal Equinox Day
|
|
93
|
+
2027-10-11,Mon,USD,Federal Reserve (Fedwire) holidays,Columbus Day
|
|
94
|
+
2027-10-11,Mon,JPY,Japan bank holidays,Sports Day
|
|
95
|
+
2027-10-25,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Labour Day
|
|
96
|
+
2027-11-03,Wed,JPY,Japan bank holidays,Culture Day
|
|
97
|
+
2027-11-11,Thu,USD,Federal Reserve (Fedwire) holidays,Veterans Day
|
|
98
|
+
2027-11-23,Tue,JPY,Japan bank holidays,Labor Thanksgiving Day
|
|
99
|
+
2027-11-25,Thu,USD,Federal Reserve (Fedwire) holidays,Thanksgiving Day
|
|
100
|
+
2027-12-27,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Christmas Day (observed)
|
|
101
|
+
2027-12-27,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Christmas Day (observed)
|
|
102
|
+
2027-12-28,Tue,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Boxing Day (observed)
|
|
103
|
+
2027-12-28,Tue,NZD,New Zealand holidays incl. Wellington Anniversary,Boxing Day (observed)
|
|
104
|
+
2027-12-31,Fri,JPY,Japan bank holidays,Bank Holiday
|
|
105
|
+
2028-01-03,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",New Year's Day (observed)
|
|
106
|
+
2028-01-03,Mon,JPY,Japan bank holidays,Bank Holiday
|
|
107
|
+
2028-01-03,Mon,AUD,New South Wales bank holidays (Sydney),New Year's Day (observed)
|
|
108
|
+
2028-01-03,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,New Year's Day (observed)
|
|
109
|
+
2028-01-04,Tue,NZD,New Zealand holidays incl. Wellington Anniversary,Day after New Year's Day (observed)
|
|
110
|
+
2028-01-10,Mon,JPY,Japan bank holidays,Coming of Age Day
|
|
111
|
+
2028-01-17,Mon,USD,Federal Reserve (Fedwire) holidays,"Birthday of Martin Luther King, Jr."
|
|
112
|
+
2028-01-24,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Wellington Anniversary Day
|
|
113
|
+
2028-01-26,Wed,AUD,New South Wales bank holidays (Sydney),Australia Day
|
|
114
|
+
2028-02-07,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Waitangi Day (observed)
|
|
115
|
+
2028-02-11,Fri,JPY,Japan bank holidays,Foundation Day
|
|
116
|
+
2028-02-21,Mon,USD,Federal Reserve (Fedwire) holidays,Washington's Birthday
|
|
117
|
+
2028-02-23,Wed,JPY,Japan bank holidays,Emperor's Birthday
|
|
118
|
+
2028-03-20,Mon,JPY,Japan bank holidays,Vernal Equinox Day
|
|
119
|
+
2028-04-14,Fri,EUR,TARGET2 / T2 closing days,Good Friday
|
|
120
|
+
2028-04-14,Fri,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Good Friday
|
|
121
|
+
2028-04-14,Fri,AUD,New South Wales bank holidays (Sydney),Good Friday
|
|
122
|
+
2028-04-14,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Good Friday
|
|
123
|
+
2028-04-17,Mon,EUR,TARGET2 / T2 closing days,Easter Monday
|
|
124
|
+
2028-04-17,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Easter Monday
|
|
125
|
+
2028-04-17,Mon,AUD,New South Wales bank holidays (Sydney),Easter Monday
|
|
126
|
+
2028-04-17,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Easter Monday
|
|
127
|
+
2028-04-25,Tue,AUD,New South Wales bank holidays (Sydney),ANZAC Day
|
|
128
|
+
2028-04-25,Tue,NZD,New Zealand holidays incl. Wellington Anniversary,Anzac Day
|
|
129
|
+
2028-05-01,Mon,EUR,TARGET2 / T2 closing days,Labour Day
|
|
130
|
+
2028-05-01,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",May Day
|
|
131
|
+
2028-05-03,Wed,JPY,Japan bank holidays,Constitution Day
|
|
132
|
+
2028-05-04,Thu,JPY,Japan bank holidays,Greenery Day
|
|
133
|
+
2028-05-05,Fri,JPY,Japan bank holidays,Children's Day
|
|
134
|
+
2028-05-29,Mon,USD,Federal Reserve (Fedwire) holidays,Memorial Day
|
|
135
|
+
2028-05-29,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Spring Bank Holiday
|
|
136
|
+
2028-06-05,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,King's Birthday
|
|
137
|
+
2028-06-12,Mon,AUD,New South Wales bank holidays (Sydney),King's Birthday
|
|
138
|
+
2028-06-19,Mon,USD,Federal Reserve (Fedwire) holidays,Juneteenth National Independence Day
|
|
139
|
+
2028-07-04,Tue,USD,Federal Reserve (Fedwire) holidays,Independence Day
|
|
140
|
+
2028-07-14,Fri,NZD,New Zealand holidays incl. Wellington Anniversary,Matariki
|
|
141
|
+
2028-07-17,Mon,JPY,Japan bank holidays,Marine Day
|
|
142
|
+
2028-08-07,Mon,AUD,New South Wales bank holidays (Sydney),Bank Holiday
|
|
143
|
+
2028-08-11,Fri,JPY,Japan bank holidays,Mountain Day
|
|
144
|
+
2028-08-28,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Late Summer Bank Holiday
|
|
145
|
+
2028-09-04,Mon,USD,Federal Reserve (Fedwire) holidays,Labor Day
|
|
146
|
+
2028-09-18,Mon,JPY,Japan bank holidays,Respect for the Aged Day
|
|
147
|
+
2028-09-22,Fri,JPY,Japan bank holidays,Autumnal Equinox Day
|
|
148
|
+
2028-10-02,Mon,AUD,New South Wales bank holidays (Sydney),Labor Day
|
|
149
|
+
2028-10-09,Mon,USD,Federal Reserve (Fedwire) holidays,Columbus Day
|
|
150
|
+
2028-10-09,Mon,JPY,Japan bank holidays,Sports Day
|
|
151
|
+
2028-10-23,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Labour Day
|
|
152
|
+
2028-11-03,Fri,JPY,Japan bank holidays,Culture Day
|
|
153
|
+
2028-11-23,Thu,USD,Federal Reserve (Fedwire) holidays,Thanksgiving Day
|
|
154
|
+
2028-11-23,Thu,JPY,Japan bank holidays,Labor Thanksgiving Day
|
|
155
|
+
2028-12-25,Mon,USD,Federal Reserve (Fedwire) holidays,Christmas Day
|
|
156
|
+
2028-12-25,Mon,EUR,TARGET2 / T2 closing days,Christmas Day
|
|
157
|
+
2028-12-25,Mon,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Christmas Day
|
|
158
|
+
2028-12-25,Mon,AUD,New South Wales bank holidays (Sydney),Christmas Day
|
|
159
|
+
2028-12-25,Mon,NZD,New Zealand holidays incl. Wellington Anniversary,Christmas Day
|
|
160
|
+
2028-12-26,Tue,EUR,TARGET2 / T2 closing days,Christmas Holiday
|
|
161
|
+
2028-12-26,Tue,GBP,"England and Wales bank holidays (CHAPS, Bacs)",Boxing Day
|
|
162
|
+
2028-12-26,Tue,AUD,New South Wales bank holidays (Sydney),Boxing Day
|
|
163
|
+
2028-12-26,Tue,NZD,New Zealand holidays incl. Wellington Anniversary,Boxing Day
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fx-spot-dates
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: FX settlement holidays and T+2 spot value dates for USD, EUR (TARGET2), GBP, JPY, AUD, NZD. Standard library only.
|
|
5
|
+
Author-email: Plainfold <plainfoldhq@proton.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/plainfoldhq/fx-settlement-holidays
|
|
8
|
+
Project-URL: Documentation, https://plainfoldhq.github.io/fx-settlement-holidays/
|
|
9
|
+
Project-URL: Source, https://github.com/plainfoldhq/fx-settlement-holidays
|
|
10
|
+
Project-URL: Issues, https://github.com/plainfoldhq/fx-settlement-holidays/issues
|
|
11
|
+
Keywords: fx,spot date,value date,settlement,target2,business days,holidays,forex,fedwire
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
16
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# FX settlement holidays and spot value dates 2026-2028 (CSV)
|
|
23
|
+
|
|
24
|
+
Free CSV files with the settlement holidays of six currencies for 2026, 2027 and 2028, and the T+2 spot value date for every weekday trade date of EURUSD, USDJPY, GBPUSD and EURGBP.
|
|
25
|
+
|
|
26
|
+
| Currency | Calendar |
|
|
27
|
+
|---|---|
|
|
28
|
+
| USD | Federal Reserve (Fedwire) holidays |
|
|
29
|
+
| EUR | TARGET2 / T2 closing days |
|
|
30
|
+
| GBP | England and Wales bank holidays (CHAPS, Bacs) |
|
|
31
|
+
| JPY | Japan bank holidays (national holidays + December 31 to January 3) |
|
|
32
|
+
| AUD | New South Wales bank holidays, Sydney only (2028 only here: see below) |
|
|
33
|
+
| NZD | New Zealand holidays incl. Wellington Anniversary (Wellington only; Auckland Anniversary not included) |
|
|
34
|
+
|
|
35
|
+
## Python package
|
|
36
|
+
|
|
37
|
+
`fx-spot-dates` (standard library only) bundles the 2026-2028 calendars:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
import fx_spot_dates as fx
|
|
41
|
+
fx.spot_date("USDJPY", "2026-12-29") # datetime.date(2027, 1, 4)
|
|
42
|
+
fx.is_business_day("USD", "2026-07-03") # True: the Fed does not close the Friday before a Saturday holiday
|
|
43
|
+
fx.add_business_days(["EUR", "GBP"], "2026-12-23", 2)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Install: `pip install "git+https://github.com/plainfoldhq/fx-settlement-holidays"` (a PyPI release is pending).
|
|
47
|
+
|
|
48
|
+
## Files
|
|
49
|
+
|
|
50
|
+
`data/settlement_holidays_2026_2028.csv`: one row per weekday holiday: `date`, `weekday`, `currency`, `calendar`, `holiday` (English name).
|
|
51
|
+
|
|
52
|
+
`data/fx_spot_dates_2026_2028.csv`: `trade_date` (every weekday), `pair`, `spot_date`, `calendar_days`.
|
|
53
|
+
|
|
54
|
+
`data/coverage_2026_2028.csv`: which currency-years are included. AUD 2026 and 2027 are not: the two implementations disagree on the Monday after Anzac Day (2026-04-27, 2027-04-26).
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import csv
|
|
58
|
+
spot = {(r["pair"], r["trade_date"]): r["spot_date"]
|
|
59
|
+
for r in csv.DictReader(open("data/fx_spot_dates_2026_2028.csv"))}
|
|
60
|
+
spot[("USDJPY", "2026-12-29")] # '2027-01-04': Japanese banks close Dec 31 - Jan 3
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Load straight from GitHub:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
import pandas as pd
|
|
67
|
+
url = "https://raw.githubusercontent.com/plainfoldhq/fx-settlement-holidays/main/data/settlement_holidays_2026_2028.csv"
|
|
68
|
+
pd.read_csv(url).query("currency == 'EUR'") # TARGET2 closing days
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Spot convention
|
|
72
|
+
|
|
73
|
+
T+2. For pairs with USD, day 1 is the next business day of the non-USD currency (a USD holiday on day 1 does not count) and day 2 the next day that is a business day in both currencies. For crosses (EURGBP), two business days of both currencies, then forward to the first day that is also a USD business day. Some banks apply other rules: confirm with your counterparty.
|
|
74
|
+
|
|
75
|
+
## How the data is made and checked
|
|
76
|
+
|
|
77
|
+
- Holidays: generated with the Python [`holidays`](https://github.com/vacanza/holidays) package (MIT) and kept only for currency-years where [QuantLib](https://www.quantlib.org/) (an independent implementation) agrees on every weekday.
|
|
78
|
+
- `tests/` recomputes every holiday and every spot date with QuantLib on each push (CI).
|
|
79
|
+
|
|
80
|
+
## Limits
|
|
81
|
+
|
|
82
|
+
Future dates follow current rules; central banks and governments can add holidays (for example a state funeral). Not compared with official central-bank or CLS calendars. Not financial advice; not for use as the only source for settlement decisions. Not affiliated with any central bank, payment system or CLS.
|
|
83
|
+
|
|
84
|
+
## Full pack: 2000-2050, 15 pairs
|
|
85
|
+
|
|
86
|
+
The paid pack covers 2000-2050 (296 of 306 currency-years), a day-by-day business-day table per currency, spot value dates for all 15 pairs of these currencies, SQLite, JSON, .ics, a tested PostgreSQL loader and a standard-library helper (`spot_date`, `add_business_days`). $19: [buy on Polar](https://buy.polar.sh/polar_cl_9Rkaup8QpzW7cYaFe9nRx0AEiUSxVLMzYyU1K23uuVP) (checkout and tax by Polar, merchant of record). Also in the [All-Access yearly plan](https://buy.polar.sh/polar_cl_xydfuofU72fdp6xSOHFtihAuniUFagYOwR9zf2M03Gl) with every Plainfold data pack.
|
|
87
|
+
|
|
88
|
+
More calendars: [options expiration dates](https://github.com/plainfoldhq/options-expiration-dates), [stock exchange holidays](https://github.com/plainfoldhq/stock-exchange-holidays), [public holidays by country](https://github.com/plainfoldhq/world-public-holidays), [US federal/NYSE/Fed business days](https://github.com/plainfoldhq/us-federal-calendar). Reference pages: [plainfoldhq.github.io](https://plainfoldhq.github.io/).
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
Data in `data/`: CC0 1.0 (public domain). Tests: MIT. See LICENSE.
|
|
93
|
+
|
|
94
|
+
Made by Plainfold, an AI-run business. Issues and corrections: open an issue or email plainfoldhq@proton.me.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
fx_spot_dates/__init__.py,sha256=yUrFF5dG-4dyHyrzKn6_0h9DAiKamELYfsXkWyUpaFI,4744
|
|
2
|
+
fx_spot_dates/__main__.py,sha256=5U-xUnfDMK2L7om8wCLrM_Nhwsmnb2WxyAthsdWSXlg,47
|
|
3
|
+
fx_spot_dates/data/coverage_2026_2028.csv,sha256=zG6hIPbL5ElYBYFyMw4c0u8Vp12zLZjtYQpm1MBQfS0,448
|
|
4
|
+
fx_spot_dates/data/settlement_holidays_2026_2028.csv,sha256=jIzR5QLbxQyimim5k5RpXs6Na-u9auji6cTyj6hUmi4,11542
|
|
5
|
+
fx_spot_dates-0.1.0.dist-info/licenses/LICENSE,sha256=2pI17MhRkZz29ZvRpNY6j2D1SXJ95cioK0nUJLxEm1E,1235
|
|
6
|
+
fx_spot_dates-0.1.0.dist-info/METADATA,sha256=yAYevW1hYLQxVNL19o6xJi6oyQ0ub_3D6Fq9L6M7NuQ,5415
|
|
7
|
+
fx_spot_dates-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
8
|
+
fx_spot_dates-0.1.0.dist-info/entry_points.txt,sha256=10I_g0nyHpjp2RtynFanYnI0h3QdWWjE9QtwmY3D4WU,52
|
|
9
|
+
fx_spot_dates-0.1.0.dist-info/top_level.txt,sha256=DZsSdg0bnLoHIkQcuY7zecAob6dwjW4iJimSElKAZFI,14
|
|
10
|
+
fx_spot_dates-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License (tests/) and CC0 1.0 (data/)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Plainfold
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
The files in data/ are dedicated to the public domain under CC0 1.0
|
|
24
|
+
Universal: https://creativecommons.org/publicdomain/zero/1.0/legalcode
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fx_spot_dates
|