Giter VIP home page Giter VIP logo

kentang2017 / kinqimen Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 20.0 1.06 MB

A Python package of Qimendunjia, one of the three greatest Ancient Chinese Divination Tools ever. Python 奇門遁甲,占卜用,運籌帷幄。包含金函玉鏡日家奇門、拆補置閏時家奇門、刻家奇門排盤。

Home Page: https://pypi.org/project/kinqimen

Python 100.00%
divination prediction python qimen

kinqimen's Introduction

GitHub Stats

Below are my divination tools written in Python: image image image image image image image

if you have any questions, please feel free to contact me.(wechat id:gnatnek or Telegram id: glunyum )

kinqimen's People

Contributors

kentang2017 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kinqimen's Issues

Can you please update the use sample?

Dear Mr. Tang,

Hope you're very well.

Can you please consider to update the use sample on pypi and github?

  1. On https://pypi.org/project/kinqimen/, "3. 起課方式 Quickstart"

    from kinqimen import kinqimen
    kinqimen.Qimen(year, month, day, hour).pan()

When runs it with version 0.0.6.5. I have error:

TypeError: __init__() missing 1 required positional argument: 'minute'.
  1. On github, it gives "3. 起課方式 Quickstart"

    from kinqimen import kinqimen
    kinqimen.Qimen(year, month, day, hour).pan(1) # 1:拆補 2:置閏

When runs it with version 0.0.6.5. I have error:

TypeError: __init__() missing 1 required positional argument: 'minute'

When tried "kinqimen.Qimen(2021,12,13,19,15).pan(1)", I have error:

TypeError: pan() takes 1 positional argument but 2 were given

When tried,

qimen = kinqimen.Qimen(2023,12,13,19,26)
print (qimen)

It gives "<kinqimen.kinqimen.Qimen object at 0x000001935072EC40>" only.

Thank you!

ModuleNotFoundError: No module named 'config'

Great to see the latest update on 09th March 2021!

But when I tried to run it (latest version with PIP install), shows:

Traceback (most recent call last):
  File "C:\My Documents\Scripts\Kin Qimen.py", line 1, in <module>
    from kinqimen import kinqimen
  File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 6, in <module>
    from config import *
ModuleNotFoundError: No module named 'config'

I tried added lines but it doesn't help:

import sys
sys.path.append('C:\\Python38\\Lib\\site-packages\\kinqimen\\config.py')
import config

I also tried (uninstalled the current version and install) older version:
pip install kinqimen==0.0.2.7

But it still pops the same error, which I didn't encountered before.

Can you please have a look? Thank you!

Dates in June, TypeError: 'NoneType' object is not iterable`

Hi Mr. Tang,

An error pops when date and time "2021,6,21,15" is used. (no error if it changed to May or July)

Can you please have a look? Thank you!

from kinqimen import kinqimen
qimen = kinqimen.Qimen(2021,6,21,15).pan()
print (qimen)

It gives error:

Traceback (most recent call last): File "C:\My Documents\Scripts\good.py", line 5, in <module> qimen = kinqimen.Qimen(2021,6,21,15).pan() File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 18, in __init__ self.g = self.gpan() File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 212, in gpan gong = dict(zip(start_jia, start_gong)).get(shun) TypeError: 'NoneType' object is not iterable

长生运天盘缺宫

好:
发现长生运天盘存在缺宫,貌似每次都少一宫。
参数 (2016,5,2,20) 天盘缺坎宫
参数(2015,7,20,10) 天盘缺中宫

天盘字典数据问题

kinqimen.Qimen(2016,5,2,20).pan()

'天盤': [{'坤': '戊', '震': '己', '巽': '庚', '中': '辛', '乾': '壬', '兌': '癸', '艮': '丁', '離': '丙', '坎': '乙'}, {'戊': '坤', '己': '震', '庚': '巽', '辛': '中', '壬': '乾', '癸': '兌', '丁': '艮', '丙': '離', '乙': '坎'}, ['乙', '丁', '己', '庚', '丙', '戊', '癸', '壬']],

貌似哪里有问题

关于日家奇门

def gpan(self):

函数下的:

        for i in eight_gua2:
            c = dict(zip(new_list(f.get(yy), i), door_r))
            g.append(c)
        e = itertools.cycle(g)
        door = multi_key_dict_get(dict(zip(b, e)), dgz)

image

是这样迭代的不?

`ImportError: cannot import name 'Qimen'

