Skip to main content

A companion library providing PyQt (PySide6) widgets for the persian-jalali-calendar library.

Project description

Persian Jalali Calendar - PyQt Widgets

A companion library providing beautiful, modern, and theme-aware PyQt (PySide6) widgets for the persian-jalali-calendar library.

This library provides a set of professional date and time selection widgets designed for a native Persian user experience, including Right-to-Left layout, Persian numerals, and a custom Persian font.

Installation

When you install this library, the core persian-jalali-calendar will be installed automatically as a dependency.

pip install jalali-calendar-qt

You will also need to provide the BNazanin.ttf font file in a folder like src/jalali_calendar_qt/assets/ for the custom font to work.

Widgets

JalaliDateEdit

A compact input field that shows a popup JalaliDatePicker.

from jalali_calendar_qt import JalaliDateEdit

date_editor = JalaliDateEdit()

JalaliTimeEdit

A compact input field that shows a popup AnalogTimePicker.

from jalali_calendar_qt import JalaliTimeEdit

time_editor = JalaliTimeEdit()

JalaliDateTimeEdit

A compact input field that shows a combined popup with both date and time pickers.

from jalali_calendar_qt import JalaliDateTimeEdit

datetime_editor = JalaliDateTimeEdit()

Example Usage

import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget
from jalali_calendar_qt import JalaliDateEdit, JalaliTimeEdit, JalaliDateTimeEdit
from jalali_calendar_qt.utils import get_font, translate # For styling

# --- Main Application Window ---
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        # ... setup window ...
        
        # Create the widgets
        date_edit = JalaliDateEdit()
        time_edit = JalaliTimeEdit()
        datetime_edit = JalaliDateTimeEdit()

        # Connect to their signals
        date_edit.dateSelected.connect(self.on_date_selected)
        time_edit.timeSelected.connect(self.on_time_selected)
        datetime_edit.dateTimeSelected.connect(self.on_datetime_selected)
        
        # ... add widgets to layout ...
        
    def on_date_selected(self, jdate):
        print(f"Date selected: {jdate}")
        
# ... (rest of standard application code) ...

License

This project is licensed 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

jalali_calendar_qt-1.0.0.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

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

jalali_calendar_qt-1.0.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jalali_calendar_qt-1.0.0.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for jalali_calendar_qt-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b1d4d5ef740c35eed977aa852276c749122fbbcbde9ab6b66e4a1f580dbdce4f
MD5 8b8033557a7ddeb6afdd523e0f6f3d3c
BLAKE2b-256 4aaea33e788b6c18d91812f7ef5e507e492329c49c437ecfaf4374156c1e1507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jalali_calendar_qt-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1022bf27ccea688a816435bcf2bfb40e46d0b881e34f4caed21de5794c29613
MD5 14e1612839da68589a507d90ba17a5d2
BLAKE2b-256 534eaddcf487fd35a8edfb65550acae4099105a6c1a30ec0ced1fd36cc347fbd

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