{"id":23905,"library":"iteround","title":"iteround","description":"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.","status":"active","version":"1.0.4","language":"python","source_language":"en","source_url":"https://github.com/cgdeboer/iteround","tags":["rounding","iterable","sum-preserving","safe-round"],"install":[{"cmd":"pip install iteround","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"wrong":"from iteround import safe_round","symbol":"saferound","correct":"from iteround import saferound"}],"quickstart":{"code":"from iteround import safe_round\n\nvalues = [1.5, 2.5, 3.5]\nrounded = safe_round(values, places=0)\nprint(rounded)\n# Output: [2, 2, 4] (sum remains 7, same as original)","lang":"python","description":"Round each element while maintaining the sum of the original iterable."},"warnings":[{"fix":"Use `from iteround import safe_round`.","message":"The function name is `safe_round`, not `iteround` or `round_iterable`. Using a wrong import will cause NameError.","severity":"gotcha","affected_versions":"all"},{"fix":"Understand that `safe_round` trades off per-element rounding accuracy for total sum preservation.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Always pass `topline` as a keyword argument to avoid breakage if the parameter order changes.","message":"The `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.","severity":"deprecated","affected_versions":"1.0.3+"}],"env_vars":null,"search_vec":"'1.0.4':22 'array':9 'etc':11 'github':31 'iter':7,33 'iteround':1 'librari':4 'list':8 'maintain':29 'origin':19 'preserv':13,36 'python':3 'recent':27 'round':6,32,39 'safe':38 'safe-round':37 'set':10 'stabl':24 'sum':16,35 'sum-preserv':34 'total':15 'updat':28 'valu':20 'version':21","created_at":"2026-05-01T08:10:14.804178+00:00","updated_at":"2026-05-01T08:10:14.804178+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/cgdeboer/iteround","docs":null,"changelog":null,"pypi":"https://pypi.org/project/iteround/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}