Git Product home page Git Product logo

salnama's Introduction

salnama

#salnama is a Python(v3.x) library for Calendar and Date Convertor For Persian Date, Gregorian Date ,Arabian Date with holiday and Events

تقویم ۵ ساله سالنما

امکانات

از فروردین ۱۳۹۹ تا فروردین ۱۴۰۴ (۵ ساله) شامل روز های تعطیل و مناسبت ها

امکان تبدیل تاریخ میلادی به جلالی و برعکس

امکان تبدیل تاریخ جلالی به تاریخ هجری و برعکس

امکان تبدیل تاریخ میلادی به تاریخ هجری و برعکس

شامل نام روز ها و ماه ها به زبان های فارسی -لاتین -عربی

امکان جستجو مناسبت ها و تعطیلات چند روز آینده یا گذشته

Installation

Use the package manager pip to install salnama

pip3 install salnama
or
python3 setup.py install

#Use only on Linux

Usage

>>> from salnama import taghvim
>>> jalali = taghvim.Jalali()
>>> jalali.today()
'1399-11-8'
>>> jalali.event(jalali.today())
'سالروز وفات حضرت امالبنین (س) - روز تکریم مادران و همسران شهدا'
>>> jalali.event('2024-3-27') # Gregorian Date
'روز جهانی تئاتر'
>>> jalali.event('1446-5-24') # Hijri Date
'زمین لرزه ی بم- سالروز شهادت آشو زرتشت- جشن کریسمس'
>>> calendar = jalali.find_('2020-1-27',month=True,day=True,rtl=False)
>>> calendar
('سه شنبه', '6', 'آبان', '1399')
>>> calendar[3]
'1399'
>>> jalali.holiday('1402-5-13')
'تعطیل'
>>> hijri = taghvim.Hijri()
>>> hijri.today()
'1442-6-13'
>>> hijri.today(-1)#Change the days of the month 
'1442-6-12'
>>>jalali.range('1402-1-1',6,to_jalali=True,holiday=True,event=False)
[('1402', '1', '1', 'تعطیل'),
 ('1402', '1', '2', 'تعطیل'),
 ('1402', '1', '3', 'تعطیل'),
 ('1402', '1', '4', 'تعطیل'), 
 ('1402', '1', '5', ''),
 ('1402', '1', '6', '')]
>>> miladi = taghvim.Gregorian()
>>> miladi.find_('1403-9-14')
('4', '12', '2024')
>>> miladi.find_('1403-9-14',rtl=True)
('2024', '12', '4')

Contributing

Pull requests are welcome.

License

Apache License Version 2.0

salnama's People

Contributors

abduebrahimi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.