Skip to main content

vn-market-calendar

CI PyPI version Python 3.10+ License: MIT Coverage

Trading calendar for Vietnamese stock exchanges — HOSE, HNX, UPCOM. Holidays, session schedules, tick sizes, T+2 settlement, and real-time market-state helpers. Data 2000-2040, auto-updated annually.

Install

pip install vn-market-calendar              # core
pip install "vn-market-calendar[pandas]"   # + pandas helpers

Quick start

from vn_market_calendar import HOSE

cal = HOSE()
cal.is_trading_day("2024-04-30")           # False (Reunification Day)
cal.next_trading_day("2024-04-26")         # date(2024, 5, 2)
cal.count_trading_days("2024-01-01", "2024-12-31")  # 250

for s in cal.sessions("2024-05-02"):
    print(s.name, s.start, s.end)
    # pre_open_ato         09:00:00 09:15:00
    # continuous_morning   09:15:00 11:30:00
    # lunch_break          11:30:00 13:00:00
    # continuous_afternoon 13:00:00 14:30:00
    # atc                  14:30:00 14:45:00
    # put_through          14:45:00 15:00:00

    cal.tick_size(price=15_000)                # 50 VND
    cal.lot_size("ACB")                        # 100
    ```

    ## Financial analysis

    ```python
    from vn_market_calendar import HOSE, VN_TZ
    import datetime

    cal = HOSE()

    # Real-time market state
    cal.is_open()                  # True/False right now (Vietnam time)
    cal.current_session()          # Session("continuous_morning", ...) or None
    cal.next_session_open()        # datetime of next session open, tz-aware

    # T+2 settlement
    cal.settlement_day("2024-05-02")           # date(2024, 5, 6)
    cal.settlement_day("2024-04-26", lag=2)    # date(2024, 5, 3)

    # Trading minutes per day
    cal.trading_minutes("2024-05-02")          # 270 (excl. lunch)
    ```

    ## pandas helpers

    ```python
    from vn_market_calendar.pandas_helpers import (
        trading_days, is_trading_day_series,
            next_trading_day_series, previous_trading_day_series,
                settlement_day_series,
                )

                idx    = trading_days("2024-01-01", "2024-12-31")
                settled = settlement_day_series(df["trade_date"], lag=2)
                ```

                ## CLI

                ```
                vn-market-calendar is-trading 2024-04-30
                vn-market-calendar next       2024-04-29 --exchange HNX
                vn-market-calendar count      2024-01-01 2024-12-31
                vn-market-calendar sessions   2024-05-02
                ```

                ## Supported exchanges

                | Exchange | Open date  | Tick size          |
                |----------|------------|--------------------|
                | HOSE     | 2000-07-28 | 10 / 50 / 100 VND  |
                | HNX      | 2005-03-14 | 100 VND flat       |
                | UPCOM    | 2009-06-24 | 100 VND flat       |

                ## Development

                ```
                make dev      # editable install
                make check    # lint + typecheck + tests
                ```

                **First-time repo setup:** `gh workflow run repo-setup.yml` — sets GitHub topics and homepage.

                **PyPI trusted publishing** (one-time, no stored secrets):
                1. PyPI -> Manage -> Settings -> Publishing -> Add trusted publisher
                2. Workflow: `publish.yml`, Environment: `pypi`

                ## License

                MIT (c) DataCore Vietnam
                

Release files for vn-market-calendar 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vn-market-calendar 0.2.0
File Size Uploaded
vn_market_calendar-0.2.0.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vn-market-calendar 0.2.0
File Interpreter ABI Platform
vn_market_calendar-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.2 kB

Release files / vn_market_calendar-0.2.0.tar.gz

Download URL vn_market_calendar-0.2.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e3a95f8dc9066e6b1706f4a748c2fa5a5dd33978789085d0bcb079ed30ba2455
BLAKE2b-256 checksum
How to use checksums
ea6512d4a637ab9075adcb9a8b224e8420c368ede06816ed5bbc8d9ee66eac00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / vn_market_calendar-0.2.0-py3-none-any.whl

Download URL vn_market_calendar-0.2.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7060e849e98836fd4050283977fa38a8c0b5cb4bce232f151b41d6abfa8410b1
BLAKE2b-256 checksum
How to use checksums
c2a93bfe3538b03ff9c9d45bed8812449a16e0125e8a0b7dc55be7a6ba0d533d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page