Calculate Tibetan Namkha thread-cross color schemes in Chögyal Namkhai Norbu tradition.
Project description
Namkha Calculator
Python library for calculating Namkha thread-cross colour schemes in the tradition of Chögyal Namkhai Norbu Rinpoche, with all the methods covered in the source text.[^1] Classical Tibetan astrology calculations were added for cases where the source refers to them for complete instructions.[^2]
Development status
[!WARNING] The project is in an alpha stage – all calculations should be checked manually when making a real Namkha.
TODO
- Year Namkha calculation (CNNR and Classic)
- Birth-time edge-case warnings
- Month Namkha calculation
- Day Namkha calculation
- Hour Namkha calculation
- Automatic historical timezone detection from coordinates
- More pre-calculated test cases
- Further investigation into the high-latitude regions problem
Usage
from datetime import datetime
import pytz
import namkha_calculator as nc
subject = nc.Subject(
name="John Doe",
gender=nc.Gender.MALE,
birth_datetime=datetime(1985, 3, 15, 14, 30), # naive local time
birth_timezone=pytz.timezone("Europe/Berlin"),
birth_location=nc.Location(latitude=52.52, longitude=13.40, name="Berlin"),
)
result = nc.calculate_namkha(
namkha_type=nc.NamkhaType.YEAR,
subject=subject,
method=nc.CalculationMethod.CLASSIC, # or CalculationMethod.CNNR
)
for aspect in result.harmonized_aspects:
threads = ", ".join(e.value for e in aspect.harmonization_seq)
conflict = " (conflicted)" if aspect.is_conflicted else ""
print(f"{aspect.name.name}: center={aspect.center.value}, threads=[{threads}]{conflict}")
for note in result.calculation_notes:
print(f"[{note.note_type.name}] {note.message}")
Key types
User input
Subject – birth data for one person or any other appropriate entity.
| Field | Type | Notes |
|---|---|---|
gender |
Gender |
MALE or FEMALE |
birth_datetime |
datetime |
'naive' (no tzinfo) local time |
birth_timezone |
pytz.BaseTzInfo |
use pytz.timezone(...) |
birth_location |
Location |
latitude/longitude in decimal degrees, optional place name |
name |
str or None |
optional subject name |
Location – NamedTuple(latitude, longitude, name=None).
NamkhaType – YEAR, MONTH, DAY, HOUR.
CalculationMethod – CNNR (Chögyal Namkhai Norbu Rinpoche's tradition) or CLASSIC ("classical" Tibetan astrology tradition). Only YEAR accepts CNNR; all other types use CLASSIC.
Result
NamkhaCalculationResult
| Field | Type | Description |
|---|---|---|
harmonized_aspects |
tuple[HarmonizedAspect, ...] |
eight aspects in order |
mewa_numbers |
dict[Aspect, int] |
mewa number for each mewa aspect |
calculation_notes |
tuple[CalculationNoteItem, ...] |
notices or cautions |
HarmonizedAspect
| Field | Type | Description |
|---|---|---|
name |
Aspect |
LIFE, BODY, CAPACITY, FORTUNE, MEWA_* |
center |
Element |
centre element |
harmonization_seq |
tuple[Element, ...] |
harmonization sequence: remaining thread colours outward |
is_conflicted |
bool or None |
None for LIFE; True when conflict harmonization applied |
Calculation notes
PERIOD_BOUNDARY (caution) is attached when the birth time falls within 5 minutes of a calculation-period boundary (for YEAR, the Tibetan year start/end). That close to a boundary the result can flip to the neighbouring period, so the birth time must be precise.
HIGH_LATITUDE (notice) is attached when abs(latitude) >= 60.0. Above this limit the library falls back to a fixed 5:00 AM day-start instead of civil twilight, which affects birth period boundary detection.
Latitude "trimming"
In the Tibetan calendar a new day begins at dawn, not at midnight. The library defines dawn as the start of civil twilight – the moment the sky first starts to brighten before sunrise (in traditional texts, when one can see the lines on the palm of their hand). This boundary decides which Tibetan hour (and therefore Tibetan day, month, etc.) a given birth time belongs to.
Closer to the poles (i.e. at higher latitudes) this breaks down. For long parts of the year there is no dawn: the midnight sun in summer, when the sky never fully darkens, and the polar night in winter, when it never properly brightens. On those dates civil twilight does not start (or does not end), so there is no dawn to anchor the day to and the astronomical lookup returns nothing.
As far as we know, there is no unified solution to this problem among Tibetan astrologers today. Considering different suggestions, for now we decided on the following method: the library "trims" the usable latitude range at 60° north/south. Below that limit it uses the real civil-twilight dawn. At or above it, it falls back to a fixed 5:00 AM local time (also can be found in Tibetan traditions) as the day-start and attaches the HIGH_LATITUDE notice.
Contributing
Issues, PRs and questions are welcome.
See CONTRIBUTING.md for details.
Acknowledgments
Whatever wisdom this contains belongs to the Tibetan astrological traditions and their holders; whatever faults it contains are our own.
We thank everyone who supported the Namkha Calculator project financially – your help means a great deal to us, and it sustained us through a lot of obstacles.
We would also like to express our gratitude to: Migmar Tsering, Maria Rita Leti, Adriano Clemente, Alexander Khosmo and Tatiana Ulyanova for their guidance on Tibetan astrology; and to the Gakyil of Merigar East – Oana Marcu and Krisztina Balla for their invaluable help in providing indispensable educational materials.
References
[^1]: C.N. Norbu. Namkha: Harmonizing the Energy of the Elements. Shang Shung Publications, 2022.
[^2]: C.N. Norbu. Key for Consulting the Tibetan Calendar. Shang Shung Publications, 2014. M. Tsering. Jung-We Kyil-Khor – Mandala of Astrological Elements. Dynamic Space of the Elements ETS, 2020
Project details
Release history Release notifications | RSS feed
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 namkha_calculator-0.1.0a3.tar.gz.
File metadata
- Download URL: namkha_calculator-0.1.0a3.tar.gz
- Upload date:
- Size: 78.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67403243c8b364cddba11c5a19e0a6ac307543d50956666846a64ffe283d21f2
|
|
| MD5 |
8d5e47f8280f6e75a1a0a7515dff8f38
|
|
| BLAKE2b-256 |
2bed5fbe7b2f0b50ccae255e7029b84bd52c97dcba49c8cb59815f1cfef0b732
|
Provenance
The following attestation bundles were made for namkha_calculator-0.1.0a3.tar.gz:
Publisher:
publish.yml on NamkhaEncyclopedia/namkha-calculator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
namkha_calculator-0.1.0a3.tar.gz -
Subject digest:
67403243c8b364cddba11c5a19e0a6ac307543d50956666846a64ffe283d21f2 - Sigstore transparency entry: 1839856856
- Sigstore integration time:
-
Permalink:
NamkhaEncyclopedia/namkha-calculator@75fe04948cb4dff872cffb9a89add1bb2b0dad1c -
Branch / Tag:
refs/tags/v0.1.0a3 - Owner: https://github.com/NamkhaEncyclopedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75fe04948cb4dff872cffb9a89add1bb2b0dad1c -
Trigger Event:
push
-
Statement type:
File details
Details for the file namkha_calculator-0.1.0a3-py3-none-any.whl.
File metadata
- Download URL: namkha_calculator-0.1.0a3-py3-none-any.whl
- Upload date:
- Size: 78.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0569be6d427e54599558255b9a80409fdba9de2d4193300ca10478b74e4bf0c
|
|
| MD5 |
9f9ba0160e70e0f4641acb6ad450f6d7
|
|
| BLAKE2b-256 |
3c923c6ef69c084a38a75f3aaa8140dfb808e1444c47f0257bf22febc770700f
|
Provenance
The following attestation bundles were made for namkha_calculator-0.1.0a3-py3-none-any.whl:
Publisher:
publish.yml on NamkhaEncyclopedia/namkha-calculator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
namkha_calculator-0.1.0a3-py3-none-any.whl -
Subject digest:
b0569be6d427e54599558255b9a80409fdba9de2d4193300ca10478b74e4bf0c - Sigstore transparency entry: 1839856890
- Sigstore integration time:
-
Permalink:
NamkhaEncyclopedia/namkha-calculator@75fe04948cb4dff872cffb9a89add1bb2b0dad1c -
Branch / Tag:
refs/tags/v0.1.0a3 - Owner: https://github.com/NamkhaEncyclopedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@75fe04948cb4dff872cffb9a89add1bb2b0dad1c -
Trigger Event:
push
-
Statement type: