Skip to main content

A python package for calendrical calculations

Project description

Author: Behrouz Safari
License: MIT

cals

A python package for calendrical calculations

Installation

Install the latest version of cals from PyPI:

pip install cals

Requirements are numpy, scipy, pandas and requests.

Examples

Let's read a file:

>>> from cals import Gregorian, gregorian_from_jd
>>> g = Gregorian(2023, 2, 1, 2, 36, 15)
>>> g
Gregorian(2023, 2, 1, 2, 36, 15, 0)
>>> jd = g.to_jd()
>>> jd
2459976.6085069445
>>> date = gregorian_from_jd(2459976.5)
>>> date
Gregorian(2023, 2, 1, 0, 0, 0, 0)
>>> date.add_days(10)
>>> date
Gregorian(2023, 2, 11, 0, 0, 0, 0)
>>> date.to_persian()
Persian(1401, 11, 22, 0, 0, 0, 0)
>>> 
>>> from cals import Persian, persian_from_jd
>>> p = Persian(1401, 11, 8, 15)
>>> p
Persian(1401, 11, 8, 15, 0, 0, 0)
>>> p.to_gregorian()
Gregorian(2023, 1, 28, 15, 0, 0, 0)
>>> p.to_jd()
2459973.125
>>> persian_from_jd(2459973.125)
Persian(1401, 11, 8, 15, 0, 0, 0)
>>> p.add_days(50)
>>> p
Persian(1401, 12, 28, 15, 0, 0, 0)

See more at astrodatascience.net

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

cals-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

cals-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cals-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for cals-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2babb5f252b700d5a7a78b86db70dcb2be8de0c50c03a686024b6cef93dc2fe3
MD5 dc8e25f75fb6d29c00425a5a4e219c23
BLAKE2b-256 bdf8df073b2bf8ec7382cf97f0b9051f7fce6ea417136a208cb69feae1d3f0d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cals-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for cals-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 109bebe33af34de19ecdf3039397968871aef6c02ef1e7a70ee0977b53669756
MD5 39e1e4e84eca62db30699b080f5935e8
BLAKE2b-256 1a5a3c91127f84bfe25280fe793f83faa5dda87c767a491f1c53b60af590beba

See more details on using hashes here.

Supported by

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