no-value
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
isfor comparison:val is NoValue str(NoValue)andrepr(NoValue)return"NoValue"NoValue()raisesTypeError— it cannot be instantiatedbool(NoValue)raisesTypeError— 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
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.