jayeshmepani/panchang-core
Composer 安装命令:
composer require jayeshmepani/panchang-core
包简介
Authentic Vedic Panchanga calculation engine powered by the JPL Moshier Ephemeris FFI wrapper
关键字:
README 文档
README
High-precision Hindu Panchang calculation engine for PHP 8.3+, powered by the JPL Moshier Ephemeris FFI wrapper.
It calculates Panchanga limbs, festivals, Muhurta windows, Karmakala timings, Chogadiya, Hora, Lagna tables, direction/Vaasa checks, eclipse visibility, and localized JSON outputs.
Highlights
- Panchanga: Tithi, Vara, Nakshatra, Yoga, Karana
- Muhurta and Karmakala: Abhijit, Brahma Muhurta, Dur Muhurta, Nishita, Vijaya, Godhuli, Pradosha, Varjyam, Amrita Kaal
- Daily tables: Chogadiya, Hora, Prahara, 30 Muhurtas, Lagna intervals
- Muhurta devata sequence: Rudra-Ahi-Mitra day/night model aligned with Nārada Saṃhitā 9.1-5 and Kāśyapa/Vṛddha Vasiṣṭha attribution
- Festival engine: 324 unique festival identities and 122 unique vrat identities with tradition and regional handling
- Vaasa and direction checks: Disha Shool, Rahu Vaasa, Chandra Vaasa, Shiva Vaasa, Agni Vaasa, Yogini Vaasa
- Panchak rule output: Dhanishta pada 3 through Revati with entry-weekday subtype labels for Roga, Raja, Agni, Chora, Mrityu, and Shubha Panchaka
- Locales: English, Hindi, Gujarati
- Calendar types: Amanta and Purnimanta
- Works standalone or inside Laravel
Install
composer require jayeshmepani/panchang-core
Requirements:
- PHP 8.3+
- PHP FFI extension enabled
jayeshmepani/jpl-moshier-ephemeris-phpnesbot/carbon
Enable FFI in php.ini:
extension=ffi ffi.enable=1
For CLI verification:
php -r "echo extension_loaded('ffi') ? 'FFI loaded\n' : 'FFI not loaded\n';"
Quick Usage
<?php require 'vendor/autoload.php'; use Carbon\CarbonImmutable; use JayeshMepani\PanchangCore\Traits\CliBootstrap; CliBootstrap::init(__DIR__); $panchang = CliBootstrap::makePanchangService(); $details = $panchang->getDayDetails( date: CarbonImmutable::parse('2026-05-29'), lat: 23.2472446, lon: 69.668339, tz: 'Asia/Kolkata' ); echo $details['Current_Tithi_At_Input_Now']['name'] . PHP_EOL; echo $details['Tithi_At_Sunrise']['name'] . PHP_EOL; echo $details['Current_Karana_At_Input_Now']['name'] . PHP_EOL; echo $details['Nakshatra']['name'] . PHP_EOL;
Laravel facade usage:
use Carbon\CarbonImmutable; use JayeshMepani\PanchangCore\Facades\Panchang; $details = Panchang::getDayDetails( date: CarbonImmutable::parse('2026-05-29'), lat: 23.2472446, lon: 69.668339, tz: 'Asia/Kolkata' ); $festivals = $details['Festivals'];
Important Output Semantics
TithiandKaranaare sunrise-based compatibility fields.- Use
Current_Tithi_At_Input_Now,Current_Nakshatra_At_Input_Now,Current_Yoga_At_Input_Now, andCurrent_Karana_At_Input_Nowfor runtime/current values. - Use
Tithi_At_Sunrise,Nakshatra_At_Sunrise, andKarana_At_Sunrisewhen sunrise semantics are required explicitly. Brahma_Muhurtauses the dynamic night-muhurta convention by default: previous sunset to sunrise divided into 15 night Muhurtas.- The fixed 48-minute Brahma Muhurta convention is preserved under
Brahma_Muhurta.fixed_48_minute_convention. Amrita_Kaalis calculated independently from nakshatra-specific Amrita ghati offsets, not from Varjyam.Lagna_Full_Dayincludes partial intervals that overlap the sunrise-to-next-sunrise Panchang day.Chandra_Vaasauses Moon-rashi direction as the primary field and preserves the older nakshatra-pada Vaasa undernakshatra_pada_vaasa.- Nakshatra-derived current windows such as Anandadi Yoga, Amritadi Yoga, and nakshatra-pada Chandra Vaasa are selected from the calculation time, not blindly from the first sunrise window.
- Eclipse output separates global classification from local visibility classification with
global_eclipse_typeandlocal_eclipse_type. Day_Types.apparent_solar_noonis the astronomical solar transit.Abhijit_Muhurta.daylight_midpointis the sunrise-to-sunset midpoint used for Abhijit calculation.- Proportional periods such as Hora, Choghadiya, daytime/nighttime Muhurtas, Prahara, the fivefold daytime divisions, Vijaya, Nishitha, Godhuli, Pratah Sandhya, and Sayahna Sandhya use actual local dinamana or ratrimana where their rule depends on day or night length.
- Arunodaya, Pradosha, and Madhyahna Sandhya use fixed ghati offsets from actual local sunrise, sunset, or solar noon; the ghati itself remains 24 elapsed minutes.
- Generated
today,month, andrawJSON includecalendar_period_windowswith sidereal and Sayana ayana/ritu windows alongside samvat, samvatsara, and lunar-month windows. - Daily detail payloads in
todayandrawoutput includeSayana_Ayana,Sayana_Ritu, andMahadiksha_Guidancewhere the selected output profile includes day details.
CLI Exporters
php scripts/panchang_today.php php scripts/panchang_month_output.php 2026 5 php scripts/panchang_festivals.php 2026 php scripts/panchang_eclipses.php 2026 2032 php scripts/panchang_raw_output.php 2026 2026 2032
Notes:
- Scripts write into
scripts/output/{calendar_type}/{locale}/. panchang_today.phpwritestoday.jsonand prints status text.panchang_month_output.phpwritesmonth_YYYY_MM.json. Without arguments, it generates the current month.panchang_festivals.phpwritesfestivals_YYYY.json,festivals_only_YYYY.json, orvrats_YYYY.json.panchang_eclipses.phpwriteseclipses_YYYY_YYYY.json.panchang_raw_output.phpwritesraw_output_YYYY_YYYY.json.panchang_month_output.phpandpanchang_raw_output.phpstill emit JSON to stdout when piped or redirected.- Use
PANCHANG_LOCALE=en|hi|guandPANCHANG_CALENDAR_TYPE=amanta|purnimantafor variants.
Documentation
- Full HTML documentation: docs/index.html
- Coverage matrix: PACKAGE_COVERAGE.md
- Traditional source attribution: docs/TRADITIONAL_TEXT_SOURCES.md
- Muhurta text source classification: docs/MUHURTA_TEXT_SOURCES.md
- Festival and vrat identity catalog: docs/FESTIVAL_VRAT_IDENTITIES.md
Development
composer install
composer test
composer phpstan
composer lint:check
License
MIT. See LICENSE.
Credits
Built by Jayesh Mepani.
jayeshmepani/panchang-core 适用场景与选型建议
jayeshmepani/panchang-core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Festival」 「jyotish」 「muhurta」 「astrology」 「panchang」 「vedic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jayeshmepani/panchang-core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jayeshmepani/panchang-core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jayeshmepani/panchang-core 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP library for calculations in Vedic astrology
Complete 100% 1:1 PHP FFI Wrapper for the Swiss Ephemeris C Library - Direct C function calls with zero abstraction for maximum astronomical precision
Drawing component for Jyotish Library
FestivalBasics Bundle for an Oro Application
PHP library for calculations in Vedic astrology
PHP FFI wrapper for the JME native ephemeris library with direct jme_* API access and bundled runtime library support
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 38
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-25