saad-almikhlafi 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Saad Al-Mikhlafi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: saad-almikhlafi
3
+ Version: 0.1.1
4
+ Summary: A concise Python UI toolkit by Saad Al-Mikhlafi
5
+ Author: Saad Al-Mikhlafi
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Saad Al-Mikhlafi
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Keywords: saad-almikhlafi,python,gui,android,ui
29
+ Classifier: Development Status :: 3 - Alpha
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Topic :: Software Development :: User Interfaces
38
+ Requires-Python: >=3.10
39
+ Description-Content-Type: text/markdown
40
+ License-File: LICENSE
41
+ Requires-Dist: pygame<3.0,>=2.1.3
42
+ Provides-Extra: test
43
+ Requires-Dist: pytest>=8; extra == "test"
44
+ Provides-Extra: arabic
45
+ Requires-Dist: arabic-reshaper>=3.0.0; extra == "arabic"
46
+ Requires-Dist: python-bidi>=0.4.2; extra == "arabic"
47
+ Dynamic: license-file
48
+
49
+ # saad-almikhlafi
50
+
51
+ **إطار واجهات Python مختصر، ببنية وأدوات واجهة من تنفيذ المشروع نفسه.**
52
+
53
+ اسم التوزيعة `saad-almikhlafi` واسم الاستيراد `saad_almikhlafi`. هذا مشروع مستقل: نظام العناصر والتخطيط والأحداث والرسم مكتوب لهذا الإطار، ويستعمل Pygame فقط كطبقة منخفضة المستوى للنافذة والرسم والإدخال؛ لا يعتمد على إطار واجهات Python آخر.
54
+
55
+ > الإصدار `0.1.1` منشور على PyPI، ويتضمن إصلاح بدء العرض على Android/Pydroid. الإصدار `0.1.0` يبقى متاحًا.
56
+
57
+ ## التثبيت والتجربة
58
+
59
+ ثبّت الإصدار المنشور الحالي:
60
+
61
+ ```bash
62
+ python -m pip install --upgrade saad-almikhlafi==0.1.1
63
+ ```
64
+
65
+ للتطوير وتشغيل الاختبارات من مجلد المشروع:
66
+
67
+ ```bash
68
+ python -m pip install -e ".[test]"
69
+ ```
70
+
71
+ يتطلب Python 3.10+ وPygame 2.1.3+.
72
+
73
+ لتشكيل النص العربي واتجاهه، ثبّت الإضافات الاختيارية من مجلد المشروع:
74
+
75
+ ```bash
76
+ pip install -e ".[test,arabic]"
77
+ ```
78
+
79
+ تستخدم عناصر النص الخط الافتراضي إن لم تحدد `font_path`. لعرض العربية على الجهاز، مرّر مسار ملف خط يدعم العربية، مثل `text("مرحبًا", font_path="/مسار/الخط.ttf")` أو `app(root, font_path="/مسار/الخط.ttf")`.
80
+
81
+ ## مثال سريع
82
+
83
+ ```python
84
+ from saad_almikhlafi import app, btn, col, field, text
85
+
86
+ app(
87
+ col(
88
+ text("Welcome!", font=28),
89
+ field(hint="Your name"),
90
+ btn("Say hello", on=lambda widget: print("Hello!")),
91
+ spacing=12,
92
+ padding=20,
93
+ ),
94
+ title="تطبيقي الأول",
95
+ )
96
+ ```
97
+
98
+ يعمل المثال في بيئة سطح المكتب، وعلى Android داخل Pydroid 3 عند توافر Pygame 2 وتهيئة SDL للفيديو في البيئة. على Android يفتح الإطار شاشة كاملة باستخدام الدقة الأصلية للجهاز، مع الاحتفاظ بالمقاس المحدد كاحتياط. تحقق من Pygame نفسه باختبار مستقل عند استكشاف مشاكل العرض:
99
+
100
+ ```python
101
+ import pygame
102
+
103
+ pygame.init()
104
+ screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
105
+ print("Pygame fullscreen ready:", pygame.version.ver, screen.get_size())
106
+ ```
107
+
108
+ إذا فشل `set_mode` في هذا الاختبار أيضًا، فالمشكلة في توافق/تهيئة Pygame أو SDL داخل Pydroid وليست في كود الواجهة؛ أصلح تثبيت Pydroid/حزمة Pygame المتوافقة ثم أعد الاختبار. وجود `pygame` وإظهار رقم إصدار لا يثبت وحده أن SDL استطاع إنشاء نافذة Android. يذكر [وصف Pydroid 3 الرسمي](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3&hl=en_US) دعم Pygame 2. اختُبر وضع الشاشة الأصلية مستقلًا في Pydroid؛ يُرجى تجربة المثال الكامل بعد تثبيت 0.1.1.
109
+
110
+ ## عناصر الواجهة
111
+
112
+ | الاستدعاء | الوظيفة |
113
+ |---|---|
114
+ | `col(...)` / `column(...)` | ترتيب العناصر رأسيًا |
115
+ | `row(...)` | ترتيب العناصر أفقيًا |
116
+ | `text("...")` / `label("...")` | نص مع حجم ولون ومحاذاة |
117
+ | `btn("...")` / `button("...")` | زر مع دالة `on` عند النقر |
118
+ | `field(...)` / `input(...)` | حقل إدخال نص أحادي السطر |
119
+ | `image(path)` | عرض ملف صورة محلي |
120
+ | `spacer()` | مساحة تتمدد داخل الصف أو العمود |
121
+ | `scroll(content)` | مساحة تمرير رأسية |
122
+ | `screen_manager({name: widget})` | تبديل بين شاشات مسماة مع سجل رجوع |
123
+ | `app(root, ...)` / `run(root, ...)` | تشغيل نافذة التطبيق |
124
+
125
+ تقبل التخطيطات `spacing`, `padding`, `background`, `width`, `height`, `align`. وتقبل العناصر خصائصها الخاصة مثل `font`, `color`, `hint`, `secure`, `on_change` و`on_submit`. استخدم `manager.show("settings")` للتبديل و`manager.back()` للعودة.
126
+
127
+ ## المرحلة الحالية
128
+
129
+ **المراحل 1–3:** نواة العناصر والتخطيطات والأحداث والرسم، تمرير رأسي، شاشات مسماة وسجل رجوع، مع معالجة عربية اختيارية وخطوط مخصصة. نجحت اختبارات الرسم واللمس الاصطناعي والعربية على Linux؛ لم يجر التشغيل على جهاز Android بعد.
130
+
131
+ **المرحلة التالية:** تشغيل `examples/pydroid_smoke.py` على Pydroid والتحقق على الجهاز من اللمس ولوحة المفاتيح والاتجاه؛ ثم تحسين السمات وإتاحة الوصول والتوافق قبل إصدار مستقر. لا يُنشر أي إصدار قبل اكتمال المراجعة وموافقة المستخدم.
132
+
133
+ ## English
134
+
135
+ `saad-almikhlafi` is a standalone Python UI toolkit with its own widget tree, layout, event handling, scrolling, screens, and drawing code. It uses Pygame as a low-level graphics/input backend. Optional Arabic shaping and custom fonts are available. Import it as `saad_almikhlafi`. Version 0.1.1 is published on PyPI and opens Android/Pydroid using the device's native fullscreen mode; version 0.1.0 remains available.
@@ -0,0 +1,87 @@
1
+ # saad-almikhlafi
2
+
3
+ **إطار واجهات Python مختصر، ببنية وأدوات واجهة من تنفيذ المشروع نفسه.**
4
+
5
+ اسم التوزيعة `saad-almikhlafi` واسم الاستيراد `saad_almikhlafi`. هذا مشروع مستقل: نظام العناصر والتخطيط والأحداث والرسم مكتوب لهذا الإطار، ويستعمل Pygame فقط كطبقة منخفضة المستوى للنافذة والرسم والإدخال؛ لا يعتمد على إطار واجهات Python آخر.
6
+
7
+ > الإصدار `0.1.1` منشور على PyPI، ويتضمن إصلاح بدء العرض على Android/Pydroid. الإصدار `0.1.0` يبقى متاحًا.
8
+
9
+ ## التثبيت والتجربة
10
+
11
+ ثبّت الإصدار المنشور الحالي:
12
+
13
+ ```bash
14
+ python -m pip install --upgrade saad-almikhlafi==0.1.1
15
+ ```
16
+
17
+ للتطوير وتشغيل الاختبارات من مجلد المشروع:
18
+
19
+ ```bash
20
+ python -m pip install -e ".[test]"
21
+ ```
22
+
23
+ يتطلب Python 3.10+ وPygame 2.1.3+.
24
+
25
+ لتشكيل النص العربي واتجاهه، ثبّت الإضافات الاختيارية من مجلد المشروع:
26
+
27
+ ```bash
28
+ pip install -e ".[test,arabic]"
29
+ ```
30
+
31
+ تستخدم عناصر النص الخط الافتراضي إن لم تحدد `font_path`. لعرض العربية على الجهاز، مرّر مسار ملف خط يدعم العربية، مثل `text("مرحبًا", font_path="/مسار/الخط.ttf")` أو `app(root, font_path="/مسار/الخط.ttf")`.
32
+
33
+ ## مثال سريع
34
+
35
+ ```python
36
+ from saad_almikhlafi import app, btn, col, field, text
37
+
38
+ app(
39
+ col(
40
+ text("Welcome!", font=28),
41
+ field(hint="Your name"),
42
+ btn("Say hello", on=lambda widget: print("Hello!")),
43
+ spacing=12,
44
+ padding=20,
45
+ ),
46
+ title="تطبيقي الأول",
47
+ )
48
+ ```
49
+
50
+ يعمل المثال في بيئة سطح المكتب، وعلى Android داخل Pydroid 3 عند توافر Pygame 2 وتهيئة SDL للفيديو في البيئة. على Android يفتح الإطار شاشة كاملة باستخدام الدقة الأصلية للجهاز، مع الاحتفاظ بالمقاس المحدد كاحتياط. تحقق من Pygame نفسه باختبار مستقل عند استكشاف مشاكل العرض:
51
+
52
+ ```python
53
+ import pygame
54
+
55
+ pygame.init()
56
+ screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
57
+ print("Pygame fullscreen ready:", pygame.version.ver, screen.get_size())
58
+ ```
59
+
60
+ إذا فشل `set_mode` في هذا الاختبار أيضًا، فالمشكلة في توافق/تهيئة Pygame أو SDL داخل Pydroid وليست في كود الواجهة؛ أصلح تثبيت Pydroid/حزمة Pygame المتوافقة ثم أعد الاختبار. وجود `pygame` وإظهار رقم إصدار لا يثبت وحده أن SDL استطاع إنشاء نافذة Android. يذكر [وصف Pydroid 3 الرسمي](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3&hl=en_US) دعم Pygame 2. اختُبر وضع الشاشة الأصلية مستقلًا في Pydroid؛ يُرجى تجربة المثال الكامل بعد تثبيت 0.1.1.
61
+
62
+ ## عناصر الواجهة
63
+
64
+ | الاستدعاء | الوظيفة |
65
+ |---|---|
66
+ | `col(...)` / `column(...)` | ترتيب العناصر رأسيًا |
67
+ | `row(...)` | ترتيب العناصر أفقيًا |
68
+ | `text("...")` / `label("...")` | نص مع حجم ولون ومحاذاة |
69
+ | `btn("...")` / `button("...")` | زر مع دالة `on` عند النقر |
70
+ | `field(...)` / `input(...)` | حقل إدخال نص أحادي السطر |
71
+ | `image(path)` | عرض ملف صورة محلي |
72
+ | `spacer()` | مساحة تتمدد داخل الصف أو العمود |
73
+ | `scroll(content)` | مساحة تمرير رأسية |
74
+ | `screen_manager({name: widget})` | تبديل بين شاشات مسماة مع سجل رجوع |
75
+ | `app(root, ...)` / `run(root, ...)` | تشغيل نافذة التطبيق |
76
+
77
+ تقبل التخطيطات `spacing`, `padding`, `background`, `width`, `height`, `align`. وتقبل العناصر خصائصها الخاصة مثل `font`, `color`, `hint`, `secure`, `on_change` و`on_submit`. استخدم `manager.show("settings")` للتبديل و`manager.back()` للعودة.
78
+
79
+ ## المرحلة الحالية
80
+
81
+ **المراحل 1–3:** نواة العناصر والتخطيطات والأحداث والرسم، تمرير رأسي، شاشات مسماة وسجل رجوع، مع معالجة عربية اختيارية وخطوط مخصصة. نجحت اختبارات الرسم واللمس الاصطناعي والعربية على Linux؛ لم يجر التشغيل على جهاز Android بعد.
82
+
83
+ **المرحلة التالية:** تشغيل `examples/pydroid_smoke.py` على Pydroid والتحقق على الجهاز من اللمس ولوحة المفاتيح والاتجاه؛ ثم تحسين السمات وإتاحة الوصول والتوافق قبل إصدار مستقر. لا يُنشر أي إصدار قبل اكتمال المراجعة وموافقة المستخدم.
84
+
85
+ ## English
86
+
87
+ `saad-almikhlafi` is a standalone Python UI toolkit with its own widget tree, layout, event handling, scrolling, screens, and drawing code. It uses Pygame as a low-level graphics/input backend. Optional Arabic shaping and custom fonts are available. Import it as `saad_almikhlafi`. Version 0.1.1 is published on PyPI and opens Android/Pydroid using the device's native fullscreen mode; version 0.1.0 remains available.
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "saad-almikhlafi"
7
+ version = "0.1.1"
8
+ description = "A concise Python UI toolkit by Saad Al-Mikhlafi"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { file = "LICENSE" }
12
+ authors = [{ name = "Saad Al-Mikhlafi" }]
13
+ keywords = ["saad-almikhlafi", "python", "gui", "android", "ui"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Software Development :: User Interfaces",
24
+ ]
25
+ dependencies = ["pygame>=2.1.3,<3.0"]
26
+
27
+ [project.optional-dependencies]
28
+ test = ["pytest>=8"]
29
+ arabic = ["arabic-reshaper>=3.0.0", "python-bidi>=0.4.2"]
30
+
31
+ [tool.setuptools]
32
+ package-dir = {"" = "src"}
33
+
34
+ [tool.setuptools.packages.find]
35
+ where = ["src"]
36
+
37
+ [tool.pytest.ini_options]
38
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,45 @@
1
+ """Concise UI toolkit by Saad Al-Mikhlafi."""
2
+
3
+ from .core import (
4
+ App,
5
+ Box,
6
+ Button,
7
+ Callback,
8
+ Color,
9
+ Column,
10
+ Image,
11
+ Input,
12
+ Label,
13
+ Row,
14
+ ScreenManager,
15
+ ScrollView,
16
+ Spacer,
17
+ Widget,
18
+ button,
19
+ column,
20
+ field,
21
+ image,
22
+ parse_color,
23
+ row,
24
+ run,
25
+ screen_manager,
26
+ scroll,
27
+ spacer,
28
+ text,
29
+ )
30
+
31
+ __version__ = "0.1.1"
32
+
33
+ # Short spellings for everyday interface code.
34
+ app = run
35
+ col = column
36
+ btn = button
37
+ label = text
38
+ input = field
39
+
40
+ __all__ = [
41
+ "App", "Box", "Button", "Callback", "Color", "Column", "Image",
42
+ "Input", "Label", "Row", "ScreenManager", "ScrollView", "Spacer", "Widget", "__version__",
43
+ "app", "btn", "button", "col", "column", "field", "image", "input",
44
+ "label", "parse_color", "row", "run", "screen_manager", "scroll", "spacer", "text",
45
+ ]