Skip to main content

Integrated Martian datetime and calendar support for Python

Project description

mars-dtc: Integrated Mars Datetime and Calendar Support for Python.

PyPI version

mars-dtc is a Python library for representing and manipulating Martian dates and times.

This initial release implements the Darian calendar, which divides the Martian year into 24 months and accounts for leap sols. Future versions may include other proposed Martian calendar systems.

The library offers familiar functionality similar to Python’s datetime module. It integrates seamlessly with Pandas and Matplotlib, enabling analysis, visualization, and serialization of Martian temporal data.

Installation

pip install mars-dtc

Features

  • Full implementation of the Darian calendar (24 months, 668–669 sols per year) in this initial relase.
  • Core date and time classes:
    • MarsDate for calendar dates
    • MarsDateTime for date–time precision
    • MarsTimedelta for sol-based time deltas
  • Arithmetic, comparisons, and rounding operations
  • Serialization to and from JSON, YAML, and dictionaries
  • Custom Pandas extension dtype for native column and Series support
  • Integration with Matplotlib for native plotting
  • Utilities for generating Martian date ranges and computing week or sol-of-year values

For the full set of features, see the demo notebook included, showing:

  • Basic date and time creation
  • Arithmetic and formatting
  • JSON/YAML serialization
  • Pandas operations
  • Plotting with Matplotlib

Alongside the demo, we include an example dataset of parsed Martian weather data with Darian calendar dates to allows users to test the package’s functionality.

Citing mars-dtc

If you use mars-dtc in your publication, please cite it by using the following BibTeX entry.

@software{De_Lima_mars-dtc_Integrated_Mars_2025,
	author = {De Lima, Victor},
	month = oct,
	title = {{mars-dtc: Integrated Mars Datetime and Calendar Support for Python}},
	url = {https://purl.org/victordelima/mars-dtc},
	version = {0.1.1},
	year = {2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mars_dtc-0.1.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mars_dtc-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file mars_dtc-0.1.2.tar.gz.

File metadata

  • Download URL: mars_dtc-0.1.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for mars_dtc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1829d9091024657849b15e9f34a8b5c8481237133a1f312832ba98ce4aaa7a25
MD5 ab533a7eab1296f5462855b40262f973
BLAKE2b-256 c5a23fc2b5d977ebd856a9dceee270724e1075c26e35cd9f9206242f78f9e43b

See more details on using hashes here.

File details

Details for the file mars_dtc-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mars_dtc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for mars_dtc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8d493a2776ae2d5389b8009ab636ae930749d8e1d8d1d83e2b1157a5d9439d
MD5 108ac5d8bed744eedbe951d0ccda60db
BLAKE2b-256 8943a9d9189ed1df2a02348617680609d8b36de90a724991af8744a17bdc2e07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page