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-1.0.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-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: doz-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 69c5d21a84ee2f8cd4b0ad6e92adceb4721aaa67b578b10ecb5d6844a5f57e3e
MD5 08ffcf3dd596256f50653aa131c378ec
BLAKE2b-256 fa0ec9d97de29c2ade80514a6bec167af4eab070b4a6949936024f27fd264ff0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: doz-1.0.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1715cee2e4bc2898607e6f5422c5f4742389ce0df8e22216acbd65e5766c4892
MD5 5e178b549393c4fe4cf3d88e9de5c5db
BLAKE2b-256 b281228a9122b718543e7368bf73e813a141d248a13aa3336a94d7d037116ab8

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