Skip to main content

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

Metadata

Release files for salnama 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for salnama 1.0.0
File Size Uploaded
salnama-1.0.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for salnama 1.0.0
File Interpreter ABI Platform
salnama-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.7 kB

Release files / salnama-1.0.0.tar.gz

Download URL salnama-1.0.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ec40f6ffc373c6c978709d495d78e4cef7106433377e484d5e4372dc23125dfa
BLAKE2b-256 checksum
How to use checksums
f28c0745414cbd7c8b345b7bd5ec61d99503ea8e4d78b6d87b6d8cd405f0d9d2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / salnama-1.0.0-py3-none-any.whl

Download URL salnama-1.0.0-py3-none-any.whl
Size 59.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f35de624e88f6c40c3f357e56a17e326b34480d3eb4e48e9dfdd0f0945b6ce25
BLAKE2b-256 checksum
How to use checksums
e3672cb3ea8beb7ae7010b6b2e35dea70c088bacb8743bfb5d4935fa97d614f8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page