Skip to main content

no-value

PyPI Python Tests License

Sentinel value to express missing keys or values where None has its own meaning.

Why?

When building APIs or update operations, you often need to distinguish between:

  • a value — set the field
  • None — clear the field
  • not provided — leave the field unchanged

Python's None can't cover both "clear" and "not provided". NoValue fills that gap.

Installation

pip install no-value

Usage

from no_value import NoValue


def update_user(name: str | None | NoValue = NoValue) -> None:
    if name is NoValue:
        pass  # not provided, do nothing
    elif name is None:
        clear_name()  # explicitly set to null
    else:
        set_name(name)  # update with new value

Behavior

  • Use is for comparison: val is NoValue
  • str(NoValue) and repr(NoValue) return "NoValue"
  • NoValue() raises TypeError — it cannot be instantiated
  • bool(NoValue) raises TypeError — to prevent accidental truthy/falsy checks

Limitations

Static analysis tools (mypy, pyright) do not fully support custom sentinel types. Type annotations like str | None | NoValue work at runtime but may produce warnings in strict mode.

License

MIT

Metadata

Release files for no-value 1.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 no-value 1.0.0
File Size Uploaded Provenance Actions
no_value-1.0.0.tar.gz 4.0 kB With provenance Details for no_value-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for no-value 1.0.0
File Interpreter ABI Platform Actions
no_value-1.0.0-py3-none-any.whl Python 3 none any Details for no_value-1.0.0-py3-none-any.whl

Total release size: 7.5 kB

Release files / no_value-1.0.0.tar.gz

Download URL no_value-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a42e471581a043ace99038a6ae0f38f994d13f9a5ba6196ad3298b4f06943193
BLAKE2b-256 checksum
How to use checksums
e694857e3e987a1b8100df299efb2ac54f5fae8e854cc31860c4ea281986120c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Release files / no_value-1.0.0-py3-none-any.whl

Download URL no_value-1.0.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
830d356747ed04b6802c33a2aaefe32a15da7fd8720915ad614231c548a7812e
BLAKE2b-256 checksum
How to use checksums
878aba20ef5a872c66a3734c08542e890888613d4afa844cb1f83e069a32885a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Security for no-value 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for no_value-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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