A simple Python package to convert between common units
Project description
simpleconverts
SimpleConverts est un package Python léger pour convertir facilement les unités courantes : distances, masses, températures, volumes, temps et énergie. Idéal pour les scripts rapides, la cuisine, le sport ou tout usage quotidien.
Ce dépôt contient le code source officiel et la documentation de SimpleConverts : GitHub Repository
Installation
Depuis PyPI
pip install simpleconverts
Installation locale (développement)
git clone https://github.com/Coder-Edge/Simpleconverts.git
cd Simpleconverts
pip install -e .
Exemples d’utilisation
from simpleconverts.convert import convert
# Distances
print(convert(10, "km", "mi")) # 6.2137
# Masse
print(convert(100, "kg", "lb")) # 220.46
# Température
print(convert(25, "C", "F")) # 77.0
# Volume
print(convert(2, "L", "cup")) # 8.33
# Temps
print(convert(1, "h", "min")) # 60
# Énergie
print(convert(500, "cal", "kJ")) # 2.092
Unités supportées
- Distances : m, km, cm, mm, mi, yd, ft, in
- Masse : g, kg, t, lb, oz
- Températures : C, F, K
- Volumes : L, mL, cL, gal, qt, pt, cup, floz
- Temps : s, min, h, d, week, month, year
- Énergie : J, kJ, kWh, cal, kcal
Contribution
Les contributions sont les bienvenues !
- Fork le dépôt
- Crée une branche pour ta feature (
git checkout -b ma-feature) - Commit tes modifications (
git commit -m 'Ajout d'une nouvelle conversion') - Push ta branche (
git push origin ma-feature) - Ouvre un Pull Request
Tests
Pour lancer les tests unitaires, utilisez unittest :
python -m unittest discover tests
Licence
Ce projet est sous MIT License. Voir le fichier LICENSE pour plus de détails.
Auteur
Coder Edge Email : coderedgeorg@gmail.com GitHub : https://github.com/Coder-Edge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simpleconverts-0.1.0.tar.gz.
File metadata
- Download URL: simpleconverts-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69bceecd4412656f3b9513a3ab7109a071c037e1a9ddfbf395439df5d9ec4be5
|
|
| MD5 |
0b6c3b18cb26da7430e4ee7f2051cd8e
|
|
| BLAKE2b-256 |
b99b52f76d69cfa072c7a4c89b4214990acd74131ec4b92fb1da0928257fd751
|
File details
Details for the file simpleconverts-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simpleconverts-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06f3049cc46fb25f4078f3634f84c1ba3ab86a64d6b08df9b8ec404fdb2ec2fe
|
|
| MD5 |
9dee547333e24ee3f84b81f87219e8e5
|
|
| BLAKE2b-256 |
e9a567996e133aa65eeb919f0b8e7c47a8994d540b307c2da993576cf508a8a8
|