Skip to main content

Dozenal Type for Python

Project description

doz

Dozenal & Floating-point Dozenal types for Python 3.11+

Simply, defines doz the dozenal and fdz the floating-point dozenal.

from doz import doz, fdz

doz("1X")      # Decimal: 22
doz(22)        # Format from int
fdz("X4.E3")   # Decimal: 124.9375
fdz(124.9375)  # Format from float


# A class that supports casting to doz and fdz
class MyClass(object):
    def __init__(self) -> None:
        ...
    
    def __doz__(self) -> doz:
        return doz(...)
    
    def __fdz__(self) -> fdz:
        return fdz(...)


my_class = MyClass()
doz(my_class)
fdz(my_class)

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

doz-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

doz-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file doz-0.1.0.tar.gz.

File metadata

  • Download URL: doz-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for doz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0cb87d805c3b0227912da1809e98f9fb1d662226eeacbd51ed141b6779aaf87
MD5 feebe21bf9866669d62dd49d459c9856
BLAKE2b-256 7b4d3e519d2bc528738c50607a830d049f4a72f2f5225dac2884b5abcdcf165d

See more details on using hashes here.

File details

Details for the file doz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: doz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for doz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd26975c5fb9415f6f6b8e1441ebfccd54a2dcad8271699be9ffd71a989220f9
MD5 d761fb67999b048e988e18727916e6dc
BLAKE2b-256 5b95f455102b40e86dec92021c622988b9f54ee2d8cf42271236e214a68149c1

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