Skip to main content

I-Ching objects construction using Python type hints.

Project description

I-Ching Python

pypi codecov license

汉语文档由此

Foreword by Carl Gustav Jung

Description

I-Ching objects construction using Python type hints.

Pattern-based implementation without hard-coded mappings. Define how philosophical concepts in pure Python.

Features

  1. Generating hexagrams using multiple methods (yarrow stalks, three coins, datetime),
  2. Arithmetic operations on Heavenly Stems and Earthly Branches (干支)
  3. Multi-language support (Chinese and English)
  4. Interpreting meanings of hexagrams (TODO)
  5. 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  ----- OBJECT
SIBLINGS Xin  (8) You  (10) METAL -----
CHILDREN Xin  (8) Hai  (12) WATER -----
PARENTS  Xin  (8) Chou (2 ) EARTH -- -- SUBJECT
"""

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

ichingpy-0.1.10.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ichingpy-0.1.10-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file ichingpy-0.1.10.tar.gz.

File metadata

  • Download URL: ichingpy-0.1.10.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ichingpy-0.1.10.tar.gz
Algorithm Hash digest
SHA256 dcd0167e4d3beaa25c6993c1b265a4ab09f7999072c57181030d62008caede74
MD5 256884be84c9c46cd2f3d56988bccef0
BLAKE2b-256 5f238d2bb42f52138d8e725976b60e0290c2eaf3419720f3c63baac143fdfec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ichingpy-0.1.10.tar.gz:

Publisher: python-publish.yml on JinyangWang27/ichingpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ichingpy-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: ichingpy-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ichingpy-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a7829d8c2a3cadc9214b98573c07b15e26050674cfee4232a526e51d82e2bff4
MD5 e4043b3c230b32393d7582735b986114
BLAKE2b-256 fb541c782108427f4602ac0c3d1e6b48d9c0c0bda8ebceed77a288236bf31941

See more details on using hashes here.

Provenance

The following attestation bundles were made for ichingpy-0.1.10-py3-none-any.whl:

Publisher: python-publish.yml on JinyangWang27/ichingpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page