Skip to main content

zincware PyPI version Coverage Status

znfields

Provide a getter and setter for dataclasses.fields to allow e.g. for lazy evaluation or field content validation.

pip install znfields

Example

The znfields.field supports all arguments from dataclasses.field with the additional getter argument.

import dataclasses
import znfields

def getter(self, name) -> str:
    return f"{name}:{self.__dict__[name]}"

def setter(self, name, value) -> None:
    if not isinstance(value, float):
        raise ValueError(f"Value {value} is not a float")
    self.__dict__[name] = value

@dataclasses.dataclass
class MyModel(znfields.Base):
    parameter: float = znfields.field(getter=getter, setter=setter)

Metadata

Release files for znfields 0.1.2

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

Source distribution (sdist)

Source distribution for znfields 0.1.2
File Size Uploaded Provenance Actions
znfields-0.1.2.tar.gz 7.0 kB Without provenance Details for znfields-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 14.7 kB

Release files / znfields-0.1.2.tar.gz

Download URL znfields-0.1.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d9e1894f1a766dd5675db1b1b05cfc6b5c9d78da84a5b01d0baffd5ca49a065
BLAKE2b-256 checksum
How to use checksums
2c3d4332bc037cf7bf3b5fd2a8e48f5c79d14c8d33b69af3d100a5a0e1e6ca3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

Release files / znfields-0.1.2-py3-none-any.whl

Download URL znfields-0.1.2-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
621c4746276a55637bb251494251e09671f4f4e74fbdaad7158d8a225e0d94e8
BLAKE2b-256 checksum
How to use checksums
b37efaa726144e92f8473157b402d5adec74daf9279605774d6e5b7cf881e676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

Security for znfields 0.1.2

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.

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