Skip to main content

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
"""

Metadata

Release files for ichingpy 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ichingpy 0.1.10
File Size Uploaded Provenance Actions
ichingpy-0.1.10.tar.gz 18.7 kB With provenance Details for ichingpy-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ichingpy 0.1.10
File Interpreter ABI Platform Actions
ichingpy-0.1.10-py3-none-any.whl Python 3 none any Details for ichingpy-0.1.10-py3-none-any.whl

Total release size: 46.1 kB

Release files / ichingpy-0.1.10.tar.gz

Download URL ichingpy-0.1.10.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dcd0167e4d3beaa25c6993c1b265a4ab09f7999072c57181030d62008caede74
BLAKE2b-256 checksum
How to use checksums
5f238d2bb42f52138d8e725976b60e0290c2eaf3419720f3c63baac143fdfec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Feb 9, 2025.

Transparency log

Release files / ichingpy-0.1.10-py3-none-any.whl

Download URL ichingpy-0.1.10-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7829d8c2a3cadc9214b98573c07b15e26050674cfee4232a526e51d82e2bff4
BLAKE2b-256 checksum
How to use checksums
fb541c782108427f4602ac0c3d1e6b48d9c0c0bda8ebceed77a288236bf31941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Feb 9, 2025.

Transparency log

Security for ichingpy 0.1.10

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ichingpy-0.1.10.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 Feb 9, 2025.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page