Skip to main content

Integrated Martian datetime and calendar support for Python

Project description

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

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.

@misc{de_lima_mars-dtc_2025,
	title = {mars-dtc: {Integrated} {Mars} {Datetime} and {Calendar} {Support} for {Python}},
	howpublished = {\url{https://purl.org/victordelima/mars-dtc}},
	author = {De Lima, Victor},
	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.0.tar.gz (18.3 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.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mars_dtc-0.1.0.tar.gz
  • Upload date:
  • Size: 18.3 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.0.tar.gz
Algorithm Hash digest
SHA256 a34b6173286d293171e6807725108b0f441b20d1f5e8b3b77c48920cf55981c6
MD5 7eb44d6ce63231cd550cd44489345ce9
BLAKE2b-256 0c95396fac02cf5a3cdcbc59d41fbb93c18753c27c8b39c7f3ad24a1f513eb41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mars_dtc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 826b2cbf322c6d41b806d307b7444ad4cdfbea9fdf000bc1928b920ffb073ab3
MD5 1c9f020b40db47166d08352c8939f55e
BLAKE2b-256 41254951bf8d513e2ca675043a93c11ad29375fc921124a2fcce906358458000

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