Utility functions around state changes.
Latest release 20240316: Fixed release upload artifacts.
Function delta(old, new, keys=None)
Return a mapping representing differences between the mappings
old and new for the specified keys.
If keys is not specified, the union of the keys of old
and new is used.
The returned mapping has a key for each changed value.
If the key does not exist in new the value is the MISSING
sentinel object otherwise it is new[key].
Values are compared using ==; if that raises TypeError
the values are considered not equal.
Example:
d1 = {1: 2, 3: 4, 5: 6} d2 = {1: 2, 3: 44, 7: 8} diff = delta(d1, d2) diff # doctest: +ELLIPSIS {3: 44, 5: <object object at ...>, 7: 8} diff[5] is MISSING True
Function monitor(get_state, keys=None, *, ifunchanged=False, interval=0.3, runstate=None)
A generator yielding 3-tuples of (old,new,delta(old,new,keys))
at poll intervals of interval seconds.
Parameters:
get_state: a callable which polls the current state, returning a mappingkeys: an optional iterable of keys of interest; if omitted, all the old and new mapping keys are examinedifunchanged: optional flag, defaultFalse; if true yield a tuple on every poll instead of only when a state change is seeninterval: an optional interpolltime.sleepperiod, default0.3srunstate: an optionalRunState, whosecancelledattribute will be polled for loop termination
Release Log
Release 20240316: Fixed release upload artifacts.
Release 20240214: Initial PyPI release.
Metadata
Release files for cs.delta 20240316
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 |
|---|---|---|---|---|
| cs.delta-20240316.tar.gz | 3.2 kB | Without provenance | Details for cs.delta-20240316.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cs.delta-20240316-py3-none-any.whl | Python 3 | none | any | Details for cs.delta-20240316-py3-none-any.whl |
Total release size: 6.7 kB
Release files / cs.delta-20240316.tar.gz
| Download URL | cs.delta-20240316.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27eb7f117f0b65925c2dbf44bb887e644dac0efb921b1001d5b2b8fa2bae5580
|
|
BLAKE2b-256 checksum How to use checksums |
c71a13c9e4bc634bc81c6cecdef57a3a1b129e7d324c6d81e9eb2c9d8c7f9f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.6
|
Release files / cs.delta-20240316-py3-none-any.whl
| Download URL | cs.delta-20240316-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a8abcc6802c2e2cb2d390baccd1a53df722aa5a58f2e52e3d4de88f21057efc
|
|
BLAKE2b-256 checksum How to use checksums |
f9d0ce387add470fba87c02bf4d94b92ed089c7b5be7d03d1c56035dd0edd402
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.6
|
Security for cs.delta 20240316
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.