Thuật toán Bát Tự Tiết Khí
Thư viện Python hỗ trợ xác định Can Chi của Tháng (theo Kinh độ mặt trời / Tiết khí) và Can Chi của Giờ (theo định luật Ngũ Tý Ca).
Cài đặt
pip install battu-tietkhi
Cập nhật lên bản mới nhất:
pip install -U battu-tietkhi
Nếu pip báo lỗi externally-managed-environment (Ubuntu, Debian mới), hãy dùng môi trường ảo:
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# Windows PowerShell: .\.venv\Scripts\Activate.ps1
pip install battu-tietkhi
Cách gọi sử dụng trong Code
from battu_tietkhi import get_battu_month, get_battu_hour
# Tính tháng Bát Tự từ Kinh độ mặt trời (Ví dụ: 316 độ, năm Bính)
thang = get_battu_month(316.0, "Bính")
print(thang) # Ví dụ: "Canh Dần"
# Tính giờ Bát Tự từ thời gian và Can Ngày (Ví dụ: 14h30, ngày Kỷ)
import datetime
gio = get_battu_hour(datetime.datetime(2026, 3, 5, 14, 30), "Kỷ")
print(gio)
Kiểm tra sau khi cài đặt
python -c "from battu_tietkhi import get_battu_month, get_battu_hour; print(get_battu_month(316.0, 'Bính')); print(get_battu_hour(__import__('datetime').datetime(2026, 3, 5, 14, 30), 'Kỷ'))"
Nếu lệnh trên chạy mà không báo lỗi import, nghĩa là bạn đã cài đặt đúng.
Cài từ mã nguồn (dành cho lập trình viên)
git clone https://github.com/caphenpro/battu_tietkhi.git
cd battu_tietkhi
pip install .
Giấy phép
MIT License.
Metadata
Release files for battu-tietkhi 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| battu_tietkhi-1.1.2.tar.gz | 3.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| battu_tietkhi-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / battu_tietkhi-1.1.2.tar.gz
| Download URL | battu_tietkhi-1.1.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa64ee4ce43b96098ea0b2c3d0a28d15a03224d2c20af28718b76130b02a32f1
|
|
BLAKE2b-256 checksum How to use checksums |
6952c1a1ec63685121e11b75b925b9b2d070d51a852d1d63a1084a8fe16a7131
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 25, 2026.
Transparency logRelease files / battu_tietkhi-1.1.2-py3-none-any.whl
| Download URL | battu_tietkhi-1.1.2-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
081c25d8e38d65ee0cb54201cba87bcf6f560310b23e7abc0e40f5630ded5d7d
|
|
BLAKE2b-256 checksum How to use checksums |
88e66adbe5ef4c3e4c5425891bf2af3dba64162e6dc797870111e7f24382bbc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 25, 2026.
Transparency logSecurity for battu-tietkhi 1.1.2
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for battu_tietkhi-1.1.2.tar.gz
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 Oct 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.