ayuabtu-0.0.3
توضیحات
A package for units.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | ayuabtu-0.0.3 |
| نام | ayuabtu |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Lukas Halbritter |
| ایمیل نویسنده | halbi93@gmx.de |
| آدرس صفحه اصلی | https://github.com/MCHalbi/AllYourUnitAreBelongToUs |
| آدرس اینترنتی | https://pypi.org/project/ayuabtu/ |
| مجوز | - |
# AllYourUnitAreBelongToUs




## Installation
```
pip install ayuabtu
```
## Usage
### Creating quantities
Create quantities with a given unit:
```
>>> from ayuabtu.quantities import Length
>>> from ayuabtu.units import LengthUnit
>>> Length(2, LengthUnit.METER)
2 m
```
Or you can use the unit specific factory methods:
```
>>> from ayuabtu.quantities import Length
>>> Length.from_meters(2)
2 m
```
You can also access only the value with
```
>>> from ayuabtu.quantities import Length
>>> Length.from_meters(2).value
2
```
### Converting units
You can convert a quantity to a quantity with another unit
```
>>> from ayuabtu.quantities import Length
>>> from ayuabtu.units import LengthUnit
>>> distance_metric = Length.from_meters(2)
>>> distance_metric.to_unit(LengthUnit.FOOT)
6.561679790026246 ft
```
If you just need the numeric value of the quantity, but expressed in another
unit, use
```
>>> from ayuabtu.quantities import Length
>>> from ayuabtu.units import LengthUnit
>>> distance_metric = Length.from_meters(2)
>>> distance_metric.as_unit(LengthUnit.FOOT)
6.561679790026246
```
For this common usecase, there are also shorthand methods:
```
>>> from ayuabtu.quantities import Length
>>> distance_metric = Length.from_meters(2)
>>> distance_metric.feet()
6.561679790026246
```
### Quantity arithmetics
Coming soon ...
## Custom units
Coming soon ...
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.5 | Python |
نحوه نصب
نصب پکیج whl ayuabtu-0.0.3:
pip install ayuabtu-0.0.3.whl
نصب پکیج tar.gz ayuabtu-0.0.3:
pip install ayuabtu-0.0.3.tar.gz