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 ...
Metadata
Release files for ayuabtu 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ayuabtu-0.0.3.tar.gz | 7.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ayuabtu-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.0 kB
Release files / ayuabtu-0.0.3.tar.gz
| Download URL | ayuabtu-0.0.3.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff86e21eab627caf8b90ead5e0af58f78d8e1afc1840c37fa7aadff3a7dc57ba
|
|
BLAKE2b-256 checksum How to use checksums |
c4533d77cd700ccbed4d0a9de493f68a6a1fda98023e46359aae620d4a1d3ffe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
|
Release files / ayuabtu-0.0.3-py3-none-any.whl
| Download URL | ayuabtu-0.0.3-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6eef651d1dc91c49d3188376e6ebae11385240d72a0a2adfca1d74516f9fd4f9
|
|
BLAKE2b-256 checksum How to use checksums |
8ab64e7b29ae956e456badb7b6a215174c6e344d0a534837f691ccd8e536d8e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
|
Security for ayuabtu 0.0.3
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.