Skip to main content

A Shamsi (Jalali) datetime class for NumPy integration

Project description

Shamsi DateTime

ShamsiDateTime is a Python package developed by Ali Razmjooei that provides a class for working with Shamsi (Jalali) dates. This package integrates seamlessly with NumPy, enabling you to handle Shamsi dates and convert them to and from Gregorian dates.

Overview

The Shamsi DateTime package allows you to:

  • Create and manipulate Shamsi (Jalali) dates.
  • Convert Shamsi dates to Gregorian dates and vice versa.
  • Easily integrate with NumPy for date manipulations and analysis.

Installation

To install the package, use pip:

pip install shamsi-datetime

Basic Usage

from shamsi_datetime import ShamsiDateTime
import numpy as np

# Create a Shamsi date
shamsi_date = ShamsiDateTime(1403, 5, 6)
print(f"Shamsi Date: {shamsi_date}")

# Convert to Gregorian (NumPy datetime64)
gregorian_date = shamsi_date.to_gregorian()
print(f"Gregorian Date: {gregorian_date}")

# Convert back to Shamsi
shamsi_converted_back = ShamsiDateTime.from_gregorian(gregorian_date)
print(f"Converted Back to Shamsi: {shamsi_converted_back}")

Features

  • ShamsiDateTime Class: Represents Shamsi dates with easy conversion to and from Gregorian dates.
  • Conversion Methods: Convert between Shamsi dates and Gregorian dates using NumPy's datetime64.
  • Integration with NumPy: Leverages NumPy for efficient date operations.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

If you would like to contribute to the development of ShamsiDateTime, please fork the repository and submit a pull request. For any issues or feature requests, please open an issue on the GitHub repository.

Contact

For any questions or feedback, you can reach out to the author:

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

shamsi_datetime-0.1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

shamsi_datetime-0.1.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file shamsi_datetime-0.1.3.tar.gz.

File metadata

  • Download URL: shamsi_datetime-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for shamsi_datetime-0.1.3.tar.gz
Algorithm Hash digest
SHA256 be1ba6c776ca84dbbb655aca36791b258d2e86adae6436df19163e7b29631194
MD5 130a045781d6ac3067737b92d275645e
BLAKE2b-256 0db6f18c2645fee84ae39f675276a997f1e03224dfe9bdb61c3b26d8a0a8b384

See more details on using hashes here.

File details

Details for the file shamsi_datetime-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for shamsi_datetime-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8dcffd4e8b85cf1db77e5b3b898e3e87d4b0729f2b814f4f4a8044655cf324f0
MD5 9a4c554bb6825cb24834eb44734e6b0a
BLAKE2b-256 79b95c4be38856343f6956e99fb3aeeedab821e7365a274d844b01d13bbde483

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