Skip to main content

taghvim is a Python(v3.x) library for Calendar and Date Convertor For Persian Date

Project description

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

pip install salnama

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 2.0

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

salnama-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

salnama-1.0.0-py3-none-any.whl (59.4 kB view details)

Uploaded Python 3

File details

Details for the file salnama-1.0.0.tar.gz.

File metadata

  • Download URL: salnama-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for salnama-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ec40f6ffc373c6c978709d495d78e4cef7106433377e484d5e4372dc23125dfa
MD5 f0a3fe23793447c154554eb6e1c7240f
BLAKE2b-256 f28c0745414cbd7c8b345b7bd5ec61d99503ea8e4d78b6d87b6d8cd405f0d9d2

See more details on using hashes here.

File details

Details for the file salnama-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: salnama-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 59.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for salnama-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f35de624e88f6c40c3f357e56a17e326b34480d3eb4e48e9dfdd0f0945b6ce25
MD5 4476ae0d2a42f89db65f4269815c29dd
BLAKE2b-256 e3672cb3ea8beb7ae7010b6b2e35dea70c088bacb8743bfb5d4935fa97d614f8

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