Introduction to the iztro Project
Overview
iztro is a lightweight, open-source JavaScript library designed for Zi Wei Dou Shu (紫微斗数) astrology charting. This library provides a wide range of functionalities for generating and analyzing astrology charts based on the traditional Chinese astrology method. Users can input basic data such as birthdate, time, and gender to generate comprehensive astrological data.
Features
Input Capabilities
The library accepts the following input details:
- Birthdate (in both solar and lunar calendars)
- Birth time
- Gender
Functionalities
iztro offers a comprehensive suite of tools for astrology analysis, including but not limited to:
- Generating star data for the 12 palaces of Zi Wei Dou Shu
- Determining Chinese Zodiac signs
- Identifying Western Zodiac signs
- Calculating the Four Pillars of Destiny (using the Gan-Zhi calendar)
- Analyzing fortune limits (major and minor limits, annual and monthly progression)
- Examining dynamic stars and transformations within specified palaces
- Checking for specific stars or transformations in given palace arrangements
- Identifying configurations such as empty palaces and targeted flying stars across palaces
Additional Features
- Multi-Language Support: The library can handle inputs in various languages, producing outputs in Simplified Chinese, Traditional Chinese, English, Japanese, Korean, and Vietnamese.
- Chained Calls: Allows for advanced analysis through chainable function calls in the code.
- Customization: Version 2.3.0 introduced global configuration and plugin support, accommodating various astrological schools of thought and their unique interpretations.
How to Use
To integrate iztro, users can install it using their preferred package manager:
- With NPM:
npm install iztro -S
- With Yarn:
yarn add iztro
- With pnpm:
pnpm install iztro -S
For static HTML files, iztro can be included via CDN, such as jsdelivr or unpkg, for quick deployment without needing local installation.
Example Usage
The library provides an intuitive API for generating astrology charts. Here is a simple example demonstrated in both ES6 and CommonJS:
-
ES6 Module Example:
import { astro } from 'iztro'; const astrolabe = astro.bySolar('2000-8-16', 2, 'female', true, 'zh-CN');
-
CommonJS Example:
var iztro = require('iztro'); var astrolabe = iztro.astro.bySolar('2000-8-16', 2, 'female', true, 'zh-CN');
These examples highlight the simplicity of obtaining astrological data with just a few lines of code.
Contribution and Support
The iztro project values community contributions and feedback. Users are encouraged to:
- Suggest features or improvements.
- Report any bugs found during usage.
- Contribute to internationalization efforts by translating documentation.
Contributors can fork the repository, make changes, and submit pull requests. There is also an option to support the creators via PayPal.
Conclusion
iztro simplifies the intricate process of generating and analyzing Zi Wei Dou Shu astrological charts, allowing users to focus on data interpretation and design. Through its versatility in language support and customizable configurations, iztro caters to a broad audience interested in Chinese astrology.
Star History
The project’s popularity can be tracked over time using the Star History feature, reflecting its acceptance and growth within the community.
Feel free to use iztro for any lawful applications, keeping in mind the licensing terms.