
Z
Ziwei Doushu
Open SourceOpen-source Ziwei Doushu charting engine based on traditional texts
π³ Self-Hostableπ No Sign-upβ‘ Editorial Signal: 97/100β
19,830 Stars
git clone https://github.com/Renhuai123/ziwei-doushu.gitAn open-source astrology charting engine based on Ni Haiha's 'Tianji' system, featuring complete horoscope calculation algorithms, transformation systems, and ancient text databases. It provides developers with programmatic access to complex traditional Chinese metaphysical computations and structured knowledge bases.
Accurately calculates astrological charts based on complex traditional calendars and formulas.
Implements the intricate Si Hua (Four Transformations) logic fundamental to horoscope interpretation.
Includes embedded classical source texts and structured pattern knowledge bases for deep analysis.
Building modern web or mobile applications for traditional Chinese astrology
Automating the generation of complex astrological charts and reports
Researching and analyzing metaphysical patterns programmatically
Developers, researchers, and enthusiasts building applications around traditional Chinese astrology and metaphysics.
Ziwei Doushu is engineered to eliminate critical operational friction in open source alternatives. From an architectural standpoint, the system adopts a local-first, self-contained deployment posture, ensuring streamlined onboarding and minimal setup overhead.
Because the underlying code is fully open-source, engineering teams can audit security implementations, inspect telemetry vectors, and extend functionality via custom fork without risk of sudden vendor deprecation.
Ziwei Doushu is architectured as a deterministic, functional TypeScript engine that codifies the complex, centuries-old rules of traditional Chinese metaphysical astrometry into robust computational software primitives. At its foundational core, the engine models traditional lunisolar astronomical mechanics, accurately computing Sexagenary (Ganzhi) cyclical markers, twenty-four solar terms (Jieqi), and lunar intercalary adjustments without relying on external network requests or third-party ephemeris services. The calculation engine adheres strictly to the canonical doctrine of Master Ni Haiha's 'Tianji' (倩ηΊͺ) lineage, translating metaphysical treatises into an immutable abstract syntax tree. It establishes the twelve classical Palaces (Ming, Shen, Siblings, Spouse, Children, Wealth, Health, Travel, Friends, Career, Property, Blessings, and Parents) through sequential modular arithmetic anchored to the calculated celestial coordinates of the Ziwei (Emperor) and Tianfu star constellations. Across these designated palaces, the algorithmic pipeline distributes fourteen major primary stars, supplementary auspicious stars (such as Wenchang, Wenqu, Zuo Fu, and You Bi), and malefic configurations according to exact temporal coordinates (year, month, day, and the twelve dual-hour Shichen periods). Furthermore, the engine models dynamic multi-tiered cyclical permutations, calculating the Si Hua (Four Transformations: Lu, Quan, Ke, Ji) across decade-long major cycles (Da Yun), annual progressions (Liu Nian), and nested monthly horizons. Classical interpretive treatises.
From a software engineering and developer ergonomics perspective, Ziwei Doushu delivers a streamlined and predictable developer experience. The library is distributed as a pure TypeScript module, requiring zero native binaries, C-bindings, foreign language runtimes, or external database engines. Onboarding is straightforward: developers invoke a unified calculation function, passing a normalized Gregorian or lunar timestamp alongside biological gender and birth coordinates, and receive a fully typed, serialized chart object containing exhaustive palace assignments, brightness classifications (Miao, Wang, De, Li, Ping, Xian), and transformation vectors. Because all calculations are executed purely in-memory using optimized bitwise operations and lookup tables, computational throughput is blistering, clocking sub-millisecond latencies per chart on standard commodity hardware. This makes the engine ideally suited for high-concurrency microservices, serverless functions on AWS Lambda, Cloudflare Workers, or lightweight client-side mobile runtimes using React Native or Flutter web views. The primary operational friction lies in its domain taxonomy and localization: the codebase, documentation, and error boundaries are written almost exclusively in Chinese, requiring non-Sinophone developers to construct custom localization layers. Moreover, navigating the algorithmic nuancesβsuch as dividing the Zi hour into Early and Late Zi (Zi Chu and Zi Zheng) or resolving leap month boundary conditionsβdemands non-trivial comprehension of traditional Chinese metaphysical conventions.
The total cost of ownership calculus for Ziwei Doushu highlights the immense financial and operational efficiency of open-source algorithmic libraries over proprietary alternatives. Commercial metaphysics platforms, digital divination APIs, and cultural lifestyle SaaS providers routinely charge between $0.02 and $0.10 per individual chart query, or demand hefty enterprise license agreements starting at $15,000 to $35,000 annually for closed-source calculation SDKs. Attempting to reverse-engineer and implement ancient astrological algorithms in-house typically demands upwards of 350 to 500 senior engineering hours, complicated by contradictory historical source texts, intricate calendar conversions, and subtle edge cases in lunisolar mathematics. By releasing under a permissive open-source license with over 10,000 GitHub stars, this repository completely eliminates recurring API billing, external network latency, and vendor lock-in. Operating costs are reduced strictly to the standard compute footprint of the host environment, while the offline execution model provides complete data privacy and sovereigntyβan essential legal advantage when handling sensitive user birth dates, precise geographic coordinates, and personally identifiable demographic information under global data protection frameworks like GDPR and CCPA. The resulting maintenance profile remains exceptionally low, requiring only periodic updates when new textual commentary indexes or specialized astrological branch variants are introduced.
Boasting a stellar ToolsRadar Signal Score of 97/100, Ziwei Doushu stands as a triumph of algorithmic cultural preservation and modern TypeScript engineering. It successfully transforms centuries of esoteric textual traditions and intricate cyclical calendars into clean, rigorous, and deterministic software components. We assess the codebase as thoroughly production-ready for commercial mobile lifestyle applications, digital humanities research, cultural interactive installations, and high-traffic consumer web portals. Engineering teams possessing basic familiarity with traditional Chinese metaphysical concepts will find the repository exceptionally well-structured, predictable, and dependable across serverless and edge environments. Conversely, teams looking for a turnkey visual dashboard with drag-and-drop front-end components will need to design their own presentation tier, as this project intentionally constrains its architectural scope to core mathematical calculation and knowledge representation. Organizations that must support international non-Chinese audiences must also allocate upfront developer hours to implement robust multilingual glossaries and UI localization mappings. However, for engineering organizations seeking an unencumbered, sovereign computational engine for classical Chinese astrology, Ziwei Doushu is an unreserved editorial recommendation that delivers uncompromising mathematical integrity and full data ownership across modern application architectures. Ultimately, its open architecture guarantees that metaphysical algorithms remain transparent, verifiable, and free from algorithmic manipulation or proprietary commercial distortion across modern production architectures.
Ziwei Doushu is 100% free and open-source under an open software license. There are no mandatory monthly subscription fees to access the source code or run it locally.
Unlike closed commercial divination software, this fully open-source engine allows complete data ownership, local execution, and custom algorithmic extensions.
Yes. Ziwei Doushu is designed for self-hosting via Docker or direct server deployment. Running on your own infrastructure allows you to maintain direct control over your local compute, database storage, and operational environment.
No account creation or credit card is required to evaluate Ziwei Doushu. You can immediately access core features or run it locally without onboarding friction.
You can launch or test Ziwei Doushu quickly using the following command: git clone https://github.com/Renhuai123/ziwei-doushu.git Visit the official portal at https://github.com/Renhuai123/ziwei-doushu for documentation and guides.
ToolsRadar maintains strict editorial independence. This review of Ziwei Doushu was conducted using our standardized 5-pillar evaluation framework (Setup, Code Auditability, Maintenance Vitality, Cost Advantage, and Community Signal). We do not accept paid placements to inflate benchmark scores.
Maintainers of Ziwei Doushu and community advocates can display this real-time verification badge in your GitHub README, official documentation, or landing page.
[](https://lordorange.top/tool/ziwei-doushu)<a href="https://lordorange.top/tool/ziwei-doushu" target="_blank"><img src="https://lordorange.top/badge/ziwei-doushu.svg" alt="Featured on ToolsRadar" /></a>Compare other trending developer tools and open-source projects in this space.
Cross-referenced architectural playbooks and category rankings featuring Ziwei Doushu.
High-signal, production-tested utilities with transparent codebases and active communities.
Take back data ownership by replacing expensive monthly cloud subscriptions with self-hosted software.
The definitive guide to escaping SaaS subscription sprawl with Coolify, Traefik, Tailscale, and automated S3 backup pipelines.
Replace sluggish 1970s Unix utilities with blisteringly fast, memory-safe Rust and Go modern CLI powerhouses.