Skip to main content

Converting Gregorian and Solar dates to Kurdish date

Project description

pyroj (Kurdish Calendar)

Welcome to pyroj (Kurdish Calendar) - a small Python library for converting Gregorian and Solar dates to Kurdish date and vice versa.

Installation

How to install the module:

pip install pyroj

for python 3 in Linux:

pip3 install pyroj

or

python3 -m pip install pyroj

Install the package using the setup.py script: First cd into the root directory where setup.py is located, then install via below command:

python setup.py install

Need help on installing Python modules, click on below link:


How to use pyroj

Get the Kurdish date

from pyroj import rojjmer

# make an instance from the class with Gregorian date
CAL = rojjmer.Rojjmer(2020, 12, 28)
print(CAL.to_kurdish(solar=False))

# Output:
# 2720-10-08

# make an instance from the class with Solar date
CAL = rojjmer.Rojjmer(1399, 10, 8)
print(CAL.to_kurdish(solar=True))

# Output:
# 2720-10-08

Get the Kurdish date - Only year, month or day

from pyroj import rojjmer

# make an instance from the class with Gregorian date
CAL = rojjmer.Rojjmer(2020, 12, 28)

# Get only the year
print("YEAR:", CAL.to_kurdish().year)

# Get only the month
print("MONTH:", CAL.to_kurdish().month)

# Get only the day
print("DAY:", CAL.to_kurdish().day)

# Output:
# YEAR: 2720
# MONTH: 10
# DAY: 8

Get the Kurdish Weekday (in Arabic-based and Latin-based)

from pyroj import rojjmer

# make an instance from the class with Gregorian date
CAL = rojjmer.Rojjmer(2020, 12, 28)

print("WEEKDAY:", CAL.hefte())
# Output:
# WEEKDAY: دووشەممە

print("WEEKDAY:", CAL.hefte(abbr=False, latin=False))
# Output:
# WEEKDAY: دووشەممە


print("Abbreviated WEEKDAY:", CAL.hefte(abbr=True, latin=False))
# Output:
# Abbreviated WEEKDAY: د


print("Abbreviated WEEKDAY:", CAL.hefte(abbr=True, latin=True))
# Output:
# Abbreviated WEEKDAY: D


print("WEEKDAY:", CAL.hefte(abbr=False, latin=True))
# Output:
# WEEKDAY: Dûşemme

Get the Kurdish Month Names (in Arabic-based and Latin-based)

# make an instance from the class with Gregorian date
CAL = rojjmer.Rojjmer(2021, 3, 21)

print("Month Name:", CAL.month_name())
# Output:
# Month Name: خاکەلێوە

# Those months have two names, will be accessible via second_name parameter to be True
print("Month Name (second name):", CAL.month_name(second_name=True))
# Output:
# Month Name: نەورۆز

print("Month Name:", CAL.month_name(second_name=False, latin=True))
# Output:
# Month Name: Xakelêwe

# Those months have two names, will be accessible via second_name parameter to be True
print("Month Name (second name):", CAL.month_name(second_name=True, latin=True))
# Output:
# Month Name: Newroz

To-Do List

  • N/A

Getting help

If you have questions about the python library pyroj module, or run into problems, or if you want to contribute in any way, feel free to reach out to me via below links:

Donate

If you think it deserves, DONATE:

License

Pyroj Library is available under the MIT license.

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

pyroj-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

pyroj-0.0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pyroj-0.0.3.tar.gz.

File metadata

  • Download URL: pyroj-0.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for pyroj-0.0.3.tar.gz
Algorithm Hash digest
SHA256 49b0ab9585fedd853b3f33d9d09c69e4c4e16b85cad5fc720a3be7339e7b5360
MD5 cc4d42d20073e71f1ce1d7c09d45d258
BLAKE2b-256 0859580528b4f54af17109a31c3ec42c70db02685d430ea8d2078b04d88e6b2c

See more details on using hashes here.

File details

Details for the file pyroj-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyroj-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for pyroj-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f29de57047c6d1f13d9cddcabd869fad8e67268456326bc8da6670fd5c0ef39f
MD5 c4c36441bef5ce43e22eda977f9eb558
BLAKE2b-256 145317cbb3b6eb4a179b3e08b368f41e7346446234509001756d4d331b25a1ee

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