{"id":2546,"library":"jdcal","title":"Julian Dates from Proleptic Gregorian and Julian Calendars","description":"jdcal is a Python module designed for converting between Julian dates and calendar dates, supporting both proleptic Gregorian and Julian calendars. It enhances precision by storing Julian dates as a pair of floating-point numbers. The library provides functions for conversions in both directions (e.g., `gcal2jd` for Gregorian to Julian Date, and `jd2gcal` for the reverse). The current version is 1.4.1, with its last update in April 2019, suggesting a maintenance-focused release cadence.","status":"maintenance","version":"1.4.1","language":"python","source_language":"en","source_url":"https://github.com/phn/jdcal","tags":["astronomy","calendar","date","time","julian date","gregorian date"],"install":[{"cmd":"pip install jdcal","lang":"bash","label":"Install jdcal"}],"dependencies":[],"imports":[{"symbol":"gcal2jd","correct":"from jdcal import gcal2jd"},{"symbol":"jd2gcal","correct":"from jdcal import jd2gcal"},{"symbol":"jcal2jd","correct":"from jdcal import jcal2jd"},{"symbol":"jd2jcal","correct":"from jdcal import jd2jcal"}],"quickstart":{"code":"from jdcal import gcal2jd, jd2gcal\n\n# Convert Gregorian date to Julian date\nyear, month, day = 2000, 1, 1\njd1, jd2 = gcal2jd(year, month, day)\nprint(f\"Gregorian {year}-{month}-{day} is Julian Date: {jd1} + {jd2} = {jd1 + jd2}\")\n\n# Convert Julian date back to Gregorian date\ng_year, g_month, g_day, g_fraction = jd2gcal(jd1, jd2)\nprint(f\"Julian Date {jd1} + {jd2} converts to Gregorian: {g_year}-{g_month}-{g_day} (fraction: {g_fraction})\")","lang":"python","description":"This example demonstrates how to convert a Gregorian date to a Julian date using `gcal2jd` and then convert it back to a Gregorian date using `jd2gcal`."},"warnings":[{"fix":"Always pass and receive Julian dates as a tuple of two floats. For the full Julian date, sum `jd1 + jd2`.","message":"Julian dates are returned and expected as two separate floating-point numbers (jd1, jd2) to maintain maximum precision. Always handle both components for calculations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware that conversions for dates far in the past apply modern calendar rules. For historical accuracy, external logic might be needed to determine the correct calendar system for a given date.","message":"The library uses 'proleptic' calendars, meaning Gregorian and Julian calendar rules are applied to dates even before their historical adoption. This may not align with historical calendar usage in specific regions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid installing version 1.0 directly. Use the latest stable version (`pip install jdcal`) or a version greater than 1.0.","message":"Installation of `jdcal==1.0` via `pip` was problematic due to a missing `LICENSE.txt` file in the PyPI tarball, leading to installation failures.","severity":"breaking","affected_versions":"1.0"},{"fix":"Ensure `jdcal` is installed before `openpyxl` if using older versions of `openpyxl` that explicitly relied on it, or upgrade `openpyxl` to a newer version where this is less of an issue. `jdcal` itself does not have a dependency on `openpyxl`.","message":"Older versions of `openpyxl` (a dependency of `jdcal` for some users, but not a direct dependency *of* `jdcal`) had integration issues leading to `ImportError` if `jdcal` was not installed or if installation order was incorrect.","severity":"gotcha","affected_versions":"< 2.5 of `openpyxl` (and implicitly `jdcal` when used with it)"}],"env_vars":null,"search_vec":"'1.4.1':70 '2019':77 'april':76 'astronomi':85 'cadenc':84 'calendar':8,21,29,86 'convers':50 'convert':16 'current':67 'date':2,19,22,36,60,87,90,92 'design':14 'direct':53 'e.g':54 'enhanc':31 'float':42 'floating-point':41 'focus':82 'function':48 'gcal2jd':55 'gregorian':5,26,57,91 'jd2gcal':62 'jdcal':9 'julian':1,7,18,28,35,59,89 'last':73 'librari':46 'mainten':81 'maintenance-focus':80 'modul':13 'number':44 'pair':39 'point':43 'precis':32 'prolept':4,25 'provid':47 'python':12 'releas':83 'revers':65 'store':34 'suggest':78 'support':23 'time':88 'updat':74 'version':68","created_at":"2026-04-11T01:32:40.485365+00:00","updated_at":"2026-04-16T15:51:41.217910+00:00","problems":[{"fix":"Install the jdcal package using pip: `pip install jdcal`","cause":"The 'jdcal' library is not installed in your Python environment or is not accessible via your Python path.","error":"ModuleNotFoundError: No module named 'jdcal'"},{"fix":"Provide all three required integer arguments for year, month, and day: `jdcal.gcal2jd(2023, 10, 26)`","cause":"The `gcal2jd` function requires three integer arguments: year, month, and day. This error occurs when insufficient arguments are provided.","error":"TypeError: gcal2jd() missing 2 required positional arguments: 'month' and 'day'"},{"fix":"Ensure you are using the correct function name, `gcal2jd`, for converting Gregorian calendar dates to Julian dates: `jdcal.gcal2jd(2023, 10, 26)`","cause":"This error typically occurs when attempting to call a function or access an attribute that does not exist or is misspelled within the `jdcal` module.","error":"AttributeError: module 'jdcal' has no attribute 'gcaltojd'"},{"fix":"Provide both Julian date components: `jdcal.jd2gcal(2400000.5, 59198.0)`","cause":"The `jd2gcal` function expects two floating-point numbers representing the Julian date (jd1 and jd2) to maintain precision. This error occurs when only one argument is provided.","error":"TypeError: jd2gcal() missing 1 required positional argument: 'jd2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/phn/jdcal","docs":null,"changelog":null,"pypi":"https://pypi.org/project/jdcal/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}