Registry / data / iteround

iteround

JSON →
library1.0.4pypypi✓ verified 79d ago

A Python library for rounding iterables (lists, arrays, sets, etc.) while preserving the total sum of the original values. Version 1.0.4 is stable with no recent updates; maintained on GitHub.

pip install iteround
INSTALL
IMPORT
SIG · ITEROUND
I
iteround
datapythonv1.0.4
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

saferound
from iteround import saferound
from iteround import safe_round

Round each element while maintaining the sum of the original iterable.

from iteround import safe_round values = [1.5, 2.5, 3.5] rounded = safe_round(values, places=0) print(rounded) # Output: [2, 2, 4] (sum remains 7, same as original)
Debug
Known issues
gotchaThe function name is `safe_round`, not `iteround` or `round_iterable`. Using a wrong import will cause NameError.
fix
Use `from iteround import safe_round`.
affects: all
gotchaThe rounding algorithm adjusts some values to preserve the sum, so individual values may not round naively. This is intentional but can be surprising if you expect standard rounding.
fix
Understand that `safe_round` trades off per-element rounding accuracy for total sum preservation.
affects: all
deprecatedThe `topline` parameter in `safe_round` was added in 1.0.3 but may be renamed in future versions. Check the documentation for the latest signature.
fix
Always pass `topline` as a keyword argument to avoid breakage if the parameter order changes.
affects: 1.0.3+
Upgrade
Version history
1.0.4latest on PyPI · released Apr 20, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
iteround — pip install iteround · libregistry