Hi Mr. Tang,

Hope you are very well! :)

When I tried:
from kinqimen import Qimen

It gives:

ImportError: cannot import name 'Qimen' from 'kinqimen' (C:\Python38\lib\site-packages\kinqimen\__init__.py)

Can you please have a look? Thank you.

运行效率异常

RS = Qimen(2016,5,2,20).pan()

版本:0.0.5.0 耗时约0.5s
版本:0.0.5.6 耗时约2.5s

(2021, 12, 13, 18) '天盤' missing 乙

Good day, Mr. Tang:

Hope you are very well!

Can you please look at the output of timing (2021, 12, 13, 18)?

日干 and 时干 both are 乙。

But in the result '天盤': {'坤': '庚', '離': '壬', '巽': '戊', '震': '己', '艮': '癸', '坎': '辛', '乾': '丙', '兌': '丁'}, there's no 乙。

Thank you!

'長生運': '天盤': None

Hello Mr. Tang,

Hope you're very well!

When using kinqimen 0.0.6.3, it gives some None for '長生運': '天盤'.

Can you please have a look? Thank you.

qimen = kinqimen.Qimen(2022,6,30,9).pan()


{'干支': '壬寅年丙午月甲寅日己巳時', '旬首': '癸', '旬空': {'日空': '子丑', '時空': '戌亥'}, '局日': '甲己日', '排局': '陰遁三局中元', '節氣': '夏至', '值符值使': {'值符星宮': ['沖', '坤'], '值使門宮': ['傷', '兌']}, '天乙': '芮', '天盤': {'坤': '戊', '離': '壬', '巽': '庚', '震': '丁', '艮': '癸', '坎': '己', '乾': '辛', '兌': '乙', '中': '丙'}, '地盤': {'震': '戊', '巽': '乙', '中': '丙', '乾': '丁', '兌': '癸', '艮': '壬', '離': '辛', '坎': '庚', '坤': '己'}, '門': {'兌': '傷', '坤': '生', '離': '休', '巽': '開', '震': '驚', '艮': '死', '坎': '景', '乾': '杜'}, '星': {'坤': '沖', '離': '任', '巽': '蓬', '震': '心', '艮': '柱', '坎': '禽', '乾': '英', '兌': '輔'}, '神': {'坤': '符', '離': '蛇', '巽': '陰', '震': '合', '艮': '虎', '坎': '玄', '乾': '地', '兌': '天'}, '馬星': {'天馬': '午', '丁馬': '巳', '驛馬': '亥'}, '長生運': {'天盤': {'坤': {'戊': None}, '離': {'壬': None}, '巽': {'庚': None}, '震': {'丁': None}, '艮': {'癸': None}, '坎': {'己': None}, '乾': {'辛': None}, '兌': {'乙': None}}, '地盤': {'震': {'戊': '養'}, '巽': {'乙': '帝旺'}, '中': {'丙': '病'}, '乾': {'丁': '死'}, '兌': {'癸': '沐浴'}, '艮': {'壬': '長生'}, '離': {'辛': '胎'}, '坎': {'庚': '絕'}, '坤': {'己': '墓'}}}}

置潤法與拆補法得到的奇門局一樣

置潤法和拆補法在多數情況下是一致的,但在有些特殊日期不同,舉例:
2004年9月1日中午12點,通過拆補法應該使用處暑節氣上元,即隱遁一局,但使用置潤法應該使用白露節氣上元,即隱遁九局。
但是程序執行的結果卻是一樣。

我看了源碼,应该是在config.py的qimen_ju_name_zhirun方法最后,无论什么条件,都 return "{}{}局{}".format(find_yingyang, kooks, three_yuen),导致。

05 May 14:00 is 壬辰月 instead of 癸巳月

Hi Mr. Tang, hope you are very well.

Today when I am using kinqimen (time 2021 May 05, 14:00, it gives me:
干支 辛丑年癸巳月癸丑日己未時

But seems the time is:
辛丑年 壬辰月 癸丑日 己未时 

Can you please have a look?

Thank you.

2021/2/16 2:33 这个时间貌似生成错误的结果

你好,十分感谢您写的这个模块,可以麻烦看一下2021/2/16 2:33这个时间的时家排盘吗,
得出的结果是
巽宫:天盘干和地盘干都是癸,但实际上的结果应该是 天盘干:壬,地盘干:癸

这个时间的其他宫也是同样的问题

To add “暗干” and "暗神"

Hi Mr. Tang,

It's been some time. Hope all's well with you. :)

Would you consider to add “暗干” and "暗神" to each "宫"?

ValueError: None is not in list, for (2022,2,9,23)

Dear Mr. Tang,

Sorry to trouble you again.

It pops ValueError: None is not in list, when using kinqimen for (2022,2,9,23).

Can you please have a look? Thank you!

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-4-8de370ffa6bb>](https://localhost:8080/#) in <module>()
  1 from kinqimen import kinqimen
  2 
----> 3 qimen = kinqimen.Qimen(2022,2,9,23).pan()
  4 
  5 print (qimen)

2 frames
[/usr/local/lib/python3.7/dist-packages/kinqimen/config.py](https://localhost:8080/#) in new_list(olist, o)
 24 
 25 def new_list(olist, o):
---> 26     zhihead_code = olist.index(o)
 27     res1 = []
 28     for i in range(len(olist)):

ValueError: None is not in list

TypeError: __init__() missing 1 required positional argument: 'minute'

Good day, Mr. Tang:

How have you been? Hope you are very well!

Version 0.0.6.5 pops "TypeError: init() missing 1 required positional argument: 'minute'" from below line:

qimen = kinqimen.Qimen(2022,6,30,9).pan()

Version 0.0.6.4 works totally fine. Can you please take a look?

Thank you!

(2021,12,30,18) - AttributeError: 'tuple' object has no attribute 'keys'`

Good day Mr Tang,

In using the kinqimen, I have below error popup.

Can you please have a look? Thank you.

qimen = kinqimen.Qimen(2021,12,30,18).pan()

sxtwl 2.0.6

kinqimen 0.0.6.1

Traceback (most recent call last): File "C:\My Documents\Scripts\Qimen 1.py", line 17, in <module> qimen = kinqimen.Qimen(2021,12,30,18).pan() File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 258, in pan return {"干支":self.gangzhi()[0]+"年"+self.gangzhi()[1]+"月"+self.gangzhi()[2]+"日"+self.gangzhi()[3]+"時","旬首":self.shun(self.gangzhi()[2]),"旬空":self.daykong_shikong(),"局日":self.qimen_ju_day(), "排局":self.qimen_ju_name(), "節氣":self.find_jieqi(), "值符值使":self.zhifu_n_zhishi(), "天乙":self.tianyi(), "天盤":self.pan_sky(), "地盤":self.pan_earth(), "門":self.pan_door(),"星":self.pan_star()[0], "神":self.pan_god(), "馬星": {"天馬": self.moonhorse(),"丁馬":self.dinhorse(), "驛馬":self.hourhorse()}, "長生運": self.gong_chengsun()} File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 252, in gong_chengsun sky_pan_new = dict(zip(sky_pan.keys(),[{list(sky_pan.values())[y]: [find_twelve_luck_new.get(i) for i in sky_pan.values()][y]} for y in range(0,8)])) AttributeError: 'tuple' object has no attribute 'keys'

ModuleNotFoundError: No module named 'config' Python3

Python version: Python 3.11.4

test code:
from kinqimen import kinqimen kinqimen.Qimen(2024, 3, 27, 16,50).pan()

error:
Traceback (most recent call last): File "/Users/jeff/Documents/GitHub/qimendunjia/qmdj.py", line 1, in <module> from kinqimen.kinqimen import Qimen ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/kinqimen/kinqimen.py", line 9, in <module> import config ModuleNotFoundError: No module named 'config'

看了下您的source code, 是引用了同个directory下的config.py. 请问是否不支持 Python3

谢谢

0.0.4.0, ValueError: None is not in list

Dear Mr. Tang,

When installed the 0.0.4.0 version, it gives error for some days.

For example, no problem for 15th April 2021, but error pops if the date is 16th April onward. It's back to ok until 06th May 2021.

Can you please have a look? Thank you.

Traceback (most recent call last):

File "C:\My Documents\Scripts\Qimen.py", line 4, in <module>

qimen = kinqimen.Qimen(2021, 4, 16, 9).pan()

File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 18, in __init__

self.g = self.gpan()

File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 224, in gpan

c_gong = new_list(eight_gua, gong)

File "C:\Python38\lib\site-packages\kinqimen\config.py", line 26, in new_list

zhihead_code = olist.index(o)

ValueError: None is not in list

日干 missing when 寄宫

@kentang2017 So sorry to trouble you again for another question.

In case when the 日干 is 寄宫, it seems it is missing.

For example, 2021年3月9日9时, 日干 丙 falls in 巽宫. When the result is printed, 巽宫 is not showing the 日干 丙:

干支 辛丑年辛卯月丙辰日癸巳時
天盤 {'震': '庚', '巽': '壬', '離': '戊', '坤': '乙', '兌': '辛', '乾': '己', '坎': '癸', '艮': '丁'}

Can you please have a look? Thank you.

2021年3月9日9时20分26秒

An example with actual data and time, please

Dear author!

Thank you for your work and sharing on this Qimen library?

Can you please give an example?

I've tried below but both of them gave erros:

kinqimen.Qimen(2021, 3, 5, 11).pan()
# TypeError: 'NoneType' object is not subscriptable

kinqimen.Qimen("2021", "3", "5", "11:00").pan()
# TypeError: in method 'Lunar_getDayBySolar', argument 2 of type 'int'

Thanks again.

请问天干地支的旺衰计算是否有错误?

比如是2021, 12, 1, 14起盘。
您的程序的结果是:

{'干支': '辛丑年己亥月癸未日己未時', '旬首': '己', '旬空': {'日空': '申酉', '時空': '子丑'}, '局日': '戊癸日', '排局': '陰遁五局上元', '節氣': '小雪', '值符值使': {'值符星宮': ['英', '巽'], '值使門宮': ['景', '巽']}, '天乙': '輔', '天盤': [{'巽': '癸', '震': '己', '艮': '庚', '坎': '丁', '乾': '壬', '兌': '乙', '坤': '丙', '離': '辛'}, {'離': '戊'}], '地盤': {'中': '戊', '乾': '乙', '兌': '丙', '艮': '丁', '離': '癸', '坎': '壬', '坤': '辛', '震': '庚', '巽': '己'}, '門': {'巽': '景', '震': '杜', '艮': '傷', '坎': '生', '乾': '休', '兌': '開', '坤': '驚', '離': '死'}, '星': {'巽': '英', '震': '輔', '艮': '沖', '坎': '任', '乾': '蓬', '兌': '心', '坤': '柱', '離': '禽'}, '神': {'巽': '符', '震': '蛇', '艮': '陰', '坎': '合', '乾': '虎', '兌': '玄', '坤': '地', '離': '天'}, '馬星': {'天馬': '辰', '丁馬': '丑', '驛馬': '巳'}, '長生運': {'天盤': {'巽': {'癸': '臨冠'}, '震': {'己': '墓'}, '艮': {'庚': '死'}, '坎': {'丁': '絕'}, '乾': {'壬': '帝旺'}, '兌': {'乙': '長生'}, '坤': {'丙': '胎'}, '離': {'辛': '病'}}, '地盤': {'中': {'戊': '養'}, '乾': {'乙': '長生'}, '兌': {'丙': '胎'}, '艮': {'丁': '絕'}, '離': {'癸': '臨冠'}, '坎': {'壬': '帝旺'}, '坤': {'辛': '病'}, '震': {'庚': '死'}, '巽': {'己': '墓'}}}}

其中4宫,五阴干之一,落4宫辰巳,应为养胎。您的是临冠

image

Kinqimen.py

Hi,

In kinqimen.py

line 115
what is cnumber_order2 ?

line 118
return dict(zip(rgong_reorder, rgan_reorder)), dict(zip(rgan_reorder, rgong_reorder)), gan_reorder

is it correct ?

值符中五转乾二天盘出错

kinqimen.Qimen(2016,12,2,17).pan()

'天盤': ({'艮': '戊', '離': '乙', '坎': '丙', '坤': '丁', '震': '癸', '巽': '壬', '中': '辛', '乾': '庚', '兌': '己'}, [{'坤': '癸'}]),
微信图片_20220323163103

正确的排盘结果如下:

微信图片编辑_20220323151618

0.0.6.0 seems missing 天盘寄宫。

Dear Mr. Tang,

New version 0.0.6.0 seems missing the information of 天盘寄宫。

When using kinqimen-0.0.5.0 for (2022,3,28,12), it gives:
'天盤': [{'兌': '己', '乾': '丁', '坎': '乙', '艮': '壬', '震': '辛', '巽': '丙', '離': '癸', '坤': '戊'}, {'坎': '庚'}]

With kinqimen-0.0.6.0 for (2022,3,28,12), the second part {'坎': '庚'} is missing.
'天盤': {'兌': '己', '乾': '丁', '坎': '乙', '艮': '壬', '震': '辛', '巽': '丙', '離': '癸', '坤': '戊', '中': '庚'},

Can you please consider to add it back?

Thank you.

Version 0.0.4.5, ValueError: '辛' is not in list

Happy new year to you, Mr. Tang!

Thank you for the update of kinqimen.

I've just updated it to kinqimen 0.0.4.5, when running for 2022, Feb , 7th, 11 o'clock, it pops error:

Traceback (most recent call last):
File "C:\My Documents\Scripts\Qimen 1.py", line 179, in <module>
qimen = kinqimen.Qimen(2022,2,7,11).pan()
File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 209, in pan
return {"干支":self.gangzhi()[0]+"年"+self.gangzhi()[1]+"月"+self.gangzhi()[2]+"日"+self.gangzhi()[3]+"時","旬首":self.shun(self.gangzhi()[2]),"旬空":self.daykong_shikong(),"局日":self.qimen_ju_day(), "排局":self.qimen_ju_name(), "節氣":self.find_jieqi(), "值符值使":self.zhifu_n_zhishi(), "天乙":self.tianyi(), "天盤":self.pan_sky(), "地盤":self.pan_earth()[0], "門":self.pan_door(),"星":self.pan_star()[0], "神":self.pan_god(), "馬星": {"天馬": self.moonhorse(),"丁馬":self.dinhorse(), "驛馬":self.hourhorse()}, "長生運": self.gong_chengsun()}
File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 107, in pan_sky
gan_reorder = new_list([self.pan_earth()[0].get(i) for i in list(rotate)], fu_head)
File "C:\Python38\lib\site-packages\kinqimen\config.py", line 26, in new_list
zhihead_code = olist.index(o)
ValueError: '辛' is not in list`

Can you please have a look? Thank you!

fu_head, TypeError: 'NoneType' object is not subscriptable`

Good morning Mr Tang,

Hope you are very well.

In using the kinqimen, I have below error popup.

Can you please have a look? Thank you.

qimen = kinqimen.Qimen(2022,11,11,18).pan()

# sxtwl 2.0.6
# kinqimen 0.0.6.0

Traceback (most recent call last): File "C:\My Documents\Scripts\Qimen 1.py", line 179, in <module> qimen = kinqimen.Qimen(2022,11,11,18).pan() File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 258, in pan return {"干支":self.gangzhi()[0]+"年"+self.gangzhi()[1]+"月"+self.gangzhi()[2]+"日"+self.gangzhi()[3]+"時","旬首":self.shun(self.gangzhi()[2]),"旬空":self.daykong_shikong(),"局日":self.qimen_ju_day(), "排局":self.qimen_ju_name(), "節氣":self.find_jieqi(), "值符值使":self.zhifu_n_zhishi(), "天乙":self.tianyi(), "天盤":self.pan_sky(), "地盤":self.pan_earth(), "門":self.pan_door(),"星":self.pan_star()[0], "神":self.pan_god(), "馬星": {"天馬": self.moonhorse(),"丁馬":self.dinhorse(), "驛馬":self.hourhorse()}, "長生運": self.gong_chengsun()} File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 156, in pan_sky fu_head = self.hourganghzi_zhifu()[2] TypeError: 'NoneType' object is not subscriptable

奇儀落宮的十二狀態

@kentang2017 Mr. Tang, I am not sure if it's proper, but please just allow me to put it down (if not, please let me know and I will delete this Issue)

Many Qimen software does not show 奇儀落宮的十二狀態,即:長生、沐浴、冠帶.....

Is it possible that you can consider to add in this information that KinQiMen can display them accordingly?

For example, 2021年 03 月 09日 09時,坎宮內有 癸 有 辛。辛在坎宮為 長生。癸在坎宮為 臨官,如此類推。

Thank you!

list consistency ?

Hi,

Thanks for library, I'm wondering if those lists are correct - 10 items and one duplicate value:

newgtw_order = re.findall("..","地籥天關唐符風雲唐符風雲雷公風伯天曹五符")
唐符 is duplicate

which is inconsistent with this one - 12 items no duplicate values
gtw = re.findall("..","地籥六賊五符天曹地符風伯雷公雨師風雲唐符國印天關")

looking forward reading from you.

遁 and 局

Thanks for your script

I am using the below date and time.
hour = 18
day = 30
month = 12
year = 2021

(時家奇門)

Qimen(year, month, day, hour).p

{'干支': '辛丑年庚子月壬子日己酉時',
'旬首': '壬',
'旬空': {'日空': '寅卯', '時空': '寅卯'},
'局日': '丁壬日',
'排局': '陰遁四局上元',
'節氣': '大雪'

It should be 陽遁一局.

Please advise me, if I am wrong.

Re: 六仪击刑,入墓,伏吟、天显时格、五不遇时、宫迫

Hey, guys,

我添加了六仪击刑,入墓,伏吟、天显时格、五不遇时、宫迫等功能,请review下,看是否能合并到你的代码中,我的代码如下,在kinqimen.py中:

    #六仪擊刑 
    def jixing(self, sky):
        jixing_mapping = {"庚":"艮","戊":"震","癸":"巽","壬":"巽","辛":"离","己":"坤"}
        result = {}
        for gong, gan in sky.items():
            if gan in jixing_mapping and gong == jixing_mapping[gan]:
                result[gan] = gong
        return result

		#入墓
    def rumu(self, sky, earth):
        rumu_mapping = {"乙":"坤","癸":"坤","乙":"乾","丙":"乾","戊":"乾","辛":"巽","壬":"巽","丁":"艮","己":"艮","庚":"艮"}
        result = {}
        for gong, gan in sky.items():
            if gan in rumu_mapping and gong == rumu_mapping[gan]:
                result[gan] = gong
        for gong, gan in earth.items():
            if gan in rumu_mapping and gong == rumu_mapping[gan]:
                result[gan] = gong
        return result

    # 伏吟    
    def fuying(self, star, door):
        result = {}
        if door['坎'] == '休':
            result['门伏吟'] = 1
        elif door['坎'] == '景':
            result['门反伏吟'] = 1

        if star['坎'] == '蓬':
            result['星伏吟'] = 1
        elif star['坎'] == '英':
            result['星反伏吟'] = 1
        
        return result
        
    # 天显时格
    def tianxian(self, gz):
      ri = gz[2]
      shi = gz[3]
      mapping = {'甲':['甲子','甲戌'],'乙':['甲申'],'丙':['甲午'],'丁':['甲辰'],'戊':['甲寅'],'己':['甲子','甲戌'],'庚':['甲申'],'辛':['甲午'],'壬':['甲辰'],'癸':['甲寅']}
      if shi in mapping[ri[0]]:
        return 1
      else:
        return 0

    # 五不遇时
    def wubuyushi(self, gz):
      ri = gz[2]
      shi = gz[3]
      mapping = {'甲':'庚午','乙':'辛巳','丙':'壬辰','丁':'癸卯','戊':'甲寅','己':'乙丑','庚':'丙子','辛':'丁酉','壬':'戊申','癸':'己未'}
      if mapping[ri[0]] == shi:
        return 1
      else:
        return 0
    
    # 宫迫 
    def gongpo(self, doors):
      gongpo = {}
      menpo = {}
      for gong, door in doors.items():
        doorWuxing = config.doorWuxing[door]
        gongWuxing = config.gongWuxing[gong]
        # print(gong, door, gongWuxing, doorWuxing)
        if doorWuxing[1] == gongWuxing[0]:
          gongpo[gong] = door
        if gongWuxing[1] == doorWuxing[0]:
          menpo[gong] = door
      return {"宫迫": gongpo, "门迫": menpo}
      

AttributeError: module 'config' has no attribute 'gangzhi'

Hi Mr, Tang!

I downloaded the code from the github page, and tried it:

kinqimen.Qimen(2022,12,13,19,26).pan(1)

print (qimen)

It prints out:

AttributeError: module 'config' has no attribute 'gangzhi'

Can you please enlighten me the right use? Thank you.

Adding 馬星 and 旬空

Thanks author Mr. Tang's effort and sharing of such a good tool!

Is it possible to add on below information:

  1. 馬星
  2. 旬空(年月日時 空)

Thanks again!

TypeError: zip argument #2 must support iteration

Good morning Mr. Tang!

An error pops when using Kinqimen 0.0.4.6 (with sxtwl 2.0.4) for 2021 July 05th 18:00.

Can you please have a look?

Thank you!

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-6-020c97746880>](https://localhost:8080/#) in <module>()
  1 from kinqimen import kinqimen
  2 
----> 3 qimen = kinqimen.Qimen(2021,7,5,18).pan()
  4 
  5 print (qimen)

1 frames
[/usr/local/lib/python3.7/dist-packages/kinqimen/kinqimen.py](https://localhost:8080/#) in gpan(self)
246         start_gong = start_gong_d.get(multi_key_dict_get({tuple(jieqi_all[0:12]):"冬至", tuple(jieqi_all[13:24]):"夏至"}, self.find_jieqi()))
247         yy = yy_dun.get(multi_key_dict_get({tuple(jieqi_all[0:12]):"冬至", tuple(jieqi_all[13:24]):"夏至"}, self.find_jieqi()))
--> 248         gong = dict(zip(start_jia, start_gong)).get(shun)
249         triple_list = list(map(lambda x: x + x + x, list(range(0,21))))
250         b = []

TypeError: zip argument #2 must support iteration

config.py的疑问

请问
cnum_dict = dict(zip(cnumber_order, range(1,9)))
是正确的吗?

还是说应该是
cnum_dict = dict(zip(cnumber_order, range(1,10)))

Version 0.0.5.0, ModuleNotFoundError: No module named 'ephem'

Good day Mr. Tang,

When upgraded to kinqimen 0.0.5.0, running the program it pops an error says "ModuleNotFoundError: No module named 'ephem'" .

Can you please have a look? Thank you.

Traceback (most recent call last):
  File "C:\My Documents\Qimen.py", line 1, in <module>
    from kinqimen import kinqimen
  File "C:\Python38\lib\site-packages\kinqimen\kinqimen.py", line 6, in <module>
    from kinqimen.config import *
  File "C:\Python38\lib\site-packages\kinqimen\config.py", line 8, in <module>
    from ephem import *
ModuleNotFoundError: No module named 'ephem'

Allocation of '神', version 0.0.5.0

Hi Mr. Tang,

By using kinqimen 0.0.5.0, for 2005年01月19日23时, it gives '神': {'艮': '符', '震': '蛇'...

But it seems '蛇' should be at '兑'.

Can you please have a look? Thank you.

请问鹤神的计算是否有错误

    # 鶴神
    def crane_god(self):
        newjz = new_list(jiazi(), "庚申")
        crane_nums = [6, 5, 6, 5, 6, 5, 16, 6, 5]
        crane_list = list("巽離坤兌乾坎天艮震")
        newc_list = []
        for i in range(0, 8):
            newc = [crane_list[i][:5]]*crane_nums[i]
            print(crane_list[i][:5], crane_nums[i])
            newc_list.extend(newc)
        
        return dict(zip(newjz, newc_list))

for i in range(0, 8):是否应该是for i in range(0, 9):
不然这里少了一个,比如这个少了
image

def zhifu_pai(self) 错了吗?

请问
def zhifu_pai(self)
错了吗?
有重复的数字。

{'甲子': '五六七八五四三二一九', '甲戌': '四六七八五四三二一九', '甲申': '三六七八五四三二一九', '甲午': '二六七八五四三二一九', '甲辰': '一六七八五四三二一九', '甲寅': '九六七八五四三二一九'}

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.