Skip to main content

مكتبة لتحويل الوحدات (طول، وزن، حجم، حرارة، زمن)

Project description

Unit Converter 🐍

Unit Converter هي مكتبة بايثون مرنة وقوية لتحويل الوحدات العلمية والحياتية بسهولة ودقة.
تم تصميم المكتبة لتكون مفيدة للطلاب، الباحثين، والمستخدمين العاديين على حد سواء.

المميزات

  • تحويل بين وحدات الطول، الوزن، الحجم، الزمن، والحرارة.
  • مرونة كاملة: يمكن للمستخدم اختيار أي وحدة أصلية وأي وحدة للتحويل.
  • تغطي أغلب الوحدات الشائعة عالميًا.
  • تصميم بسيط وواضح يسهل التوسعة والصيانة.

الوحدات المدعومة

الطول (Length)

  • متر (m), سنتيمتر (cm), مليمتر (mm), كيلومتر (km)
  • إنش (inch), قدم (ft), ياردة (yd), ميل (mile), ميل بحري (nmi)
  • ميكرومتر (µm), نانومتر (nm)

الوزن / الكتلة (Weight)

  • ميليغرام (mg), غرام (g), كيلوجرام (kg), طن متري (ton)
  • باوند (lb), أونصة (oz), ميكروغرام (µg)

الحجم / السعة (Volume)

  • مليلتر (ml), لتر (l), متر مكعب (m3)
  • ملعقة صغيرة (tsp), ملعقة كبيرة (tbsp), كوب (cup)
  • باينت (pt), كوارتر (qt), جالون (gal), أونصة سائلة (fl_oz)

الزمن (Time)

  • ثانية (s), دقيقة (min), ساعة (h), يوم (day), أسبوع (week), شهر (month), سنة (year)

الحرارة (Temperature)

  • Celsius (C), Fahrenheit (F), Kelvin (K), Rankine (R)

التثبيت

يمكنك تثبيت المكتبة من PyPI:

pip install unit-converter

الاستخدام (Usage)

from unit_converter import (
    convert_length,
    convert_weight,
    convert_volume,
    convert_time,
    convert_temperature
)

# الطول
print("=== Length ===")
print("10 km =", convert_length(10, "km", "mile"), "mile")
print("12 inch =", convert_length(12, "inch", "cm"), "cm")
print("2 mile =", convert_length(2, "mile", "km"), "km")

# الوزن / الكتلة
print("\n=== Weight ===")
print("5 kg =", convert_weight(5, "kg", "lb"), "lb")
print("16 oz =", convert_weight(16, "oz", "g"), "g")
print("1000 g =", convert_weight(1000, "g", "kg"), "kg")

# الحجم / السعة
print("\n=== Volume ===")
print("3 l =", convert_volume(3, "l", "gal"), "gal")
print("2 cup =", convert_volume(2, "cup", "ml"), "ml")
print("1 m3 =", convert_volume(1, "m3", "l"), "l")

# الزمن
print("\n=== Time ===")
print("2 hours =", convert_time(2, "h", "min"), "minutes")
print("1 day =", convert_time(1, "day", "s"), "seconds")
print("3 week =", convert_time(3, "week", "day"), "days")

# الحرارة
print("\n=== Temperature ===")
print("100°C =", convert_temperature(100, "C", "F"), "°F")
print("0°C =", convert_temperature(0, "C", "K"), "K")
print("32°F =", convert_temperature(32, "F", "C"), "°C")

المساهمة

المكتبة مفتوحة المصدر، يمكنك الإضافة بسهولة:

  1. أضف وحدات جديدة إلى الملفات المناسبة (مثل length.py, weight.py).
  2. اتبع نفس منطق التحويل للوحدة الأساسية.
  3. أرسل Pull Request لمراجعة التغييرات.

الترخيص

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

zyren_unit_converter-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

zyren_unit_converter-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file zyren_unit_converter-0.1.2.tar.gz.

File metadata

  • Download URL: zyren_unit_converter-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for zyren_unit_converter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6e95fc47d4f6c58807c5aae1b6d505e807097642ff20457566cf15321b4d4a35
MD5 8c38206c264f39dcc749e09e40284236
BLAKE2b-256 a19b2e8ff04a0fd80ee619fecba7bcc07a537990f8020b139aa457d7e0c2042d

See more details on using hashes here.

File details

Details for the file zyren_unit_converter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for zyren_unit_converter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 47f9a9ebbff65c49358be1c05aa92226b5eaeff40635a2ac4f06f2bd95e9ef13
MD5 62d30ceadb40594fe50de0d22dab1620
BLAKE2b-256 eb1004572994c98d02dc81676c800acb608e1cb594e1215620fa62c2d64c6b8b

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