Vietnamese lunar calendar conversion (Ho Ngoc Duc algorithm, per calrules)
Project description
Am Lich Viet Nam
Python library for converting between Gregorian (solar) calendar
and Vietnamese lunar calendar.
Goal: simple – accurate – easy to reuse
FEATURES
- Convert Solar -> Lunar (dd/mm/yyyy -> lunar day/month/year with leap month flag)
- Convert Lunar -> Solar
- Leap month support
- Timezone support (parameter: time_zone, default UTC+7 – Vietnam)
INSTALLATION
#TODO Install via pip (after publishing):
pip install amlichvietnam
LOCAL TESTING
pip install -e .
pip install pytest
pytest -q
USAGE EXAMPLE
import datetime as dt
from lunar_vn import solar_to_lunar, lunar_to_solar, LunarDate
# Solar -> Lunar
l = solar_to_lunar((17, 2, 2026)) # Vietnamese Lunar New Year 2026
print(l) # LunarDate(day=1, month=1, year=2026, leap=False)
# Lunar -> Solar
d = lunar_to_solar(LunarDate(1, 1, 2026))
print(d) # 2026-02-17
# Using datetime.date
l2 = solar_to_lunar(dt.date(2024, 2, 10))
print(l2) # LunarDate(day=1, month=1, year=2024, leap=False)
ATTRIBUTION
The Vietnamese lunar calendar algorithm is described by Ho Ngoc Duc
on the website: https://xemamlich.uhm.vn
This library is a Python re-implementation of the published algorithm.
No original source code is copied.
LICENSE
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lunar_vn-1.0.0.tar.gz.
File metadata
- Download URL: lunar_vn-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51f799a453c3d668967ccb531aaf5e4b1c562c0ba38205c1d036f906385a0da0
|
|
| MD5 |
dd73924b938cb0db57833d11816fdcfc
|
|
| BLAKE2b-256 |
73bb6e00f00800f058e7aa64e71118fa1941b61b5c6bf30fd93219f45d1d8981
|
Provenance
The following attestation bundles were made for lunar_vn-1.0.0.tar.gz:
Publisher:
publish.yml on junkeythong/amlichvietnam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lunar_vn-1.0.0.tar.gz -
Subject digest:
51f799a453c3d668967ccb531aaf5e4b1c562c0ba38205c1d036f906385a0da0 - Sigstore transparency entry: 926779107
- Sigstore integration time:
-
Permalink:
junkeythong/amlichvietnam@88470c8e63a6d584431909ffe92983180c6c5598 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/junkeythong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88470c8e63a6d584431909ffe92983180c6c5598 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lunar_vn-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lunar_vn-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1495fb26076232c82459e09adfa3bd938892e7189dadb887874a15a30c0527ac
|
|
| MD5 |
9c60e31668f5c7ca612494cd0bb3ba80
|
|
| BLAKE2b-256 |
450ff00a58ec4d6c22e4d07c7012dd082b1a4a458ffef3b026295bf1d7d18851
|
Provenance
The following attestation bundles were made for lunar_vn-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on junkeythong/amlichvietnam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lunar_vn-1.0.0-py3-none-any.whl -
Subject digest:
1495fb26076232c82459e09adfa3bd938892e7189dadb887874a15a30c0527ac - Sigstore transparency entry: 926779109
- Sigstore integration time:
-
Permalink:
junkeythong/amlichvietnam@88470c8e63a6d584431909ffe92983180c6c5598 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/junkeythong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88470c8e63a6d584431909ffe92983180c6c5598 -
Trigger Event:
release
-
Statement type: