It's used to obtain the data of The Purple Star Astrology (Zi Wei Dou Shu)
.
-
Input
- birthday(support solar date and lunar date)
- birth time
- gender
-
Feature list
- get
12 palaces
data of Zi Wei Dou Shu. - get Chinese
zodiac
- get
sign
- get birth time by Chinese date
- get
horoscope
(decadal
,turnly
,yearly
,monthly
,daily
,timely
) - get horoscope
stars
(dacadal
andyearly
) - check if one
palace
includes specificstars
- check if
surrounded palaces
of specificpalace
include specificstars
- check if
surrounded palaces
of specificpalace
include specificmutagen
- check if spedific star is
mutaged
- check if
surrounded palaces
of specificstar
include specificmutagen
- check star
brightness
- get
mutagen
byheavenly stem
- get
palace
bystar
- get
surrounded palaces
bypalace
- get
surrounded palaces
bystar
- get
opposite
palace bystar
- get
-
Other
-
multilingual input/output
you can mix multiple languages when passing parameters and specify output language. we support Simplified Chinese, Traditional Chinese, English, Japanese, Korean and Vietnamese. however, English translation is not stardand. so I just translate them by meaning. if you're good at English and well known about Zi Wei Dou Shu, welcome to PR. any language is welcome.
-
chain invoking
if you want to check if the
surrounded palaces
ofemperor
isfocused
, you can do it like this:import { astro } from 'iztro'; const astrolabe = astro.bySolar('2000-8-16', 2, 'male', true, 'en-US'); astrolabe.star('emperor').surroundedPalaces().haveMutagen('focused');
-
Configuration and plugins
There are many Ziwei Dou Shu genres, and the mutagens and star brightness of different genres will be slightly different. In order to meet the needs of different genres and function expansion, iztro has added global configuration and third-party plug-in functions in version v2.3.0. For details, see Configuration Document
-
you can choose any package manager to install iztro
.
-
NPM
npm install iztro -S
-
Yarn
yarn add iztro
-
pnpm
pnpm install iztro -S
This is a very simple example to show how to use iztro
to get the astrolabe data. please visit develop document for details.
-
ES6 Module
import { astro } from 'iztro'; // get astrolabe data by solar date const astrolabe = astro.bySolar('2000-8-16', 2, 'male', true, 'en-US'); // get astrolabe data by lunar date const astrolabe = astro.byLunar('2000-7-17', 2, 'male', false, true, 'en-US');
-
CommonJS
var iztro = require('iztro'); // get astrolabe data by solar date var astrolabe = iztro.astro.bySolar('2000-8-16', 2, 'male', true, 'en-US'); // get astrolabe data by lunar date var astrolabe = iztro.astro.byLunar('2000-7-17', 2, 'male', false, true, 'en-US');
If you're interested in iztro
and wish to join us,it's very welcome. You can contribute by:
- create an issue here if you have any good ideas or suggestions.
- report a bug here if you found any bugs.
- you can also
fork
this code to your repository and create PRs for your changes. - also, you can contribute the
localization
files. please refer to locales and create the localization files for your lanuage. - additionally, buy me a coffee is another great way to support me
You can generate an astrolabe by using the returned data. Of course it's just an example. You can focus on astrolabe design or data analyzation. This program solves the most tedious work for you, so that you can put more energy on the things you need to pay attention to.
MIT License
Copyright © 2023 All Contributors