Skip to main content

آلة حاسبة بسيطة - فيصل الصلاحي

PyPI version Python versions License: MIT

حزمة بايثون بسيطة وفعالة لإجراء العمليات الحسابية الأساسية. تم تطويرها بواسطة فيصل الصلاحي لتوفير واجهة برمجية سهلة الاستخدام للعمليات الرياضية الأساسية.

المميزات

  • بساطة في الاستخدام: واجهة برمجية واضحة ومباشرة
  • موثوقية عالية: معالجة صحيحة للأخطاء (مثل القسمة على صفر)
  • توثيق شامل: جميع الوظائف موثقة باللغة العربية
  • متوافقة مع Python 3.6+: تدعم جميع إصدارات بايثون الحديثة
  • خفيفة الوزن: لا تتطلب أي تبعيات خارجية

التثبيت

يمكنك تثبيت الحزمة بسهولة باستخدام pip:

pip install faisal_salahi_calculator

الاستخدام

الاستيراد

from faisal_salahi_calculator import add, subtract, multiply, divide

أمثلة على الاستخدام

الجمع

result = add(5, 3)
print(f"5 + 3 = {result}")  # الناتج: 5 + 3 = 8

الطرح

result = subtract(10, 4)
print(f"10 - 4 = {result}")  # الناتج: 10 - 4 = 6

الضرب

result = multiply(2, 6)
print(f"2 × 6 = {result}")  # الناتج: 2 × 6 = 12

القسمة

result = divide(15, 3)
print(f"15 ÷ 3 = {result}")  # الناتج: 15 ÷ 3 = 5.0

# معالجة القسمة على صفر
try:
    result = divide(10, 0)
except ValueError as e:
    print(f"خطأ: {e}")  # الناتج: خطأ: لا يمكن القسمة على صفر!

مثال شامل

from faisal_salahi_calculator import add, subtract, multiply, divide

# حساب معادلة رياضية: (10 + 5) × 3 ÷ 2 - 1
step1 = add(10, 5)        # 15
step2 = multiply(step1, 3) # 45
step3 = divide(step2, 2)   # 22.5
result = subtract(step3, 1) # 21.5

print(f"النتيجة النهائية: {result}")  # الناتج: النتيجة النهائية: 21.5

واجهة برمجة التطبيقات (API)

add(a, b)

الوصف: جمع رقمين
المعاملات:

  • a (float): الرقم الأول
  • b (float): الرقم الثاني

القيمة المُرجعة: float - ناتج الجمع

subtract(a, b)

الوصف: طرح رقمين
المعاملات:

  • a (float): الرقم الأول (المطروح منه)
  • b (float): الرقم الثاني (المطروح)

القيمة المُرجعة: float - ناتج الطرح

multiply(a, b)

الوصف: ضرب رقمين
المعاملات:

  • a (float): الرقم الأول
  • b (float): الرقم الثاني

القيمة المُرجعة: float - ناتج الضرب

divide(a, b)

الوصف: قسمة رقمين
المعاملات:

  • a (float): الرقم الأول (المقسوم)
  • b (float): الرقم الثاني (المقسوم عليه)

القيمة المُرجعة: float - ناتج القسمة
الاستثناءات: ValueError - إذا كان المقسوم عليه يساوي صفر

المتطلبات

  • Python 3.6 أو أحدث
  • لا توجد تبعيات خارجية مطلوبة

التطوير

إذا كنت تريد المساهمة في تطوير هذه الحزمة:

# استنساخ المستودع
git clone https://github.com/faisalsalahi/faisal-salahi-calculator.git
cd faisal-salahi-calculator

# تثبيت التبعيات التطويرية
pip install -e .[dev]

# تشغيل الاختبارات
pytest

# فحص جودة الكود
flake8 faisal_salahi_calculator/
black faisal_salahi_calculator/

الترخيص

هذا المشروع مرخص تحت رخصة MIT. يمكنك استخدامه وتعديله وتوزيعه بحرية.

التواصل

الإصدارات

الإصدار 0.1.0

  • الإصدار الأولي
  • العمليات الحسابية الأساسية: الجمع، الطرح، الضرب، القسمة
  • معالجة أخطاء القسمة على صفر
  • توثيق شامل باللغة العربية

ملاحظة: هذه الحزمة تم تطويرها لأغراض تعليمية وتوضيحية. إذا كنت بحاجة إلى عمليات رياضية معقدة، يُنصح باستخدام مكتبات متخصصة مثل NumPy أو SciPy.

Metadata

Release files for faisal-salahi-calculator 0.1.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 faisal-salahi-calculator 0.1.0
File Size Uploaded Provenance
faisal_salahi_calculator-0.1.0.tar.gz 5.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for faisal-salahi-calculator 0.1.0
File Interpreter ABI Platform
faisal_salahi_calculator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / faisal_salahi_calculator-0.1.0.tar.gz

Download URL faisal_salahi_calculator-0.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
09c0ad36f936070a9d485c405d254ef8272e20b87d0c4a3957e85497ad5a1f0e
BLAKE2b-256 checksum
How to use checksums
364959b93b0be17d0defdd044576643fbe3d5ad862048653b0cb1ab73a474b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / faisal_salahi_calculator-0.1.0-py3-none-any.whl

Download URL faisal_salahi_calculator-0.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb24cb415b92c3fc411865e2aecaefdcd6a3f5f995f2209a1984b9c49262fc4c
BLAKE2b-256 checksum
How to use checksums
f38102f8da2ca187141ee38c964260e4e8da908c666937eb007eebfbe6165ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Security for faisal-salahi-calculator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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