I-Ching objects construction using Python type hints.
Project description
I-Ching Python
Description
I-Ching objects construction using Python type hints.
Pattern-based implementation without hard-coded mappings. Define how philosophical concepts in pure Python.
Features
- Generating hexagrams using multiple methods (yarrow stalks, three coins, datetime),
- Arithmetic operations on Heavenly Stems and Earthly Branches (干支)
- Multi-language support (Chinese and English)
- Interpreting meanings of hexagrams (TODO)
- Performing divination based on the I-Ching (TODO)
Installation
pip install ichingpy
Help
See Documentation for more details.
A Simple Example
import ichingpy as icp
icp.set_language("en")
Arithmetic operations on Heavenly Stems and Earthly Branches (干支)
icp.HeavenlyStem.Jia + 1
<HeavenlyStem.Yi: 2>
gui = icp.HeavenlyStem.Gui
jia = icp.HeavenlyStem.Jia
jia + gui
#> <HeavenlyStem.Jia: 1>
jia = icp.HeavenlyStem.Jia
zi = icp.EarthlyBranch.Zi
jia_zi = icp.SexagenaryCycle(jia, zi)
jia_zi
#> Jia Zi
jia_zi+1
#> Yi Chou
jia_zi+60
#> Jia Zi
Assign Stem and Branch to a hexagram (装卦、纳甲)
gou = icp.Hexagram.from_binary([2, 1, 1, 1, 1, 1])
gou
"""
-----
-----
-----
-----
-----
-- --
"""
assigner = icp.SixLinesDivinationEngine()
assigner.execute(gou)
gou
"""
PARENTS Ren (9) Xu (11) EARTH -----
SIBLINGS Ren (9) Shen (9 ) METAL -----
OFFICIALSRen (9) Wu (7 ) FIRE -----
SIBLINGS Xin (8) You (10) METAL -----
CHILDREN Xin (8) Hai (12) WATER -----
PARENTS Xin (8) Chou (2 ) EARTH -- --
"""
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 ichingpy-0.1.9.tar.gz.
File metadata
- Download URL: ichingpy-0.1.9.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e30c33bc8e799c527403c0c9bde4c36821c668431000431a25d07e676bcb20f7
|
|
| MD5 |
a205c09ed60e5ec8bb73798dc83aebc6
|
|
| BLAKE2b-256 |
34fb353e18ec31fa0ac379c6c0fb5ab2a372cfb9949b3c5d5b8938723d12809c
|
Provenance
The following attestation bundles were made for ichingpy-0.1.9.tar.gz:
Publisher:
python-publish.yml on JinyangWang27/ichingpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ichingpy-0.1.9.tar.gz -
Subject digest:
e30c33bc8e799c527403c0c9bde4c36821c668431000431a25d07e676bcb20f7 - Sigstore transparency entry: 163581309
- Sigstore integration time:
-
Permalink:
JinyangWang27/ichingpy@5284db066b1a0d0ab93035b9fe998f3df784f8e7 -
Branch / Tag:
refs/tags/0.1.9 - Owner: https://github.com/JinyangWang27
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5284db066b1a0d0ab93035b9fe998f3df784f8e7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ichingpy-0.1.9-py3-none-any.whl.
File metadata
- Download URL: ichingpy-0.1.9-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e731e458059de4d860af141469591c7364f1f1d498ee770717595e3b46dfba6f
|
|
| MD5 |
cd27f028bb8c9ea2e1273ce9c513d37a
|
|
| BLAKE2b-256 |
0c835dc77a20b69088b1929cddfeef71422af8ca3a0553e97c7bd2ad2eb247e1
|
Provenance
The following attestation bundles were made for ichingpy-0.1.9-py3-none-any.whl:
Publisher:
python-publish.yml on JinyangWang27/ichingpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ichingpy-0.1.9-py3-none-any.whl -
Subject digest:
e731e458059de4d860af141469591c7364f1f1d498ee770717595e3b46dfba6f - Sigstore transparency entry: 163581310
- Sigstore integration time:
-
Permalink:
JinyangWang27/ichingpy@5284db066b1a0d0ab93035b9fe998f3df784f8e7 -
Branch / Tag:
refs/tags/0.1.9 - Owner: https://github.com/JinyangWang27
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5284db066b1a0d0ab93035b9fe998f3df784f8e7 -
Trigger Event:
release
-
Statement type: