quando
Navigate trading calendars, business days, and market periods — with zero fuss.
Features
-
52 methods, one import
Conversions, timezone, validation, day checks, navigation, ranges, period boundaries, settlement, and expiry — all under
import quando as q. -
Auto-detecting inputs
Pass a string,
datetime,date, Unix epoch, or Excel West serial — quando figures it out. No manual parsing. -
8 exchange calendars
NYSE, EUREX, LSE, TSX, ASX, HKEX, JPX, CME — or any
exchange-calendarscode. Switch with a singleq.use()call. -
Custom holidays
Add or remove holidays, persist overrides to JSON, and load them back in any session. Merged transparently at query time.
-
Rebalancing triggers
is_month_end(),is_quarter_end(),is_year_end()— drop-in conditions for backtest rebalancing logic. -
Settlement & expiry
T+Nconventions, COB roll-back, and monthly/quarterly/weekly expiry dates for derivatives workflows.
Quick start
import quando as q
q.start_of_month("2024-09-15") # Sep 3 (Sep 1 Sunday, Sep 2 Labor Day)
q.end_of_quarter("2024-01-15") # Mar 28 (Mar 31 Sunday, Mar 29 Good Friday)
q.end_of_year("2024-06-01") # Dec 31
# Rebalancing trigger
if q.is_month_end("2024-01-31"):
print("rebalance!") # prints — Jan 31 is last NYSE trading day
Supported calendars
| Alias | Exchange | Timezone |
|---|---|---|
NYSE |
New York Stock Exchange | America/New_York |
EUREX |
Eurex | Europe/Berlin |
LSE |
London Stock Exchange | Europe/London |
TSX |
Toronto Stock Exchange | America/Toronto |
ASX |
Australian Securities Exchange | Australia/Sydney |
HKEX |
Hong Kong Exchanges | Asia/Hong_Kong |
JPX |
Japan Exchange Group | Asia/Tokyo |
CME |
Chicago Mercantile Exchange | America/Chicago |
Any exchange-calendars exchange code (e.g. "XLON", "XEUR") also works directly.