Skip to main content

Darian Calendar Converter

A Python library for converting between Gregorian and Darian calendars, designed for Mars timekeeping applications.

What is the Darian Calendar?

The Darian calendar is a proposed calendar system for Mars, developed by aerospace engineer Thomas Gangale in the 1980s. It divides the Martian year into 24 months with alternating lengths of 27 and 28 sols (Martian days), closely matching Mars' orbital period of approximately 687 Earth days. Each sol is about 24 hours and 39 minutes long.

The calendar is primarily used in scientific research, Mars mission planning, and science fiction to provide a standardized way to track time on Mars. Unlike Earth's calendar, which is based on lunar cycles, the Darian calendar is purely solar-based and designed to accommodate Mars' unique orbital characteristics.

References

Installation

This package uses UV for dependency management:

# Install with UV
uv pip install MarsDarianCalendar

# Or add to your project
uv add MarsDarianCalendar

Usage

Basic Conversion

from marsdariancalendar import DarianCalendar
from datetime import datetime, timezone

# Initialize with default UTC timezone
cal = DarianCalendar()

# Convert Gregorian to Darian
gregorian_date = datetime(2023, 6, 15, tzinfo=timezone.utc)
darian_date = cal.gregorian_to_darian(gregorian_date)
print(f"Darian date: {darian_date}")  # (year, month, day)

# Convert Darian to Gregorian
gregorian = cal.darian_to_gregorian(1, 12, 15)
print(f"Gregorian date: {gregorian}")

# Get current Darian date
current_darian = cal.now()
print(f"Current Darian: {current_darian}")

# Format Darian date as string
formatted = cal.format_darian(5, 12, 15)
print(f"Formatted: {formatted}")  # "5 Vrisha 15"

With Custom Timezone

from datetime import timezone, timedelta

# Use Eastern Time
eastern = timezone(timedelta(hours=-5))
cal = DarianCalendar(earth_timezone=eastern)

Features

  • Convert between Gregorian and Darian dates
  • Support for custom Earth timezones
  • Current Darian date retrieval
  • Proper date formatting with traditional month names
  • Unit tested for accuracy

Development

# Clone and setup development environment
uv sync --dev

# Run tests
uv run pytest

# Install additional dev dependencies
uv add --group dev black flake8 mypy

Metadata

Release files for MarsDarianCalendar 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MarsDarianCalendar 1.0.0
File Size Uploaded
marsdariancalendar-1.0.0.tar.gz 43.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MarsDarianCalendar 1.0.0
File Interpreter ABI Platform
marsdariancalendar-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.0 kB

Release files / marsdariancalendar-1.0.0.tar.gz

Download URL marsdariancalendar-1.0.0.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c0974e9c6795c8f82aff2ec0bdb5eaa13d54624f5916b29d1be74afa27ea172b
BLAKE2b-256 checksum
How to use checksums
9d405c5616de86ad2788ce76eede072c7afec6a30304d06b3ecbe01b6597f246
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / marsdariancalendar-1.0.0-py3-none-any.whl

Download URL marsdariancalendar-1.0.0-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96cf96857f4d3263be1584a0aa1bc3fb340e982351f9b79d3e3c77b42d599561
BLAKE2b-256 checksum
How to use checksums
5069c5511f162d2f5f7bac81d6c8fe35e9d34a33e19d6c07a22a241b30b8c454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page