Planet Mars' Darian Calendar Convertor
Project description
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
- Wikipedia: Darian calendar
- Scientific article: Mars Time for Mars Surface Operations
- Thomas Gangale's Darian Calendar System
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marsdariancalendar-1.0.0.tar.gz.
File metadata
- Download URL: marsdariancalendar-1.0.0.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0974e9c6795c8f82aff2ec0bdb5eaa13d54624f5916b29d1be74afa27ea172b
|
|
| MD5 |
29571e6670f758a76052aafcb1f18c15
|
|
| BLAKE2b-256 |
9d405c5616de86ad2788ce76eede072c7afec6a30304d06b3ecbe01b6597f246
|
File details
Details for the file marsdariancalendar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: marsdariancalendar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96cf96857f4d3263be1584a0aa1bc3fb340e982351f9b79d3e3c77b42d599561
|
|
| MD5 |
952d1b089633457528ab829d827e3c2f
|
|
| BLAKE2b-256 |
5069c5511f162d2f5f7bac81d6c8fe35e9d34a33e19d6c07a22a241b30b8c454
|