Skip to main content

Release status PyPI package Supported Python versions Build Status Coverage Status Documentation Status Pypi downloads Pypi downloads

pyoload

This adds some runtime type checking and warnings when enabled. It is disabled by default.

Pyoload permits you to add runtime checking to classes on instance attribute assignment and functions.

usage

pyoload provides two basic methods:

  • pyoload.annotate: decorator over functions or methods.
  • pyoload.annotate_class: decorator over classes. All wrapped by pyoload() which checks what to be called.
import pyoload

pyoload.debug()

@pyoload
def foo(a: int, b, c: str) -> tuple[str, int]:
    return ("ab", 23)

@pyoload
class myclass:
    pass

pyolaod modes

Pyoload includes three modes of enum type pyoload.Mode and where the current mode is in pyoload.MODE.

  • DEBUG: Shows warnings, comments, exceptions activate via pyoload.debug()
  • DEV : Does not call upon validatore
  • PROD(DEFAULT): @pyoload simply does nothing.

Adding validators

You may add validators to check values furthermore.

def validator(value) -> Optional[str]:
    if value.is_ok():
        return None
    else:
        return "Value is not Ok! pass a value which is Ok please."

@pyoload(comments=dict(val=validator))
def func(val):
    pass

Metadata

Release files for pyoload 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyoload 3.0.0
File Size Uploaded
pyoload-3.0.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyoload 3.0.0
File Interpreter ABI Platform
pyoload-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / pyoload-3.0.0.tar.gz

Download URL pyoload-3.0.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1026f6981f47d91e4e70562232fa38759a5fdf924e5ce913fe3c1cbaf819830a
BLAKE2b-256 checksum
How to use checksums
1e2d7fbe1c023d294976f8bc0d20f244cb8b7cacd8a4b4de42fc6853d7d96c3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.8

Release files / pyoload-3.0.0-py3-none-any.whl

Download URL pyoload-3.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb3a4f5f968392a9bf9dada23322df05cc31627b119a3837651c24923e190e56
BLAKE2b-256 checksum
How to use checksums
fc5008d5ca87a02190303f59d47b9f17cc0d08d7814510c38a055fc53444e6b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page