https://github.com/0xdolan/pyroj
Converting Gregorian and Solar dates to Kurdish date
https://github.com/0xdolan/pyroj
calendar gregorian kurdish kurdish-oss python python3 rojjmer taqvim
Last synced: 6 months ago
JSON representation
Converting Gregorian and Solar dates to Kurdish date
- Host: GitHub
- URL: https://github.com/0xdolan/pyroj
- Owner: 0xdolan
- License: mit
- Created: 2020-11-30T09:38:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T10:38:36.000Z (over 1 year ago)
- Last Synced: 2024-09-26T10:05:22.456Z (8 months ago)
- Topics: calendar, gregorian, kurdish, kurdish-oss, python, python3, rojjmer, taqvim
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 install Python modules](https://docs.python.org/3.9/installing/index.html)
---
## How to use pyroj
### Get the Kurdish date
```python
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
```python
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)
```python
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: Dprint("WEEKDAY:", CAL.hefte(abbr=False, latin=True))
# Output:
# WEEKDAY: Dûşemme```
### Get the Kurdish Month Names (in Arabic-based and Latin-based)
```python
# 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:
- **[GitHub](https://github.com/dolanskurd/pyroj)**
- **[PyPI](https://pypi.org/project/pyroj/)**
- **[Twitter](http://www.twitter.com/dolanskurd)**
- **E-mail: [[email protected]](mailto:[email protected])**## License
Pyroj Library is available under the **MIT license**.