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.

@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.1.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.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mars_dtc-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 887bfebb20db84eeb8a4a1ab253182bbef4f6779296d2be83761c2293de798fa
MD5 f8d22833867accff95f464cab8ea6ad0
BLAKE2b-256 338fa265938120ec01b4284a0a6b179987a73bb713d4a6d76828843785a05d44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mars_dtc-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7514a80925fea918509c6be3d19e57e685de79799ae249c0aca41dad1dfcd7d
MD5 cf5efcf17eb7ad79c93e2383790e2d6f
BLAKE2b-256 e9ed5230ea5933b5bfde976091ccdb77130b92e6eedfa2e961f66a26d5878c2e

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